Hi All,
New to ProRealCode and ProRealTime.
Seeking to have a simple Market Screener that allows me to not only search for tickers making a new 52-week high, (i.e. previous daily close = 52-week high), but also to have a variable input for how many days ago it reached a 52-week high (i.e. 5-days ago, 10-days ago, 20-days ago etc.).
Hope this is clear and imagine this is relatively easy…can anyone help?
Thanks in advance!
Best,
Dave
There you go:
TIMEFRAME(weekly)
MyHigh = highest[52](high) //highest in 52 weeks
TIMEFRAME(daily)
x = (high[10] = MyHigh) //10 days ago was true?
TIMEFRAME(default)
SCREENER [x]
You can change lookback numbers as they best fit your requirements.
Roberto,
Much appreciated!…Thank you!
Wondering if you could help with two small refinements:
(1) Can we add a variable/condition that filters based on volume (i.e. filter for stocks that have 20-day avg. daily volume greater than 1MM) with the idea being that the “1MM” can be modified?
(2) Can we add a variable/condition that filters based on a price range (i.e. screen for stocks between X and Y such as $70-$100?)… and again, idea being that the range (or X’s and Y’s) can be modified?
Thank you in advance!…Really appreciate your help!
Best,
Dave
Not sure what “default” means but targeting “Daily”.
appreciate your help Roberto, did go through the various trading videos and even numerous scans in the library to try and do it myself…just couldn’t make those refinements work.
Thanks in advance!
Dave
This is the updated version (not tested):
TIMEFRAME(weekly)
MyHigh = highest[52](high) //highest in 52 weeks
TIMEFRAME(daily)
x = (high[10] = MyHigh) //10 days ago was true?
y = average[20](Volume) > 1000000 //change both Periods and Volume to what best suits your needs
z = close >= 0 AND close <= 99999 //change both values to fit your desired range
a = x AND y AND z
TIMEFRAME(default) //default TF is the one you select for the screener to be executed
SCREENER [a]
Hi Roberto,
Just played around with it and it seems to be working perfectly!
Thanks again for this…greatly appreciated! 🙂
Happy Trading,
Dave
Hi,
Could i ask for a little help to refine this please? The screener above returns stocks whose 52W high was EXACTLY 10 days ago.
How can I return a list of stocks where the current price is under the 52W high but that 52W high didn’t appear in the last 10 days? I want to ignore stocks where the 52W high has appeared within the last 10days but the stock price is currently under the 52W high (of more than 10 days ago)?
I’ve tried with summation but with no luck 🙁
Thanks.
I’ve tried this but couldn’t get it to work…
hh = highest[250](high) // Find the highest value in last 250 days
c0 = summation[10](close < hh) = 10 // For last 10 days check that it is less than the highest 250D value
screener[c0]
There you go:
TIMEFRAME(weekly)
MyHigh = highest[52](high) //highest in 52 weeks
//
TIMEFRAME(daily)
x = (summation[10](high < MyHigh) = 10)//in the last 10 days MyHigh has not been reached
y = average[20](Volume) > 1000000 //change both Periods and Volume to what best suits your needs
z = close >= 1000 AND close <= 999999 //change both values to fit your desired price range
w = close < MyHigh[11] //price below MyHigh for at least 11 days
//
TIMEFRAME(default) //default TF
a = x AND y AND z AND w
SCREENER [a]
Hi Roberto,
Thank you very much for the quick and concise reply. It works like a dream.