OPEN-SOURCE SCRIPT
Directional Imbalance Index [BigBeluga]

🔵 OVERVIEW
The Directional Imbalance Index is designed to track market strength by counting how often price sets new highs or lows over a defined lookback period. Every time a bar forms a new extreme, the indicator records a +1 count for either bullish (highs) or bearish (lows). These counts are aggregated into a rolling calculation, allowing traders to see which side dominates and how directional imbalance evolves.
🔵 CONCEPTS
🔵 FEATURES
🔵 HOW TO USE
🔵 CONCLUSION
The Directional Imbalance Index [BigBeluga] offers a systematic way to measure directional pressure. By counting how often price pushes into new territory, the indicator reveals whether bulls or bears are taking control. This makes it a valuable tool for detecting early signs of trend continuation or exhaustion, helping traders align with the side most likely to dominate.
The Directional Imbalance Index is designed to track market strength by counting how often price sets new highs or lows over a defined lookback period. Every time a bar forms a new extreme, the indicator records a +1 count for either bullish (highs) or bearish (lows). These counts are aggregated into a rolling calculation, allowing traders to see which side dominates and how directional imbalance evolves.
🔵 CONCEPTS
- Each new highest high → adds a bullish count (+1).
- Each new lowest low → adds a bearish count (+1).
- Counts are stored inside arrays over a user-defined Calculation Period.
Pine Script® for i = 0 to period-1 h = high l = low if h == upper countUp.push(1) if l == lower countDn.push(1) - The balance between bullish and bearish counts highlights dominance and imbalance.
- Normalized percentages help compare both sides (e.g., 65% bullish vs 35% bearish).
🔵 FEATURES
- Counts new highs/lows over a chosen Highest/Lowest Length.
- Aggregates values over a rolling Calculation Period.
- Plots cumulative bullish vs bearish totals in the subchart.
- Displays % share of bulls vs bears from total counts.
- On-chart [+1] labels mark bars where a count was added.
- Plots reference lines of the current upper (high) and lower (low) ranges.
- Dynamic fill between bullish/bearish plots to visualize which side dominates.
🔵 HOW TO USE
- Look for persistent bullish imbalance (bull % > bear %) as confirmation of upward momentum.
- Look for persistent bearish imbalance (bear % > bull %) as confirmation of downward momentum.
- Watch for shifts in % dominance — often early signs of trend reversal or weakening strength.
- Use [+1] labels on the chart to visually confirm which bars contributed to directional bias.
- Combine with trend or volume tools to confirm whether imbalance aligns with market direction.
🔵 CONCLUSION
The Directional Imbalance Index [BigBeluga] offers a systematic way to measure directional pressure. By counting how often price pushes into new territory, the indicator reveals whether bulls or bears are taking control. This makes it a valuable tool for detecting early signs of trend continuation or exhaustion, helping traders align with the side most likely to dominate.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội Quy.
🔵Gain access to our powerful tools : bigbeluga.com/tv
🔵Join our free discord for updates : bigbeluga.com/discord
All scripts & content provided by BigBeluga are for informational & educational purposes only.
🔵Join our free discord for updates : bigbeluga.com/discord
All scripts & content provided by BigBeluga are for informational & educational purposes only.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội Quy.
🔵Gain access to our powerful tools : bigbeluga.com/tv
🔵Join our free discord for updates : bigbeluga.com/discord
All scripts & content provided by BigBeluga are for informational & educational purposes only.
🔵Join our free discord for updates : bigbeluga.com/discord
All scripts & content provided by BigBeluga are for informational & educational purposes only.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.