Hey guys, hope everyone had a good Christmas and New Year.
I'm trying to create some market breath based indicators and am curious to see how it correlates to the market/ act as a potential timing model etc.
For example, %stocks in the S&P500 above the 200dma is a common breadth indicator.
if I wanted to create something similar and add in some other variables such as.
- % stocks " " above the 50d moving &
- % stocks " " above the 20d moving
as what would be the % of stocks in sp500 if all 3 conditions held true - what would be best way to go about it?
I've thought about going about it via backtest. In which when all those conditions are true = buy and when not = sell. Run it against the SP500 and export the data. tally up the sum of true results/trade would be held for a given day in a column then re-upload that data.
However, I'm hoping their be an easier way/ an AFL function that refers/runs against everything in a watchlist but I'm not sure what exactly it might be.
I know of
foreign() function but would like to refer to all stocks instead of just one ticker
Any thoughts would be appreciated and a huge help.