Hi, I’d appreciate help with a multi timeframe screener please. Basically a pin bar (hammer, inverted, hanging man or shooting star) on M15 with an established trend (using EMA for the trend) in a higher timeframe, H1.
Criteria for H1
UP = EMA20 > EMA50 > EMA 100
DOWN= EMA 100 > EMA50 > EMA20
Criteria for M15
Pin bar
Thanks for your help
KR,
There you go.
Timeframe(1h)
Ema20 = average[20,0](close)
Ema50 = average[50,0](close)
Ema100 = average[100,0](close)
UP = Ema20 > Ema50 AND Ema50 > Ema100
DOWN = Ema20 < Ema50 AND Ema50 < Ema100
Timeframe(15 minute)
N = 30
Body = abs(close - open)
UPPERwick = high - max(open,close)
LOWERwick = min(open,close) - low
bb = body <= (range / 3) //body no longer than 1/3 of the range
L1 = LOWERwick >= (range / 3 * 2) //LONG: lower wick at least 2/3 of the range
S1 = UPPERwick >= (range / 3 * 2) //SHORT: upper wick at least 2/3 of the range
L2 = low = lowest[N](low) //LONG: must be the lowest price in the last N periods
S2 = high = highest[N](high) //SHORT: must be the highest price in the last N periods
Timeframe(default)
Lcond = UP AND bb AND L1 AND L2
Scond = DOWN AND bb AND S1 AND S2
Result = 0
IF Lcond THEN
Result = 1
ELSIF Scond THEN
Result = 2
ENDIF
SCREENER[Result](Result AS "1=↑, 2=↓")
I used SMAs instead of EMAs, because with the old ProScreener 100 periods are too many for EMAs as they need more than 254 bars to be calculated. If you lower the periods from 100 to approximately 70-80, or if you have the new version of ProScreener, just replace “,0]” with “,1]” when AVERAGE is used.
I also added that PinBARs have to show only when they are at a highest or lowest. You can set N to any lookback period you need (no more than 254 with old ProScreener). To disable this feature, simply replace lines 15-16 with:
L2 = 1//low = lowest[N](low) //LONG: must be the lowest price in the last N periods
S2 = 1//high = highest[N](high) //SHORT: must be the highest price in the last N periods