There is a blog I read occasionally that has a breadth indicator that he uses to gauge the market.
http://throwinggoodmoney.com/matts-breadth-indicator/
His breadth indicator counts up all the stocks that are current members of the Russell 3000 and that are up >30% in the last 60 trading days. Then counts the number that are more than 30% down. These figures are applied to a breadth diffusion calculation like this:
up30 / (up30 + down30 ) * 100
I’m not sure how to count the number of stocks up or down and store them as a variable without doing an exploration each time, as I would like to backtest the idea.
Any ideas anyone please?