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.
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.
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.
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.