Imbalance Detection:
Bullish Imbalance: Occurs when the high of the bar two periods ago is lower than the low of the current bar, indicating a possible reversal to the upside.
Bearish Imbalance: Occurs when the high of the current bar is lower than the low of the bar two periods ago, indicating a potential reversal to the downside.
Visual Highlighting:
The script changes the color of the previous bar (one bar before the imbalance) based on whether a bullish or bearish imbalance is detected.
Users can customize the color for both bullish and bearish imbalances to suit their preferences.
User Inputs:
Show Imbalance: Option to toggle the visibility of the imbalance signals on the chart.
Color Customization: Users can choose custom colors for bullish and bearish imbalances, allowing for easy distinction between the two types.
Alert Conditions:
The script includes pre-configured alert conditions for both bullish and bearish imbalances, notifying traders when an imbalance is detected, which can be useful for triggering trades or further analysis.