OPEN-SOURCE SCRIPT

[TehThomas] - ICT Volume Imbalance

277
This script is a Volume Imbalance (VI) detector and visualizer for use on the TradingView platform. The goal of the script is to automatically identify areas where there are significant imbalances in the volume of trades between consecutive candlesticks and visually highlight these areas. These imbalances can provide traders with valuable insights about the market’s current condition, often signaling potential reversal or continuation points based on price and volume action.

ICT (Inner Circle Trader) Concept of Volume Imbalances

Volume imbalances are a critical concept in the ICT trading methodology. They refer to situations where there is an unusual or significant difference in volume between two consecutive candlesticks, which might indicate institutional or large player activity. According to ICT principles, these imbalances can show us areas of market inefficiency or potential price manipulation. By identifying these imbalances, traders can gain an edge in understanding where the market is likely to move next.

Bullish and Bearish Volume Imbalances:
Bullish Volume Imbalance: This occurs when there is a strong increase in buying pressure, typically indicated by a higher volume on a candle that closes significantly above the previous one, often leaving a gap or larger price movement. The market could be preparing to push higher, and the volume shows a clear shift in buying demand.
لقطة

Bearish Volume Imbalance:
Conversely, a bearish imbalance occurs when there is a strong increase in selling pressure, typically signaled by a candle that closes significantly lower than the previous one, again with higher volume. This could indicate that large players are offloading positions, and the price is likely to drop further.
لقطة

Key Features and Functions of the Script
The script automates the process of detecting these volume imbalances and visually marking them on a price chart. Let’s explore its functionality in detail.

1. Inputs Section
The script allows for significant customization through its input options, which help traders adjust the detection and visualization of volume imbalances based on their individual preferences and trading style. Below are the details:
  • lookback (250 bars): This input specifies the number of bars (or candles) the script should look back when analyzing the volume imbalance. By setting this to 250, the user is looking at the last 250 bars on the chart to detect any significant volume imbalances. This period is adjustable between 50 to 500 bars.
  • volumeThreshold (1.0 multiplier): This input helps set the sensitivity for identifying volume imbalances. The script compares the volume of the current candle with the previous one, and if the current volume exceeds the previous volume by this threshold multiplier (in this case, 1.0 means at least equal to the previous volume), then it triggers an imbalance. Users can adjust the multiplier to suit different market conditions.
  • showBoxes (true/false): This toggle determines whether the boxes representing volume imbalances are drawn on the chart. When enabled, the script visually highlights the imbalances with colored boxes.
  • fillBaseColor (orange with 80% opacity): This is the color setting for the background of the imbalance boxes. A softer color (like orange with opacity) ensures the imbalance is highlighted without obscuring the price action.
  • borderColor (gray): The color of the border around the imbalance boxes. This adds a visual distinction to make the imbalance areas more visible.
  • borderWidth (1 pixel): This controls the width of the box's border to adjust how prominent it appears.
  • rightOffset (30 bars): This input controls how far the imbalance box extends to the right on the chart. It helps users anticipate the potential continuation of the imbalance beyond the current candle.
  • allowWickOverlap (true/false): This setting allows imbalances to be identified even if the wicks of the two consecutive candlesticks overlap. If set to false, only imbalances where the bodies of the candlesticks don’t overlap are considered.
  • showBrokenBoxes (true/false): If enabled, once a volume imbalance no longer holds true (i.e., the price breaks through the box), the box is marked as "broken." If disabled, the box is deleted when the imbalance condition no longer applies.
  • brokenBoxColor (red): This controls the color of the box when it is broken, which can be used as a visual cue that the imbalance was invalidated or no longer valid for analysis.

2. Volume Imbalance Function
This is the core function of the script, where the logic to detect bullish and bearish volume imbalances is implemented.

Bullish Imbalance Condition:
  • The first condition checks if the low of the current candle is greater than the high of the previous candle. This suggests that the market is moving upward with buying pressure.
  • The second condition checks whether the volume of the current candle is higher than the previous candle by the volumeThreshold multiplier. If both conditions are satisfied, a bullish imbalance is detected.

Bearish Imbalance Condition:
  • The first condition checks if the high of the current candle is lower than the low of the previous candle. This suggests downward price action with selling pressure.
  • The second condition checks whether the current volume exceeds the previous volume by the threshold

Allow Wick Overlap: If allowWickOverlap is set to true, the script will still detect imbalances if the wicks of the two candles overlap (common in volatile markets). If false, imbalances are only considered if the wicks do not overlap.

3. Box Creation and Management
When a volume imbalance is detected, the script creates a box on the chart:
  • The bullish imbalance box is drawn using the minimum of the open and close of the current bar as the top boundary and the maximum of the open and close of the previous bar as the bottom boundary.
  • Conversely, the bearish imbalance box is drawn in reverse, using the maximum of the current bar’s open and close as the top boundary and the minimum of the previous bar’s open and close as the bottom boundary.

Once the box is created, it is displayed on the chart with the specified background color, border color, and width.

4. Processing Existing Boxes
After detecting a new imbalance and drawing a box, the script checks whether the box should still remain on the chart:
  • If the price moves beyond the boundaries of the imbalance box, the box is marked as broken (if showBrokenBoxes is enabled), and its color is changed to red, signifying that the imbalance is no longer valid.
  • If the box remains intact (i.e., the price has not broken the defined boundaries), the script keeps the box extended to the right as the market continues to evolve.

5. Removing Outdated Boxes
  • Lastly, the script removes boxes that are older than the specified lookback period. For example, if a box was created 250 bars ago, it will be deleted after that period. This ensures the chart stays clean and only focuses on relevant imbalances.

Why This Script is Useful for Traders
This script is extremely valuable for traders, especially those following the ICT methodology, because it automates the process of detecting market inefficiencies or imbalances that might signal future price action. Here’s why it’s particularly useful:
  • Identifying Key Areas of Interest: Volume imbalances often point to areas where institutional or large-scale traders have entered the market. These areas could provide clues about the next significant move in the market.
  • Visualizing Market Structure: By automatically drawing boxes around volume imbalances, the script helps traders visually identify potential areas of support, resistance, or turning points, enabling them to make informed trading decisions.
  • Time Efficiency: Instead of manually analyzing each candlestick and volume spike, this script does the heavy lifting, saving traders valuable time and allowing them to focus on other aspects of their strategy.
  • Enhanced Trade Entries and Exits: By understanding where volume imbalances are occurring, traders can time their entries (buying during bullish imbalances and selling during bearish ones) and exits (as imbalances break) more effectively, thus improving their chances of success.

Conclusion
In summary, this script is a powerful tool for traders looking to implement volume imbalance strategies based on the ICT methodology. It automates the identification and visualization of significant imbalances in price and volume, offering traders a clear visual representation of potential market turning points. By customizing the settings, traders can tailor the script to their preferred timeframes and sensitivity, making it a flexible and effective tool for any trading strategy.

__________________________________________

Thanks for your support!
If you found this idea helpful or learned something new, drop a like 👍 and leave a comment, I’d love to hear your thoughts! 🚀

Make sure to follow me for more price action insights, free indicators, and trading guides. Let’s grow and trade smarter together! 📈

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.