OPEN-SOURCE SCRIPT

Engulfing and ATR-Imbalance [odnac]

This Pine Script indicator combines two powerful concepts—Engulfing Candlestick Patterns and ATR Imbalance—to identify potential market reversal points with increased precision.

  • Engulfing Candlestick Patterns:

    Bullish Engulfing: Identified when a candle closes higher than it opens, and it completely engulfs the previous candle (previous close is lower than the current open, and previous high is lower than the current close).

    Bearish Engulfing: Identified when a candle closes lower than it opens, and it completely engulfs the previous candle (previous close is higher than the current open, and previous low is higher than the current close).

    Bar Coloring: These patterns are highlighted with a customizable color (light gray by default) to make them easily identifiable.


  • ATR-Based Imbalance:

    The Average True Range (ATR) is used to measure market volatility, and this script checks if the current candle’s range (difference between high and low) exceeds a defined multiple of the ATR, indicating a possible imbalance.

    Imbalance Detection: If the current candle’s range is greater than ATR * imbalance multiplier (default multiplier: 1.5), it is marked as an ATR imbalance.

    Bar Coloring: Candles with a significant imbalance (greater range than the ATR-based threshold) are highlighted in yellow, indicating an outlier or extreme price movement.


  • Engulfing + ATR Imbalance:

    When both a Bullish Engulfing pattern and an ATR Imbalance are detected, a green triangle up is plotted below the bar, signaling a potential bullish reversal.
    Conversely, when both a Bearish Engulfing pattern and an ATR Imbalance occur, a red triangle down is plotted above the bar, signaling a potential bearish reversal.


  • User Inputs:

    Engulfing Plot: Enable or disable the plotting of Engulfing Candles.

    ATR Length: Set the period used to calculate the ATR (default is 5).

    Imbalance Multiplier: Adjust the multiplier to define the threshold for ATR imbalance detection (default is 1.5).

    Bar Colors: Customizable color for both Engulfing candles and Imbalance candles.

    Engulfing & Imbalance Plot: Enable or disable plotting of the combined conditions (Engulfing + ATR Imbalance) with arrows.


How This Indicator Helps:
By combining price action patterns with volatility analysis, this indicator highlights high-probability reversal points where significant price movement (imbalance) coincides with a clear Engulfing pattern. Traders can use these signals to time entries or exits based on both price action and market volatility.

Declinazione di responsabilità