Picture of the author

TradingView-RU

06/24 02:00

Order Flow Footprint [JOAT]

ORDER FLOW FOOTPRINT

A full intrabar footprint engine — POC, Value Area, per-row imbalance detection, stacked imbalance zones, delta-flip alerts, POC-shift alerts, and per-bar footprint ladder labels — built to read like a Bookmap-style auction view directly on a TradingView chart. Uses the native Footprint API when your plan provides it, with a graceful fallback to lower-timeframe tick-rule reconstruction so the script works on every account tier.



Data source — Footprint API or reconstructed

Three modes, behaviourally identical:


Footprint API — uses request.footprint() with a configurable aggregation (Auto / 1m / 3m / 5m / 15m / 30m). Native bid/ask volume per row when your plan supports it.
Reconstructed — uses request.security_lower_tf() to sample intrabar prints, then assigns each tick to buy or sell via the standard tick rule. Configurable LTF (1m / 3m / 5m / 15m / 30m).
Auto — picks Footprint when available, falls back to Reconstructed. The recommended default.


A configurable Profile Rows input (default 24, max 80) sets the vertical resolution — each chart bar's intrabar volume is bucketed into N horizontal price slices and the footprint is built from those buckets.

Imbalance detection (Bookmap diagonal)

The institutional definition of an imbalance is diagonal , not lateral :


A buy row is imbalanced when buy ≥ ratio × sell (this row's buys vs the row below it's sells).
A sell row is imbalanced when sell ≥ ratio × buy (this row's sells vs the row above it's buys).


The ratio is configurable (default 3.0× — the institutional norm). An optional minimum-row-volume filter mutes illiquid wick rows from being counted as imbalances. When N or more same-side imbalances occur inside a single bar, the Burst alert fires.

Stacked imbalance zones (the headline)

Stacked imbalances are the textbook order-flow structural read: N consecutive same-side imbalanced rows on top of each other. They mark where price had to gap through multiple thin levels to print — and they are reliable revisit zones.


Minimum stack count is configurable (default 4 consecutive rows).
Each stack zone is drawn as a box extending right by a configurable bar count.
Optional glow border on stack zones (toggleable).
Maximum active zones is capped (default 8) — older zones shift out FIFO.


POC + Value Area

Per-bar Point of Control (the row with the highest volume), Value Area High and Value Area Low (the 70%-volume centred range) are computed and toggleable. POC is rendered as a dot; VAH / VAL as lines. A configurable POC Shift Threshold (in mintick units) fires the POC Shift alert when the POC jumps more than the threshold bar-over-bar.

Delta flip detection

Per-bar delta (buy − sell) is computed continuously. The delta-flip alert fires only when delta switches sign after at least N consecutive same-sign bars (configurable, default 5). This filters out the micro-fluctuations that pure-sign-flip detectors would noise on.

Per-bar footprint ladder (optional, heavy)

When enabled, inline labels at every row of every recent bar (configurable history depth) show the buy × sell tuple per row — the full Bookmap-style read. This is visually rich but rendering-heavy; keep it off when scrolling long histories or running on low-end hardware.



Visual system


POC dot in accent yellow.
Value Area lines (VAH / VAL).
Imbalance cells highlighted in palette colour per row.
Stacked imbalance zones with optional glow.
Bar colouring by delta sign (toggleable).
Per-bar delta annotations every N bars (configurable).
Per-bar ladder labels (optional).


A locked Iridescent palette (magenta bull / cyan bear / yellow POC accent on pure black) gives the chart a cyberpunk holographic identity that reads as institutional rather than retail.

Dashboard

Monospaced table positionable to any of nine corners. Surfaces:


Source mode in use (Footprint / Reconstructed) with aggregation/LTF.
Current bar's delta value and sign.
POC price and intrabar volume share.
Imbalance count this bar (buy / sell).
Active stack zone count.
Last delta-flip direction with bar-age.


Alerts

Five alert conditions, each independently controllable:


Stacked Imbalance Zone Formed
POC Shift (POC jumped > threshold)
Delta Flip After Run (delta sign change after N+ same-sign bars)
Buy Imbalance Burst (N+ buy imbalances in one bar)
Sell Imbalance Burst (N+ sell imbalances in one bar)


How to read it

Three reads, in order of conviction:


Stacked imbalance zone — the highest-conviction read. Price had to plough through multiple thin levels to print. Future revisits are reliable reactive zones.
Delta flip after run — regime-change signal. When delta has been net-buying for many bars and finally flips net-selling, the auction direction has just rotated.
POC shift through a structural level — value migration. When the POC moves through a previous-day VAH or VAL, value has migrated and the next session's bias often follows.


Suggested settings

Defaults (1m reconstruction LTF, 24 rows, 3.0× imbalance ratio, 4-stack minimum) are tuned for 5m–15m charts on liquid markets. For 1m scalping, drop rows to 16 and stack minimum to 3. For HTF macro (1H+), raise rows to 36 and stack minimum to 5. The 3.0× imbalance ratio is the institutional Bookmap norm; tighten to 2.5× for more frequent imbalance prints.

Originality

The implementation — the Auto/Footprint/Reconstructed source router, the diagonal-Bookmap imbalance detector with row-volume filter, the consecutive-row stack zone builder with glow border, the POC-shift detector with mintick-unit threshold, the run-length-gated delta-flip alert, the per-bar ladder renderer with history depth control, and the dashboard's holographic palette — is JOAT-original. No third-party code reused. The footprint vocabulary (POC, VAH/VAL, imbalance, stacked imbalance, delta) is public-domain auction-theory language; the implementation here is purpose-built for chart-based Pine v6.

Limitations

Reconstructed footprints are an approximation — the tick rule is the accepted public-market inference for assigning intrabar trades to buy/sell but it is not a direct read of bid/ask volume. Footprint API requires a TradingView Premium or Ultimate plan and is unavailable on some instruments. The per-bar ladder labels are rendering-heavy; keep them off when historical performance matters. Stacked-imbalance zones honour the max active cap (FIFO eviction) and the extension bars cap.



-made with passion by jackofalltrades
#HTX Invites You to Share 600K USDT in Gift Packs#2026 World Cup Posting Challenge on HTX Square#1$ Margin Trade
3分享

全部评论0最新最热

avatar
最新最热