MaryParticipant
Average
Hello,
How do you describe a condition for Screener where you want to screen stocks whose Price is above 200 Moving Average for 5 months straight, not less, not more, Exactly 5 months?
Thank you.
You can code it like this, with a monthly timeframe that has sufficient history to compute a 200 period moving average:
timeframe(monthly)
c1 = summation[5](close>average[200])=5
screener[c1]
or you can also make it on a daily timeframe, to check for the last 100 days (which is roughly 5 months of trading days)
timeframe(daily)
c1 = summation[100](close>average[200])=100
screener[c1]