OPEN-SOURCE SCRIPT
Cập nhật Volatility, Flow & Liquidity Engine

Volatility, Flow & Liquidity Engine (VFL)
Why these parts are ONE tool, not a mashup of separate indicators
The three layers aren't independent studies stacked for show — they are sequential stages of a single trade decision (is a move coming, which way, and can I execute it) and they share one computational core. The same path-dependent volatility forecast is computed once and used by all three: it anchors Layer 1's expected move and implied-vs-realized dislocation, and it de-biases Layer 3's high-low spread estimators and prices its slippage and sizing. A signal is only actionable when Layer 1 says "loaded," Layer 2's order flow confirms the side, and Layer 3 says the spread and impact let you execute at size. Remove any layer and the decision is incomplete — timing without direction is a coin flip; direction without an execution read ignores slippage that can exceed the edge. That dependency, and the shared vol core, is why this lives in one script rather than three.
The three layers
Pressure & regime — when a move is coming. Compression, implied-vs-expected-vol dislocation, basis tension, convexity and trend inefficiency combine into a "pressure" reading. A high-percentile load plus a real range release fires a signal, typed GAMMA BLAST / SQUEEZE / EXPANSION, alongside a variance-ratio regime read and a path-dependent realized-vol forecast with a rolling fit/trust gauge.
Order flow — which way. Reconstructed intrabar buy/sell pressure (bulk-volume by default, with candle-geometry and intrabar tick-rule options) standardized to a z-score plus session CVD. Used only to confirm or veto a release's direction — the one orthogonal read price geometry alone can't give.
Liquidity & execution — can I trade it, and at what cost. Low-frequency effective-spread estimators (EDGE primary, with high-low covariance and high-low range cross-checks), an illiquidity ratio and impact-slope, and a volume-at-price liquidity map (POC, value area, walls, voids, anchored VWAP with σ bands, nearest dense liquidity). These become a liquidity score, slippage estimate, and order-type and size guidance. A structure sub-layer (prior-day value area + untested "naked" POCs) builds a per-bar support/resistance ladder that location-gates the final signal: a long is withheld if it would fire into a resistance shelf, a short if into support.
How to use it
Wait for the consolidated decision table to line up — pressure loaded, order flow confirming the side, liquidity executable, and the trade well-located against the S/R ladder. Read the size and order-type guidance before entering, and treat STRESSED liquidity or Extreme vol as stand-aside flags. The on-chart glow lines map the structure (prior-day value, naked-POC magnets, liquidity support/resistance, nearest shelves, fair-value VWAP); the legend-key panel decodes every line and marker.
Universal — works on any asset, any market
Price source, volume source (with a borrow-volume option for cash indices/FX), companion symbol and volatility index are all configurable inputs. Defaults are tuned for NSE NIFTY index futures (intraday, weekly Tuesday expiry, 09:15–15:30) — change the companion/vol-index symbols, expiry day and session for other instruments. The volatility index and companion symbol are optional; without them the engine runs price-only and re-weights automatically.
Non-repaint
Higher-timeframe confluence reads the last closed HTF bar by default, and every higher-timeframe request uses no-lookahead — confirmed signals don't move after the bar closes. The current bar forms live and settles on close, like any indicator.
Honesty / limitations
Every block is a low-frequency estimator of a quantity normally measured from quote/tick/book data — it approximates, it does not measure. Order flow is reconstructed (≈tick-rule accuracy), not true bid/ask; dealer-flow effects are inferred from price/vol/basis, not read from an option chain. Volume modules need a real volume feed and auto-disable without one. Follow-through statistics are computed on loaded chart history (in-sample), not a forward backtest.
This is a study/education tool, not financial advice. Estimates only; past behaviour does not guarantee future results.
Why these parts are ONE tool, not a mashup of separate indicators
The three layers aren't independent studies stacked for show — they are sequential stages of a single trade decision (is a move coming, which way, and can I execute it) and they share one computational core. The same path-dependent volatility forecast is computed once and used by all three: it anchors Layer 1's expected move and implied-vs-realized dislocation, and it de-biases Layer 3's high-low spread estimators and prices its slippage and sizing. A signal is only actionable when Layer 1 says "loaded," Layer 2's order flow confirms the side, and Layer 3 says the spread and impact let you execute at size. Remove any layer and the decision is incomplete — timing without direction is a coin flip; direction without an execution read ignores slippage that can exceed the edge. That dependency, and the shared vol core, is why this lives in one script rather than three.
The three layers
Pressure & regime — when a move is coming. Compression, implied-vs-expected-vol dislocation, basis tension, convexity and trend inefficiency combine into a "pressure" reading. A high-percentile load plus a real range release fires a signal, typed GAMMA BLAST / SQUEEZE / EXPANSION, alongside a variance-ratio regime read and a path-dependent realized-vol forecast with a rolling fit/trust gauge.
Order flow — which way. Reconstructed intrabar buy/sell pressure (bulk-volume by default, with candle-geometry and intrabar tick-rule options) standardized to a z-score plus session CVD. Used only to confirm or veto a release's direction — the one orthogonal read price geometry alone can't give.
Liquidity & execution — can I trade it, and at what cost. Low-frequency effective-spread estimators (EDGE primary, with high-low covariance and high-low range cross-checks), an illiquidity ratio and impact-slope, and a volume-at-price liquidity map (POC, value area, walls, voids, anchored VWAP with σ bands, nearest dense liquidity). These become a liquidity score, slippage estimate, and order-type and size guidance. A structure sub-layer (prior-day value area + untested "naked" POCs) builds a per-bar support/resistance ladder that location-gates the final signal: a long is withheld if it would fire into a resistance shelf, a short if into support.
How to use it
Wait for the consolidated decision table to line up — pressure loaded, order flow confirming the side, liquidity executable, and the trade well-located against the S/R ladder. Read the size and order-type guidance before entering, and treat STRESSED liquidity or Extreme vol as stand-aside flags. The on-chart glow lines map the structure (prior-day value, naked-POC magnets, liquidity support/resistance, nearest shelves, fair-value VWAP); the legend-key panel decodes every line and marker.
Universal — works on any asset, any market
Price source, volume source (with a borrow-volume option for cash indices/FX), companion symbol and volatility index are all configurable inputs. Defaults are tuned for NSE NIFTY index futures (intraday, weekly Tuesday expiry, 09:15–15:30) — change the companion/vol-index symbols, expiry day and session for other instruments. The volatility index and companion symbol are optional; without them the engine runs price-only and re-weights automatically.
Non-repaint
Higher-timeframe confluence reads the last closed HTF bar by default, and every higher-timeframe request uses no-lookahead — confirmed signals don't move after the bar closes. The current bar forms live and settles on close, like any indicator.
Honesty / limitations
Every block is a low-frequency estimator of a quantity normally measured from quote/tick/book data — it approximates, it does not measure. Order flow is reconstructed (≈tick-rule accuracy), not true bid/ask; dealer-flow effects are inferred from price/vol/basis, not read from an option chain. Volume modules need a real volume feed and auto-disable without one. Follow-through statistics are computed on loaded chart history (in-sample), not a forward backtest.
This is a study/education tool, not financial advice. Estimates only; past behaviour does not guarantee future results.
Phát hành các Ghi chú
VFL Engine — Update: faster load, cleaner chart, sharper regime⚡ Faster loading: HTF confluence now defaults OFF (it added 3 higher-timeframe requests — the biggest load cost); added an internal bar cap; removed redundant calculations. Re-enable confluence anytime.
🎯 New "Visual density" toggle (Compact/Full), default Compact: keeps the essentials — panel, signals, candle colour, liquidity map, VWAP, nearest-liquidity — and hides the decorative layers for a cleaner chart. Switch to Full for everything.
📊 Sharper regime: the variance-ratio regime now requires statistical significance (Lo-MacKinlay z-test) before calling AMPLIFY/PIN, sitting on NEUTRAL when it's just noise — fewer false flips.
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.
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.
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.