OPEN-SOURCE SCRIPT

Price Action: Engulfing Patterns

148
Bullish Engulfing Pattern Detection: A bullish engulfing pattern is identified when the previous candle is bearish (close[1] < open[1]), the current candle is bullish (close > open), and the current candle's body engulfs the previous candle's body (close >= open[1] and open <= close[1]).

Bearish Engulfing Pattern Detection: A bearish engulfing pattern is identified when the previous candle is bullish (close[1] > open[1]), the current candle is bearish (close < open), and the current candle's body engulfs the previous candle's body (open >= close[1] and close <= open[1]).

Plotting the Patterns: The plotshape function is used to mark the detected patterns on the chart. Bullish engulfing patterns are marked below the bar with a green upward label, while bearish engulfing patterns are marked above the bar with a red downward label.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.