I’m just starting out using PRT so apologies if I’m missing something obvious here. I’ve been building a simple screener and wanted to include a test to see that the 200 day moving average had been going up continuously for a period to establish the share was in an uptrend. I’ve tried a few different timeframes and noticed that I no stocks passed the screening if I tested for 60 days but I get hundred of results at 55 days. I ended up finding that the screener would return no results if I used 56 days.
So, testing on both Australian Stocks and UK stocks, I get hundreds of results with this code
200 day moving average rises continuously for 55 days
1
2
3
4
5
ma200=average[200]
c1=summation[55](ma200>ma200[1])=55
Screener[c1]
but no results with this code
test that 200 day moving average has continuously risen for 56 days
i could be wrong but i think there is a year limit on lookback and 200 plus 55 days is a trading day year from memory so that would explain why 55 is the limit
Thanks, that makes sense and I think you’re correct. I just changed it to a 100 day moving average and that shifted the threshold from 55 days to 155 days.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue