OPEN-SOURCE SCRIPT
Market Auction Order Flow

# Market Auction Order Flow (MAOF)
**Market Auction Order Flow** is an all-in-one auction-theory and order-flow toolkit built around a single analytical framework: price seeks value through auction, and order flow reveals who is winning that auction in real time.
The eight modules are not an arbitrary collection of tools. They form a three-layer pipeline:
- **Context layer** (Modules 01, 02, 03, 08) establishes where value is. VWAP provides a dynamic fair-value reference — where price *should* be given the session's traded volume. The Volume Profile provides empirical confirmation — where price *was actually accepted* by the market, as measured by volume distribution. When VWAP and the Volume Profile's Point of Control or Value Area edges coincide, that confluence identifies a level with both theoretical and empirical support. Initial Balance and HTF Candle Profiles extend this context to the daily structure and higher timeframes.
- **Pressure layer** (Modules 04, 05, 07) measures what is happening inside each bar — intrabar delta (buy volume minus sell volume), PVSRA volume classification, and per-bar delta labels reveal institutional activity, exhaustion, and divergences invisible on a plain price chart.
- **Signal layer** (Module 06) acts only when context and pressure align: the SSL Channel crossover provides a directional trigger, and the delta confirmation requirement (from Module 04) ensures that a signal fires only when order flow supports the move. Without the pressure layer feeding the signal layer, the SSL crossover is no different from any other moving-average crossover.
Each module can be toggled independently — from a minimal VWAP-only setup to the full pipeline — so traders can use only the layers relevant to their workflow.
---
## Modules
### 01 · VWAP with State Cloud
Session-anchored VWAP (or Week / Month / Quarter / Year / Earnings / Dividends / Splits anchor) with up to three standard-deviation or percentage-based band pairs. The **state cloud** classifies price as Discovery Up, Discovery Down, or Balance relative to the bands, and highlights:
- **Failed breakout markers** — wick penetrates a band but close rejects back inside (configurable minimum penetration % and cooldown bars)
- **Return-to-VWAP markers** — price crosses back through the VWAP line after a discovery move, signaling potential mean reversion
The state cloud turns VWAP from a static level into a dynamic market condition classifier, distinguishing trending (discovery) from mean-reverting (balance) environments bar by bar.
### 02 · Periodic Volume Profile
An extended version of TradingView's built-in Periodic Volume Profile, rebuilt with additional configuration options and integrated into the MAOF context layer. Resets on a configurable anchor period (Session / Day / Week / Month, or any custom timeframe). Features:
- Up/Down, Total, or Delta volume display modes
- POC, VAH, VAL level lines with optional right-extension
- **Developing POC and Developing Value Area** overlays — tracks the POC and Value Area as they build in real time within the current period (not available in the built-in)
- **Adaptive row density** ("Rows per Percent") — row count scales with profile range instead of being fixed, keeping histogram granularity consistent across different volatility periods
- **Bar-level fallback mode** — computes a per-bar approximation for 1-min charts without Premium intrabar data access
- Adjustable value area %, profile width, and placement
The profile identifies the price range where the majority of volume traded (the Value Area), distinguishing accepted price levels from those the market visited but rejected. As an integrated module, the intrabar data computed here also feeds Module 06's signal confirmation logic.
### 03 · Initial Balance
Auto-detects the correct IB session window for each instrument class (equity indices, metals, energies, grains, softs, forex) or accepts a custom window. Draws:
- IB High / Low / Mid levels
- ×2 and ×3 range extensions
- 50 % midpoint levels between extensions
- Optional IB zone tint and 20-day IB-Delta statistics table
The Initial Balance is the range established in the first hour of the regular trading session. Auction theory treats IB extensions as directional breakouts: price that moves beyond 2× or 3× the initial range signals a one-timeframing market with strong directional conviction.
### 04 · Volume Delta Engine
Intrabar delta computation engine that powers the signal system. Calculates smoothed delta EMA and detects **exhaustion flips** — moments when cumulative delta swings from an extreme (configurable threshold) to a zero-line crossover. An exhaustion flip signals that aggressive directional buyers or sellers have been absorbed, creating conditions for a reversal. This module feeds its delta state directly into Module 06.
### 05 · PVSRA (Price Volume Spread Range Analysis)
Classifies each bar by volume intensity relative to its 10-bar average:
- **Level 2 (200 %)** — climactic volume (green/red) — potential institutional activity
- **Level 1 (150 %)** — above-average volume (blue/fuchsia)
- **Normal** — standard volume
An optional spread×volume override promotes bars to Level 2 when the combined metric reaches a local extreme, identifying bars where both price spread and volume simultaneously spike — a signature of large-order absorption or distribution. Can override candle colors or use a separate symbol as the volume source.
### 06 · SSL Channel Signal Engine
Generates long/short trade signals using SSL Channel crossovers with mandatory **delta confirmation** from Module 04:
- **Pending signals** appear when the SSL Channel line crosses, opening a confirmation window
- **Confirmed signals** fire only when delta polarity aligns with the SSL direction within the expiry window
- Alternating mode (L→S→L) prevents consecutive same-direction signals
- Configurable cooldown between signals to filter noise
The confirmation requirement is the core design decision: an SSL crossover that occurs while delta is opposing the move is filtered out as a likely false breakout. Only when directional price structure (SSL) and order flow pressure (delta) agree does the signal print.
### 07 · Delta Display (Real-Time Order Flow Labels)
Per-bar labels showing:
- **DV (Delta Volume)** — buy volume minus sell volume, with optional DV%, total volume, and momentum arrows (▲▼)
- **DT (Delta Ticks)** — uptick count minus downtick count, with optional DT%, total ticks, and momentum arrows
- **POC line** — short horizontal line at the highest-volume price level within each bar
- **Divergence highlighting** — label color changes when delta polarity conflicts with bar direction (e.g., positive DV on a red bar signals hidden buying pressure despite price declining)
Delta divergences at key context levels (VWAP, Value Area edges, IB boundaries) are among the highest-probability setups in the auction-theory framework.
### 08 · HTF Candle Volume Profile
A 1-minute chart shows tick-level detail but hides what the Daily or Weekly candle looks like — you would normally have to switch timeframes to see it. Module 08 solves this by rendering up to three completed higher-timeframe candles (default: Daily / Weekly / Monthly) directly on the current chart, positioned to the right of live price as reference panels.
Each HTF candle is paired with its own Volume Profile histogram, showing where volume was distributed *within that candle's timespan* — not just the candle's open/high/low/close, but the price levels where the most buying and selling actually occurred. POC, VAH, and VAL level lines extend left across the chart to the candle's start bar, creating visible reference zones anchored to higher-timeframe market structure.
In auction theory, higher-timeframe value areas carry the most weight: a Weekly POC represents an entire week's worth of volume acceptance. When intraday price approaches a Weekly POC or Daily VAL, that level is likely to produce a reaction. Module 08 makes these levels visible on a 1-minute chart without leaving it.
---
## Key Features
- **Fully modular** — enable only what you need; disable the rest for a clean chart
- **Extensive customization** — every module has dedicated Core and Style setting groups with full color, width, and style control
- **Multi-timeframe awareness** — from intrabar delta resolution up to Monthly candle profiles
- **Auto-adaptive** — IB windows auto-detect by instrument class, delta LTF adapts to chart timeframe
- **Built-in alerts** — Long, Short, Pending Long, Pending Short alert conditions
## Recommended Timeframes
Designed primarily for **intraday futures trading** (1 min – 15 min charts), but compatible with any timeframe and instrument. Volume Profile and Delta modules benefit most from intrabar data available on lower timeframes.
---
## How to Use
1. Add the indicator to your chart
2. Open Settings and enable/disable modules to suit your workflow
3. Each module has a **Core** group (logic settings) and a **Style** group (visual settings)
4. Start with VWAP + Volume Profile + Delta Display for a solid auction-theory foundation
5. Add SSL Signal Engine when you want trade entry signals filtered by delta confirmation
6. Use Initial Balance and HTF Candle VP to anchor intraday analysis to higher-timeframe value areas
7. Set up alerts via TradingView's alert system using the built-in alert conditions
---
## Credits & Acknowledgments
### Libraries
This indicator uses the following open-source Pine Script™ libraries by **[AustrianTradingMachine](tradingview.com/u/AustrianTradingMachine/)**:
- **LibTmFr** — Timeframe utilities (period detection, auto LTF selection)
- **LibBrSt** — Bar statistics and real estimators
- **LibProf** — Profile computation engine
- **LibVPrf** — Volume Profile data structures and rendering
### Module origins
- **Module 03 — Initial Balance:** Based on [Initial Balance Wave Map](tradingview.com/v/YT6IrC8d/) by **[traderdrysdale](tradingview.com/u/traderdrysdale/)** (open-source), which itself builds on the foundation by **noop-noop**
- **Module 05 — PVSRA:** Based on the Price Volume Spread Range Analysis methodology
- **Module 06 — SSL Channel:** Based on the SSL Channel concept originally developed by ErwinBeckers
- **Module 01 — VWAP:** Extends TradingView's built-in VWAP with custom state-cloud classification, failed-breakout detection, and return-to-VWAP logic
- **Module 02 — Periodic Volume Profile:** Extends TradingView's built-in Periodic Volume Profile with Developing POC/VA overlays, adaptive row density, bar-level fallback mode, and Session anchor support
- **Module 08 — HTF Candle Volume Profile:** Based on [HTF Candle Volume Profile](tradingview.com/v/yMqxwltF/) by **ChartPrime** (open-source), modified to integrate Volume Profile histograms (POC, VAH, VAL) per HTF candle and to support up to three independent higher timeframes simultaneously
**Market Auction Order Flow** is an all-in-one auction-theory and order-flow toolkit built around a single analytical framework: price seeks value through auction, and order flow reveals who is winning that auction in real time.
The eight modules are not an arbitrary collection of tools. They form a three-layer pipeline:
- **Context layer** (Modules 01, 02, 03, 08) establishes where value is. VWAP provides a dynamic fair-value reference — where price *should* be given the session's traded volume. The Volume Profile provides empirical confirmation — where price *was actually accepted* by the market, as measured by volume distribution. When VWAP and the Volume Profile's Point of Control or Value Area edges coincide, that confluence identifies a level with both theoretical and empirical support. Initial Balance and HTF Candle Profiles extend this context to the daily structure and higher timeframes.
- **Pressure layer** (Modules 04, 05, 07) measures what is happening inside each bar — intrabar delta (buy volume minus sell volume), PVSRA volume classification, and per-bar delta labels reveal institutional activity, exhaustion, and divergences invisible on a plain price chart.
- **Signal layer** (Module 06) acts only when context and pressure align: the SSL Channel crossover provides a directional trigger, and the delta confirmation requirement (from Module 04) ensures that a signal fires only when order flow supports the move. Without the pressure layer feeding the signal layer, the SSL crossover is no different from any other moving-average crossover.
Each module can be toggled independently — from a minimal VWAP-only setup to the full pipeline — so traders can use only the layers relevant to their workflow.
---
## Modules
### 01 · VWAP with State Cloud
Session-anchored VWAP (or Week / Month / Quarter / Year / Earnings / Dividends / Splits anchor) with up to three standard-deviation or percentage-based band pairs. The **state cloud** classifies price as Discovery Up, Discovery Down, or Balance relative to the bands, and highlights:
- **Failed breakout markers** — wick penetrates a band but close rejects back inside (configurable minimum penetration % and cooldown bars)
- **Return-to-VWAP markers** — price crosses back through the VWAP line after a discovery move, signaling potential mean reversion
The state cloud turns VWAP from a static level into a dynamic market condition classifier, distinguishing trending (discovery) from mean-reverting (balance) environments bar by bar.
### 02 · Periodic Volume Profile
An extended version of TradingView's built-in Periodic Volume Profile, rebuilt with additional configuration options and integrated into the MAOF context layer. Resets on a configurable anchor period (Session / Day / Week / Month, or any custom timeframe). Features:
- Up/Down, Total, or Delta volume display modes
- POC, VAH, VAL level lines with optional right-extension
- **Developing POC and Developing Value Area** overlays — tracks the POC and Value Area as they build in real time within the current period (not available in the built-in)
- **Adaptive row density** ("Rows per Percent") — row count scales with profile range instead of being fixed, keeping histogram granularity consistent across different volatility periods
- **Bar-level fallback mode** — computes a per-bar approximation for 1-min charts without Premium intrabar data access
- Adjustable value area %, profile width, and placement
The profile identifies the price range where the majority of volume traded (the Value Area), distinguishing accepted price levels from those the market visited but rejected. As an integrated module, the intrabar data computed here also feeds Module 06's signal confirmation logic.
### 03 · Initial Balance
Auto-detects the correct IB session window for each instrument class (equity indices, metals, energies, grains, softs, forex) or accepts a custom window. Draws:
- IB High / Low / Mid levels
- ×2 and ×3 range extensions
- 50 % midpoint levels between extensions
- Optional IB zone tint and 20-day IB-Delta statistics table
The Initial Balance is the range established in the first hour of the regular trading session. Auction theory treats IB extensions as directional breakouts: price that moves beyond 2× or 3× the initial range signals a one-timeframing market with strong directional conviction.
### 04 · Volume Delta Engine
Intrabar delta computation engine that powers the signal system. Calculates smoothed delta EMA and detects **exhaustion flips** — moments when cumulative delta swings from an extreme (configurable threshold) to a zero-line crossover. An exhaustion flip signals that aggressive directional buyers or sellers have been absorbed, creating conditions for a reversal. This module feeds its delta state directly into Module 06.
### 05 · PVSRA (Price Volume Spread Range Analysis)
Classifies each bar by volume intensity relative to its 10-bar average:
- **Level 2 (200 %)** — climactic volume (green/red) — potential institutional activity
- **Level 1 (150 %)** — above-average volume (blue/fuchsia)
- **Normal** — standard volume
An optional spread×volume override promotes bars to Level 2 when the combined metric reaches a local extreme, identifying bars where both price spread and volume simultaneously spike — a signature of large-order absorption or distribution. Can override candle colors or use a separate symbol as the volume source.
### 06 · SSL Channel Signal Engine
Generates long/short trade signals using SSL Channel crossovers with mandatory **delta confirmation** from Module 04:
- **Pending signals** appear when the SSL Channel line crosses, opening a confirmation window
- **Confirmed signals** fire only when delta polarity aligns with the SSL direction within the expiry window
- Alternating mode (L→S→L) prevents consecutive same-direction signals
- Configurable cooldown between signals to filter noise
The confirmation requirement is the core design decision: an SSL crossover that occurs while delta is opposing the move is filtered out as a likely false breakout. Only when directional price structure (SSL) and order flow pressure (delta) agree does the signal print.
### 07 · Delta Display (Real-Time Order Flow Labels)
Per-bar labels showing:
- **DV (Delta Volume)** — buy volume minus sell volume, with optional DV%, total volume, and momentum arrows (▲▼)
- **DT (Delta Ticks)** — uptick count minus downtick count, with optional DT%, total ticks, and momentum arrows
- **POC line** — short horizontal line at the highest-volume price level within each bar
- **Divergence highlighting** — label color changes when delta polarity conflicts with bar direction (e.g., positive DV on a red bar signals hidden buying pressure despite price declining)
Delta divergences at key context levels (VWAP, Value Area edges, IB boundaries) are among the highest-probability setups in the auction-theory framework.
### 08 · HTF Candle Volume Profile
A 1-minute chart shows tick-level detail but hides what the Daily or Weekly candle looks like — you would normally have to switch timeframes to see it. Module 08 solves this by rendering up to three completed higher-timeframe candles (default: Daily / Weekly / Monthly) directly on the current chart, positioned to the right of live price as reference panels.
Each HTF candle is paired with its own Volume Profile histogram, showing where volume was distributed *within that candle's timespan* — not just the candle's open/high/low/close, but the price levels where the most buying and selling actually occurred. POC, VAH, and VAL level lines extend left across the chart to the candle's start bar, creating visible reference zones anchored to higher-timeframe market structure.
In auction theory, higher-timeframe value areas carry the most weight: a Weekly POC represents an entire week's worth of volume acceptance. When intraday price approaches a Weekly POC or Daily VAL, that level is likely to produce a reaction. Module 08 makes these levels visible on a 1-minute chart without leaving it.
---
## Key Features
- **Fully modular** — enable only what you need; disable the rest for a clean chart
- **Extensive customization** — every module has dedicated Core and Style setting groups with full color, width, and style control
- **Multi-timeframe awareness** — from intrabar delta resolution up to Monthly candle profiles
- **Auto-adaptive** — IB windows auto-detect by instrument class, delta LTF adapts to chart timeframe
- **Built-in alerts** — Long, Short, Pending Long, Pending Short alert conditions
## Recommended Timeframes
Designed primarily for **intraday futures trading** (1 min – 15 min charts), but compatible with any timeframe and instrument. Volume Profile and Delta modules benefit most from intrabar data available on lower timeframes.
---
## How to Use
1. Add the indicator to your chart
2. Open Settings and enable/disable modules to suit your workflow
3. Each module has a **Core** group (logic settings) and a **Style** group (visual settings)
4. Start with VWAP + Volume Profile + Delta Display for a solid auction-theory foundation
5. Add SSL Signal Engine when you want trade entry signals filtered by delta confirmation
6. Use Initial Balance and HTF Candle VP to anchor intraday analysis to higher-timeframe value areas
7. Set up alerts via TradingView's alert system using the built-in alert conditions
---
## Credits & Acknowledgments
### Libraries
This indicator uses the following open-source Pine Script™ libraries by **[AustrianTradingMachine](tradingview.com/u/AustrianTradingMachine/)**:
- **LibTmFr** — Timeframe utilities (period detection, auto LTF selection)
- **LibBrSt** — Bar statistics and real estimators
- **LibProf** — Profile computation engine
- **LibVPrf** — Volume Profile data structures and rendering
### Module origins
- **Module 03 — Initial Balance:** Based on [Initial Balance Wave Map](tradingview.com/v/YT6IrC8d/) by **[traderdrysdale](tradingview.com/u/traderdrysdale/)** (open-source), which itself builds on the foundation by **noop-noop**
- **Module 05 — PVSRA:** Based on the Price Volume Spread Range Analysis methodology
- **Module 06 — SSL Channel:** Based on the SSL Channel concept originally developed by ErwinBeckers
- **Module 01 — VWAP:** Extends TradingView's built-in VWAP with custom state-cloud classification, failed-breakout detection, and return-to-VWAP logic
- **Module 02 — Periodic Volume Profile:** Extends TradingView's built-in Periodic Volume Profile with Developing POC/VA overlays, adaptive row density, bar-level fallback mode, and Session anchor support
- **Module 08 — HTF Candle Volume Profile:** Based on [HTF Candle Volume Profile](tradingview.com/v/yMqxwltF/) by **ChartPrime** (open-source), modified to integrate Volume Profile histograms (POC, VAH, VAL) per HTF candle and to support up to three independent higher timeframes simultaneously
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.