Screener explanation:
TimeFrame(Daily)
ATR14D=AverageTrueRange[14](Close)
TimeFrame(15 minutes)
If IntraDayBarIndex=0 then
Move=abs(Close-Open)
EndIf
c1=Move/ATR14D>0.25
TimeFrame(5 minutes)
PrevBodyHigh=max(Open[1],Close[1])
PrevBodyLow=min(Open[1],Close[1])
CurrBodyHigh=max(Open,Close)
CurrBodyLow=min(Open,Close)
If IntraDayBarIndex>3 and IntraDayBarIndex<18 then
BullEngulf=(Close>Open) AND (Close[1]<Open[1]) AND (CurrBodyHigh>=PrevBodyHigh) AND (CurrBodyLow<=PrevBodyLow)
BearEngulf=(Close<Open) AND (Close[1]>Open[1]) AND (CurrBodyHigh>=PrevBodyHigh) AND (CurrBodyLow<=PrevBodyLow)
EndIf
Screener[c1 and (BullEngulf or BearEngulf)]
On the 1-day timeframe, the Average True Range over the last 14 days is calculated using ATR14D = AverageTrueRange[14](Close).
On the 15-minute timeframe, the opening candle is identified using IntraDayBarIndex = 0.
The absolute price move of this first candle is then calculated as Move = abs(Close - Open).
Next, it is checked whether this move exceeds 25% of the 14-day ATR, expressed by the condition C1 = Move / ATR14D > 0.25.
On the 5-minute timeframe, the candle body of both the previous and the current bar is determined by calculating PrevBodyHigh = max(Open[1], Close[1]) and PrevBodyLow = min(Open[1], Close[1]) for the previous bar, and CurrBodyHigh = max(Open, Close) and CurrBodyLow = min(Open, Close) for the current bar.
The time window in which the engulfing pattern must occur is then defined as between 15 and 90 minutes after the market open, which is enforced by the condition If IntraDayBarIndex > 3 AND IntraDayBarIndex < 18 Then.
Within this time window, a bullish engulfing pattern is defined as (Close > Open) AND (Close[1] < Open[1]) AND (CurrBodyHigh >= PrevBodyHigh) AND (CurrBodyLow <= PrevBodyLow), while a bearish engulfing pattern is defined as (Close < Open) AND (Close[1] > Open[1]) AND (CurrBodyHigh >= PrevBodyHigh) AND (CurrBodyLow <= PrevBodyLow).
The screener ultimately scans for the combination of the initial Move and the occurrence of an engulfing pattern.