OPEN-SOURCE SCRIPT

Volume Imbalance Engine [BTT]

78
█ Overview
Volume Imbalance Engine [BTT] is a real-time volume structure analyzer that detects buyer/seller dominance at every price level and generates actionable entry signals. Unlike traditional volume profile tools that draw static histograms, this indicator colors your candles, marks live void zones, and fires precise entries — so you can read the market at a glance.

The core engine builds a rolling volume profile behind the scenes, classifies each price level as buyer-controlled, seller-controlled, void, or balanced, then projects that information directly onto your price action.


█ How It Works

Imbalance Detection
The engine scans a configurable lookback window and divides the price range into granular rows. For each row, it accumulates bullish volume (close > open bars) and bearish volume (close ≤ open bars) based on how much of each bar's range overlaps that price level. This produces a bull/bear percentage at every price — revealing who truly controls each zone.

Candle Coloring
Each candle is painted according to the volume imbalance at its price level:
• Bright green — strong buyer dominance (configurable threshold, default 65%)
• Light green — mild buyer advantage
• Bright red — strong seller dominance
• Light red — mild seller pressure
• Gray — balanced or insufficient data

This gives you an instant visual map of where buyers and sellers have been active without cluttering your chart.

Volume Voids
When the engine detects a price level with near-zero historical volume, it marks it as a void zone — an orange box extending to the right. These are true untraded regions where price moved so fast that no liquidity exchanged hands. Void boxes automatically close when price revisits and fills the zone. You can control the maximum number of visible voids to keep your chart clean.

Entry Signals
Two distinct signal types, both requiring volume surge + EMA trend confirmation:
• VOID — Price enters a previously untraded zone with above-average volume in the direction of the trend. These zones act as liquidity magnets and often produce sharp reactions.
• FLIP — Price reclaims a level that was dominated by the opposite side. A bearish zone broken to the upside with volume = bullish flip signal, and vice versa. This captures momentum shifts at structurally significant levels.

Signals are deduplicated (no repeats within 3 bars) to avoid noise.

Delta Ribbon
The trend EMA line is dynamically colored by the smoothed volume delta at the current price level. Green shades indicate net buying pressure, red shades indicate net selling pressure. This acts as both a trend filter and a visual delta indicator without taking extra chart space.

Info Panel
A compact table in the top-right corner displays:
• Bull Volume % at current price level
• Bear Volume % at current price level
• Net Delta %
• Current zone classification (VOID / BUYERS / SELLERS / BALANCED)


█ How to Use

Follow the Candle Colors
Green candles in a sequence = price moving through buyer-controlled territory. When you see a transition from red to green with a FLIP label — that's a structural shift worth watching.

Trade the Voids
Void zones are unfinished business. When price approaches an orange box with momentum (volume surge + trend alignment), the VOID signal fires. These setups work well as continuation entries in trending markets.

Confirm with Delta Ribbon
Use the colored EMA as a directional filter. Taking longs when the ribbon is green and shorts when it's red keeps you aligned with the dominant volume flow.

Monitor the Info Panel
The panel gives you a real-time read on market structure at your current price. "VOID" means you're in thin air. "BUYERS" or "SELLERS" tells you who built this level. Use it for context before entering or managing trades.


█ Settings

Imbalance Engine
• Analysis Window — Number of bars scanned for the volume profile (default: 80)
• Price Resolution — Number of price rows in the profile (default: 30)
• Imbalance Threshold — Minimum bull or bear share to classify a level as imbalanced (default: 65%)

Entry Signals
• Void Fill Entries — Enable/disable VOID signals
• Imbalance Flip Entries — Enable/disable FLIP signals
• Trend Filter EMA — EMA period for directional confirmation (default: 21)
• Volume Surge Multiplier — Current volume must exceed average × this value (default: 1.2)

Candle Coloring
• Fully customizable colors for each dominance level

Void Zones
• Void Zone Color and Max Visible Voids

Delta Ribbon
• Show/hide and smoothing period


█ Alerts
• Long Signal — Fires on any bullish entry (VOID or FLIP)
• Short Signal — Fires on any bearish entry (VOID or FLIP)
• Any Signal — Fires on both


-----------------
Disclaimer
The content provided in this script is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. All investments involve risk, and past performance does not guarantee future results. Users are fully responsible for any investment decisions they make.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน