Hi guys please can you help setup a screener for the following.
A 30 minute hammer candle which has gone from low and closed near high
the candles low to high is 5% or more of the company price
thank you!
This screener’s code should work as intended:
body=close-open
abody=abs(body)
if range>0 then
ratio=abody/range
else
ratio=0
endif
shadowtop=high-bodytop
shadowbottom=bodybottom-low
bodytop=max(open, close)
bodybottom=min(open, close)
longcandle= (ratio>0.6)
Hammer=(longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody) and range/close>0.05
screener[Hammer](range/close)
5% is a big candlestick, it filters a lot the results.
thanks very much for your help!
Sorry just one more thing would you be able to add to the above code to find those stocks which are 20% or less away from 52 week highs.
thanks in advance
Sure, try this new code, I added the weekly Close / 52 weeks HighestHigh ratio as the criteria:
timeframe(weekly)
wratio = close/Highest[52](high)[1]
lessthan20 = wratio>=0.8
timeframe(default)
body=close-open
abody=abs(body)
if range>0 then
ratio=abody/range
else
ratio=0
endif
shadowtop=high-bodytop
shadowbottom=bodybottom-low
bodytop=max(open, close)
bodybottom=min(open, close)
longcandle= (ratio>0.6)
Hammer=(longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody) and range/close>0.05 and lessthan20
screener[Hammer](wratio)