Premium and Discount Pivot Matrix [BigBeluga]Premium and Discount Pivot Matrix is an advanced market-structure terminal engineered for PulseWire. It maps macroeconomic structural equilibrium by tracking historical price extremes and calculating accurate institutional auction zones.
Instead of printing static linear channels, this framework uses an active multi-pivot state matrix to calculate premium ceiling and discount floor boundaries. It pairs these levels with a real-time 100-Bin Volume Profile Matrix plotted directly at the leading edge of the chart, providing immediate clarity on volume distribution relative to the market's fair-value equilibrium.
NSE:NIFTY
BINANCE:BTCUSDT
🔵 CHANNEL CALCULATION METHODOLOGY
The central core of the indicator relies on a multi-layered geometric calculation engine to establish its tracking bands. The engine follows a distinct three-step sequence to construct the structural matrix:
1. Multi-Pivot Array Extraction Engine
Asymmetric Window Scanning Nodes: The engine scans the chart for structural price peaks and troughs using an adjustable lookback window ( Pivot Left/Right Bars ). For a pivot to be verified, it must be the absolute highest or lowest value within that specified bar radius.
FIFO Array Storage Matrix: When a high pivot is logged, it is pushed into the highPivots array; low pivots are funneled into the lowPivots array. The script features memory guardrails ( Max Pivots to Track ) that automatically shift old elements out of memory, limiting array depth to prevent memory allocation drag.
// Manage Arrays via FIFO (First-In, First-Out) Storage Architecture
if not na(pHi)
array.push(highPivots, pHi)
if array.size(highPivots) > arraySize
array.shift(highPivots)
if not na(pLo)
array.push(lowPivots, pLo)
if array.size(lowPivots) > arraySize
array.shift(lowPivots)
2. Mathematical Boundary Selection
Premium Ceiling Isolation Grid: The terminal continuously runs an evaluation sweep across the active high memory array and extracts the absolute highest peak value using an optimized maximum tracking filter node. This serves as the outer resistance band.
Discount Floor Isolation Grid: Concurrently, the engine sweeps the active low memory array to extract the absolute lowest trough value, setting the hard outer support band floor.
Step-Line Price Plotting Framework: Because it selects the maximum high and minimum low of a rolling historical lookback set, the boundaries plot on your canvas as clean, structural step-lines. These lines only shift when a new macro extreme is logged or when an older extreme drops out of the tracking array.
3. Dynamic Equilibrium Tracking State Machine
Fair Value Midline Matrix: The Equilibrium Midline represents the exact mathematical center of the active trading channel. It calculates the mid-point price by taking the average of the resistance ceiling and support floor arrays.
Structural Shifting Trend Cloud Filters: This midline acts as a real-time tracker for the value center of the asset. The internal state machine monitors this line on every tick and applies dynamic visual treatments: it flashes the Midline Rising Color when the value structure is shifting upward, and instantly mutates to the Midline Falling Color when structural value drops downward.
// Extract Channel Levels
float resistance = na
float support = na
if array.size(highPivots) > 0
resistance := array.max(highPivots)
if array.size(lowPivots) > 0
support := array.min(lowPivots)
// Calculate Midline
float midline = not na(resistance) and not na(support) ? (resistance + support) / 2 : na
🔵 CORE STRUCTURAL LAYOUT FEATURES
1. 100-Bin Volume Profile Distribution Matrix
Intra-Channel Grid Binning Engine: When enabled ( Show Volume Profile at Channel End? ), the indicator runs a localized calculation over a specified historical range ( Volume Profile Lookback ). It divides the vertical space between the resistance ceiling and support floor into 100 equal vertical bins .
Adaptive Transparency Histogram Blocks: It calculates the exact volume distribution for each candle across these bins, scaling the horizontal width of the resulting histogram bars ( Volume Profile Max Width ). Premium distribution bars (above the midline) use an automatic gradient that gets brighter near the resistance ceiling to flag overextended premium supply. Discount distribution bars (below the midline) flash brighter near the support floor to highlight historical institutional accumulation blocks.
2. Volumetric Breakdown & Reversal Markers
Boundary Breach Telemetry Glyphs: The terminal closely monitors interactions with the channel boundaries. If a candle breaks completely out of the rolling step-line range, it triggers high-visibility telemetry circle shapes directly on the chart canvas (Bullish Reversal on downward breaks, Bearish Reversal on upward crosses).
Time-Index Signal Buffer Guards: To prevent messy clutter, the script suppresses repetitive signals using a strict index tracking buffer rule. When a valid breach is confirmed, it stamps the signal with clean text labels tracking the exact transaction volume traded during the breakout bar.
// 100 Bin Volume Profile Matrix Execution snippet
int binsCount = 100
float channelRange = resistance - support
float binStep = channelRange / binsCount
array binVolumes = array.new_float(binsCount, 0.0)
array binHighs = array.new_float(binsCount, 0.0)
array binLows = array.new_float(binsCount, 0.0)
for i = 0 to binsCount - 1 by 1
array.set(binLows, i, support + i * binStep)
array.set(binHighs, i, support + (i + 1) * binStep)
🔵 SYSTEMATIC EXECUTION STRATEGIES & RISK INTERPRETATION
Premium Zone Reversals: When an asset rallies into the upper channel gradient, enters the PREMIUM zone, and tests the resistance ceiling, monitor the 100-Bin Volume Profile. If the profile shows fading volume bars at the highs, look for short setups targeting a mean-reversion move back down to the Equilibrium Midline.
Discount Value Accumulation Trim: When price action drops into the DISCOUNT zone and approaches the channel floor, check the volume profile. Heavy volume concentration at these lows confirms strong institutional interest. Look for long positions here, using the step-line support floor as a strict trade invalidation level.
Equilibrium Breakout Continuations: Watch the behavior of the asset when the Equilibrium Midline shifts color. A sharp upward shift in the midline accompanied by a validated volume expansion signature suggests a structural trend shift, opening up long continuation options up to the premium line.
🔵 INTERFACE CONFIGURATION AND PARAMETERS
Pivot Structure Configuration Blocks: Adjust left/right bar strengths and internal array memory slots to optimize the indicator for short-term swing scalping or long-term macro trend tracking.
Volume Profile Matrix Settings: Fine-tune lookback depths and maximum bar widths to scale the volume profile layout for any financial asset class or chart timeframe.
Styling & Visual Aesthetics Overrides: Fully customize colors for rising structures, falling boundaries, interior gradient fills, and background profiles to integrate seamlessly with your preferred light or dark charting interface.
Transform your charting layout from traditional linear indicators into a highly automated, volume-anchored volatility tracking network with the Premium and Discount Pivot Matrix terminal. Indicator

Premium/Discount ML Zones [PickMyTrade]What does it do?
Builds a Premium / Equilibrium / Discount map from a higher-timeframe dealing range, then runs an online logistic regression over every price level inside that map to detect the exact band where the model currently reads a directional edge. Because the range is read from one anchor timeframe, the zones sit at the same prices whether you view the 5m, 1h or Daily chart.
────────────────────────────────────
The intellectual problem
Premium/Discount is a location framework: above the 50% equilibrium of a dealing range price is expensive, below it price is cheap. Two problems show up the moment you try to automate it.
First — the range is usually drawn on whatever chart you are looking at. A 5-minute chart finds 5-minute swings, so it anchors to a micro-range that may be a few points wide. The Daily chart finds a range a hundred times larger. The same price is then simultaneously "premium" on one timeframe and "discount" on another, and the label stops meaning anything. The conventional discipline is to define the range on a higher timeframe and drop down only to execute — never to redraw the range on the execution chart.
Second — location alone is not an edge. Knowing price is in the lower half of a range tells you it is cheap relative to that range. It does not tell you whether cheapness is currently being rewarded. In a strong downtrend every discount print keeps getting cheaper. Location is a filter; something else has to decide whether the location is worth acting on.
This indicator separates those two jobs. The dealing range and its three zones are the map , anchored once on a higher timeframe. A logistic regression trained on the chart's own history is the decision , and it is what marks the actionable band inside the map.
────────────────────────────────────
How the dealing range is anchored
The range is built from confirmed swing highs and lows read from the Dealing Range Timeframe (default Daily) via request.security(..., lookahead=barmerge.lookahead_off) . Each side re-anchors to its most recent confirmed swing, with guards that keep the pair coherent:
if not na(ph) and (na(swingLow) or ph > swingLow) swingHigh := ph if not na(pl) and (na(swingHigh) or pl < swingHigh) swingLow := pl
Those guards are what make the range track the current leg rather than a fixed lookback window. In an uptrend each new higher low pulls the low side up with price, instead of leaving equilibrium pinned to an ancient low that price has long since left behind.
From that range:
Equilibrium — the exact 50% midpoint, (rangeHigh + rangeLow) / 2 Equilibrium band — a neutral fair-value zone of ± Equilibrium Band × range around the midpoint (default ±10%, i.e. the middle 20%). No signals fire inside it. Premium — everything above the band. Discount — everything below it.
Break of structure — when price closes beyond the anchored range, the old range is stale until a new swing confirms. A bearish BOS blocks longs and a bullish BOS blocks shorts, so the model does not fade a breakout while waiting for the range to re-anchor.
────────────────────────────────────
How the logistic regression works
Step 1 — Three z-score normalised features
All three are standardised over the Z-Score Window (default 50) so the model is scale-invariant across instruments and timeframes.
F1 — Position in range : where the close sits between the range low and high, clamped to 0–1. This is the premium/discount coordinate itself. F2 — Dwell time : a rolling time-at-price measure — the fraction of the last N bars that closed within one price band of the current close. High dwell means price has spent real time here; a level touched once in a spike scores low. F3 — Momentum : rate of change over the momentum length, normalised. Distinguishes a discount that is stabilising from one that is still falling.
Step 2 — Online gradient descent with L2 regularization
There is no fixed training window and no retraining pass. Each confirmed bar is labelled from its forward return over the Label Horizon, and the weights take one gradient step per bar, always evaluated on the previous bar's features so no current-bar information leaks into the update:
_pred = f_sigmoid(w0 + w1f1 + w2f2 + w3*f3 ) _label = label_bull ? 1.0 : 0.0 _err = _label - _pred w1 := w1 + i_learn_rate * (_err * f1 - i_l2_lambda * w1)
The - i_l2_lambda * w1 term is weight decay: it pulls weights back toward zero each step, which stops any single feature from running away to an extreme value on a stretch of trending data. The bias term w0 is deliberately left unregularized — it carries the base rate, not a feature relationship.
Step 3 — Posterior
post_bull = f_sigmoid(w0 + w1f1 + w2f2 + w3*f3) post_bear = 1.0 - post_bull
Step 4 — The ML entry zone (what the model detects)
This is the part that does the work. Rather than only scoring the bar in front of it, the model scores every price level inside the discount half and the premium half — sweeping the position feature across the zone while holding dwell and momentum at their current values — and marks the contiguous band where its probability clears the Entry Threshold:
for j = 0 to i_nbins float p = rangeLow + (eq_bot - rangeLow) * j / i_nbins float f1p = ((p - rangeLow) / range_size - pos_mean) / pos_std float pbup = f_sigmoid(base + w1 * f1p) if pbup >= i_posterior_thresh ml_long_lo := na(ml_long_lo) ? p : math.min(ml_long_lo, p) ml_long_hi := na(ml_long_hi) ? p : math.max(ml_long_hi, p)
That band is the ML Buy / Sell Zone drawn on the chart. It is the exact price range in which a signal would fire right now — visible before price arrives there. Its thickness is meaningful: a thin band means only a sliver of the zone clears the threshold, a thick band means the model reads an edge across most of the zone. When nothing clears the threshold, the band disappears entirely rather than showing a level the model does not support.
────────────────────────────────────
Reading the indicator
PREMIUM box (orange) — upper region of the HTF range. Shorts are considered here only. EQUILIBRIUM box (grey) — the fair-value band around the 50% midpoint. Nothing fires here by design. DISCOUNT box (blue) — lower region. Longs are considered here only. ML BUY / SELL ZONE (bright band) — the model-detected band inside the discount/premium region, labelled with the peak probability found in that band. ● circle (blue) — high-conviction long: P(Bull) ≥ 0.85. ▲ triangle (blue) — standard long: P(Bull) ≥ threshold. ● circle (orange) — high-conviction short: P(Bear) ≥ 0.85. ▼ triangle (orange) — standard short: P(Bear) ≥ threshold. Dashed equilibrium line — the exact 50% midpoint. Dashed SL / TP lines — reference levels from the range extreme at ATR × multiplier and the Risk:Reward ratio.
Only the first bar of each signal cluster fires — if conditions stay true for several bars, only the transition bar is marked.
Info table (top-right)
● LIVE (green) — the model has taken ≥ Training Samples Needed gradient steps. ● WARMUP (yellow) — still accumulating; signals suppressed. Zone — Premium / Equilibrium / Discount, or BOS ↑ / BOS ↓ (yellow) when price has broken the range. P(Bull) / P(Bear) — live posterior at the current bar. N Trained — total gradient updates taken.
────────────────────────────────────
Inputs
Dealing Range Dealing Range Timeframe — whose swings define the map (default D). Set it equal to or higher than your execution chart. This is the input that makes the zones identical across timeframes. Swing Left / Right Bars — swing definition on the anchor timeframe (default 3/3). Right Bars is the confirmation delay: the range re-anchors that many anchor-timeframe bars after a swing forms. Equilibrium Band — half-width of the neutral zone as a fraction of range (default 0.10). Set 0 to collapse it to a single line.
Dwell-Time Feature Scan / Dwell Bands (default 20) — price resolution for the entry-zone scan and the dwell band width. Dwell Lookback (default 50).
Logistic Regression Training Samples Needed — gradient updates before signals activate (default 80). Entry Threshold — minimum probability to fire a signal and to light the ML zone (default 0.65). Learning Rate — gradient step size (default 0.05). Higher adapts faster but noisier. L2 Regularization — weight decay (default 0.001). 0 disables it. Label Horizon (default 5), Momentum Length (default 14), Z-Score Window (default 50).
Signal Levels Show SL/TP Lines, ATR Period, SL ATR Buffer (default 1.2), Risk:Reward (default 1.8).
Visual / Display Show Premium/Discount Map, Show ML Entry Zone, Zone Left Extent / Forward Extend, Show Equilibrium Line, Regime Background, zone colours. Zen Mode — hides SL/TP lines and the table; map and ML zone remain.
────────────────────────────────────
Three alerts included
PD ML - Long — discount long fired PD ML - Short — premium short fired PD ML - Any Signal — either direction
────────────────────────────────────
Technical notes
Swing detection on the anchor timeframe needs Swing Right Bars of that timeframe to confirm. With the Daily default that is a three-day confirmation delay before the range re-anchors. This is inherent to non-repainting swing detection, not a tunable away. request.security uses lookahead_off , so historical bars use only confirmed anchor-timeframe values. The developing anchor bar updates in real time, which is expected behaviour for a live higher-timeframe reference. The dwell feature counts closes within one band of the current close over the lookback — a bar-based proxy for time-at-price. It does not use tick or volume-profile data. The entry-zone scan holds dwell and momentum fixed while sweeping position. It answers "if price were at level X, with today's momentum and dwell, what would the model read?" — a counterfactual across location, not a forecast of the path. Logistic regression assumes a monotonic relationship between each feature and the log-odds. Real price behaviour is not always monotonic in position-within-range; the model captures the dominant direction of that relationship, not its curvature.
────────────────────────────────────
Requirements and limitations
The model needs Training Samples Needed gradient steps before signals activate; on short-history charts the table shows WARMUP and nothing fires. Weights are learned per chart and per timeframe — switching symbol or timeframe restarts the learning from zero.
Probabilities are the model's read of patterns in its own training history. They are not a probability of profit, and patterns that historically preceded a directional move may not repeat.
The equilibrium band is deliberately dead space. If you want signals nearer the midpoint, reduce the band toward 0 — but the closer to fair value you trade, the less the premium/discount premise is contributing.
If the Dealing Range Timeframe is left blank or set below your chart's timeframe, the range is computed on the chart timeframe and the cross-timeframe consistency is lost. That is the failure mode this indicator exists to avoid.
The three zones describe location within one dealing range. They carry no information about ranges above them — a Daily discount can sit inside a Weekly premium.
────────────────────────────────────
Risk disclosure
Nothing here forecasts price. The zones describe where price sits inside a measured range; the classifier reports what its training history associates with that location. Use with your own position sizing and risk management. Not financial advice.
Built natively in Pine Script® v6. Online logistic regression trained by per-bar gradient descent with L2 weight decay, a rolling dwell-time feature, and a higher-timeframe swing-anchored dealing range. No external libraries, no data feeds.
Open source — Mozilla Public License 2.0. Indicator

Institutional Flow MatrixInstitutional Flow Matrix is an open-source market-analysis framework designed to organize trend direction, confirmed market structure, institutional price zones, momentum, and location within a dealing range into one readable chart.
The purpose of this indicator is not to predict every price movement or generate constant entries. It is designed to answer a more practical sequence of questions:
1. What is the current directional bias?
2. Is market structure supporting that direction?
3. Is price trading from a meaningful location?
4. Has price returned to an active institutional zone?
5. Is momentum aligned with the proposed setup?
The script combines these questions into a structured workflow while keeping the default chart intentionally clean.
WHY THIS INDICATOR WAS BUILT
Many market-structure indicators display every swing, imbalance, liquidity level, zone, and signal at the same time. While that information can be useful for detailed analysis, it can also make the chart difficult to interpret during live trading.
Institutional Flow Matrix was built around a visual hierarchy:
* Directional bias is the primary layer.
* Active Order Blocks are the principal reaction zones.
* Momentum is a confirmation layer.
* Premium and Discount provide market location.
* Fair Value Gaps, liquidity pools, sweeps, and higher-timeframe levels are optional study tools.
The default Balanced preset focuses on the information most relevant to a directional pullback setup. Minimal mode removes most supporting visuals for live execution. Full mode reveals the additional market-structure tools for deeper analysis.
WHAT MAKES THE IMPLEMENTATION DIFFERENT
The individual concepts used by this script, including pivots, moving averages, ATR trend filters, Order Blocks, Fair Value Gaps, and Premium/Discount ranges, are established forms of technical analysis.
The original contribution of Institutional Flow Matrix is how those components are synchronized and managed as one decision framework.
Key design elements include:
* Confirmed structure events rather than unconfirmed swing guesses.
* A persistent directional state requiring agreement between structure, EMA alignment, and an ATR-based trend filter.
* Order Block freshness validation before a zone is accepted.
* Separate visual duration and analytical lifetime controls for zones.
* Automatic mitigation and expiration of old zones.
* Limited drawing-object counts to prevent long-term chart clutter.
* A weighted confluence model centered on trend, structure, zone interaction, market location, and momentum.
* Three visual presets that change the information hierarchy without changing the underlying calculations.
* Confirmed-bar signals and event-based alerts.
This is not intended to be a collection of unrelated indicators. Each module has a defined role in the same setup process.
DIRECTIONAL BIAS
The chart background represents the script's confirmed directional state.
A bullish state requires agreement between:
* Bullish market structure.
* Fast EMA positioning above the slow EMA.
* Bullish ATR trend conditions.
A bearish state uses the opposite conditions.
The background changes only after the required conditions are confirmed. A larger BUY or SELL label marks a confirmed change in this directional state.
These shift labels are different from the smaller confluence signals. A shift label identifies a change in directional bias. A confluence signal requires additional location, zone, and momentum conditions.
MARKET STRUCTURE
Confirmed pivot highs and lows form the structure engine.
The script tracks:
* Higher Highs
* Higher Lows
* Lower Highs
* Lower Lows
* Breaks of Structure
* Changes of Character
A bullish break occurs when a confirmed bar closes above the latest unbroken confirmed swing high. A bearish break occurs when a confirmed bar closes below the latest unbroken confirmed swing low.
Swing labels are retrospective by design. A pivot can only be confirmed after the selected number of right-side bars has closed. Once confirmed, its label is placed on the candle where the swing originally occurred. The label was not known on that earlier candle.
ORDER BLOCKS
Order Blocks are the primary reaction zones in the indicator.
After a confirmed structure break or qualifying displacement event, the script searches backward for an opposing candle. A candidate candle can be filtered by:
* Candle range relative to ATR.
* Body size as a percentage of candle range.
* Optional volume expansion.
* Wick-based or body-based zone construction.
Before accepting the candidate, the script checks whether price has already invalidated it. This prevents many stale zones from being created after the fact.
Active Order Blocks can be invalidated by either:
* A close beyond the opposite edge.
* A wick beyond the opposite edge.
The selected mitigation method is used consistently during both zone creation and live zone management.
Order Blocks have separate controls for visual extension and analytical age. This allows users to control how long a box remains visible independently from how long it remains eligible for signal calculations.
PREMIUM, DISCOUNT, AND EQUILIBRIUM
The script creates a rolling dealing range from the highest high and lowest low over the selected lookback.
The range is divided into:
* Premium: the upper portion of the range.
* Discount: the lower portion of the range.
* Equilibrium: the 50% midpoint.
Premium and Discount do not generate trades by themselves. They provide location.
In general:
* Bullish setups receive stronger contextual support in Discount.
* Bearish setups receive stronger contextual support in Premium.
* Equilibrium represents the midpoint of the current rolling range.
Because the range is rolling, its boundaries can change when a new lookback high or low is formed.
MOMENTUM RIBBON
The momentum module uses three exponential moving averages and an ATR-normalized difference between the fast and slow averages.
Bullish momentum requires:
* Fast EMA above the slow EMA.
* Positive normalized momentum.
* Momentum above its signal average.
Bearish momentum uses the opposite conditions.
Diamond markers identify confirmed momentum crossings. The ribbon is intended as confirmation rather than a standalone entry system.
CONFLUENCE SIGNALS
The script calculates a 0-100 Confluence Score from five conditions:
* Directional bias: 25 points.
* Market structure: 15 points.
* Momentum alignment: 15 points.
* Active Order Block interaction: 25 points.
* Premium or Discount location: 20 points.
The score measures condition alignment. It is not a probability, win rate, accuracy estimate, or forecast of future performance.
By default, BUY and SELL signals require:
* Confirmed directional bias.
* Matching confirmed structure.
* Interaction with an active Order Block.
* Correct Premium or Discount location.
* Matching momentum.
* Minimum Confluence Score.
* Completion of the selected signal cooldown.
Signals are displayed only when the complete condition changes from false to true. This prevents repeated labels while the same setup remains active.
OPTIONAL ADVANCED MODULES
Full mode provides additional analytical tools:
* Fair Value Gaps with ATR size filtering.
* Equal-high and equal-low liquidity pools.
* Confirmed liquidity sweeps.
* BOS and CHoCH labels.
* HH, HL, LH, and LL labels.
* Previous day, week, and month highs and lows.
* Optional momentum candle coloring.
These features are disabled or hidden from the default Balanced view to preserve readability.
VISUAL PRESETS
Minimal:
Designed for traders who want the least chart interference. It suppresses the background, ribbon, Premium/Discount display, trailing line, dashboard, and advanced structure annotations.
Balanced:
The default view. It emphasizes directional background, active Order Blocks, Premium/Discount context, momentum ribbon, diamonds, signals, and the dashboard.
Full:
Designed for detailed study. It adds structure labels, BOS/CHoCH events, Fair Value Gaps, liquidity tools, higher-timeframe levels, and optional candle coloring.
FOR NEWER TRADERS
A simple workflow is:
1. Start with the Balanced preset.
2. Use the background to identify the current directional bias.
3. Wait for price to return to an Order Block matching that bias.
4. Check whether price is in Discount for a bullish setup or Premium for a bearish setup.
5. Confirm that the momentum ribbon agrees.
6. Treat the signal as a point for further analysis, not an automatic order.
The equilibrium line can be used as a reference for the midpoint of the current dealing range. It is not automatically an entry or exit instruction.
FOR ADVANCED TRADERS
Experienced users can customize:
* Pivot confirmation sensitivity.
* ATR and EMA trend parameters.
* Wick-based versus body-based Order Blocks.
* Displacement-created zones.
* Candle body, range, and volume filters.
* Close-based versus wick-based mitigation.
* Zone visual duration and analytical age.
* Premium and Discount percentages.
* Fair Value Gap size.
* Liquidity sensitivity.
* Momentum lengths.
* Individual signal requirements.
* Minimum confluence threshold.
* Signal cooldown.
* Higher-timeframe reference levels.
Advanced users can also disable individual hard requirements and use the Confluence Score as a more flexible filtering system.
ALERTS
Alert conditions are included for:
* Break of Structure.
* Change of Character.
* New Order Block.
* BUY signal.
* SELL signal.
* Bias-aligned Order Block entry.
* Trend and momentum confluence.
* Liquidity sweep.
Alerts should be created using Once Per Bar Close when confirmed signals are required.
NON-REPAINTING AND TIMING
Structure breaks, directional shifts, zone creation, zone mitigation, momentum events, and confluence signals are evaluated on confirmed bars.
Pivot-based swing labels require future bars to confirm that a swing occurred. After confirmation, the label is displayed on the original pivot candle. This is delayed confirmation with retrospective placement, not advance knowledge of the swing.
Previous-period levels use completed higher-timeframe data.
LIMITATIONS
* This indicator does not predict future prices.
* It does not calculate position size, stop loss, or account risk.
* It is not a complete automated trading system.
* Signals can fail during volatile, illiquid, or range-bound conditions.
* Rolling Premium, Discount, and equilibrium levels can move when the lookback range changes.
* Confirmed pivots introduce an intentional delay.
* Order Block definitions vary among trading methodologies; this script uses the documented candle-search and filtering rules described above.
* Volume behavior differs across asset classes and data providers.
* Parameter settings that work on one symbol or timeframe may not be appropriate for another.
Suggested starting points are the 15-minute and 1-hour charts for intraday analysis and the 4-hour chart for broader swing structure. Users should test settings on their own symbols and trading sessions.
OPEN-SOURCE PURPOSE
The script is published open-source so traders can inspect the calculations, understand why signals occur, verify the confirmed-bar methodology, and adapt the framework for their own research.
The goal is to provide a readable and transparent market-structure workflow rather than a black-box prediction tool.
DISCLAIMER
This indicator is provided for educational and analytical purposes only. It is not financial advice and does not guarantee profitable results. Historical chart behavior does not ensure future performance. Users are responsible for their own analysis, testing, risk management, and trading decisions.
Indicator

Dealing Range by EonMetricsDealing Range by EonMetrics
WHAT IT DOES
This indicator draws one box around the exact price range you're currently trading inside — from the most recent significant low up to the most recent significant high (or vice versa). It then splits that box into two halves at the exact middle: the top half is labeled "Premium" (price here is relatively expensive — a place to look for selling opportunities) and the bottom half is labeled "Discount" (price here is relatively cheap — a place to look for buying opportunities). The exact halfway line is called "Equilibrium" — a common point where price pauses or reverses.
Instead of waiting for both ends of the range to fully finish forming (which most similar tools do, and which makes the box lag behind price), one end of this box is locked to the last confirmed turning point, while the other end keeps following the live price in real time. This means the box always contains the current candle and never leaves it stranded outside — you're never looking at a stale, outdated range.
HOW TO ACTUALLY USE IT (STEP BY STEP)
1. Decide which side you want to trade, then wait for price to come to you — don't chase it in the middle of the box.
- Looking to buy (go long)? Wait for price to fall all the way down into the green Discount zone before considering an entry.
- Looking to sell (go short)? Wait for price to rise all the way up into the red Premium zone before considering an entry.
2. Once price reaches the zone you're waiting for, look for an actual trigger before entering — a reversal candle, a price gap, a small break of structure — rather than buying or selling the instant price merely touches the colored area.
3. Treat the Equilibrium (halfway) line as a "fair value" reference — price often reacts around this line before deciding its next move, so it can act as a first target or a place price pauses on the way to the far zone.
4. Watch the two dots marking the range's boundaries (0 = the low, 1 = the high) — these are the exact swing points the box is built from.
5. The box updates and can shift over time as new swings form — that's expected behavior, not a bug; it means the range is following the market's current structure.
EVERY SETTING EXPLAINED
Range Detection group
- Swing Length — how many candles on each side must be smaller/bigger for a point to count as a real turning point. A bigger number only catches major, important swings (slower-updating, bigger ranges); a smaller number catches minor ones (faster-updating, smaller ranges).
- Lock Range Until Band Break — when ON (recommended), the box stays fixed in place while price bounces around inside it, and only redraws once price actually breaks all the way out through the top or bottom. When OFF, the box updates every time a new turning point confirms, which reacts faster but can shift the box around more while you're watching it.
Visualization group
- Premium Zone — fill color of the top (expensive) half.
- Discount Zone — fill color of the bottom (cheap) half.
- Boundary Lines (0 / 1) — color of the lines marking the very top and bottom of the box.
- Show Equilibrium (50%) — turns the halfway line on or off.
- Equilibrium Color.
- Equilibrium Style — solid, dashed, or dotted line.
- Extend Right — stretches the box and lines all the way to the right edge of your chart. Turn off to have them stop at the current candle instead.
Swing Markers group
- Show Swing Points — turns on two small dots marking exactly where the box's high and low come from.
- High Swing (1) / Low Swing (0) — colors for those two dots.
Labels group
- Show Fib Levels (0 / 0.5 / 1) — labels the bottom of the box as "0", the middle as "0.5", and the top as "1" (standard reference numbers used to describe where price sits inside the range).
- Show Premium / Discount Labels — writes the words "Premium" and "Discount" inside each half.
- Show Prices — adds the actual price number next to the 0 / 0.5 / 1 labels.
- Label Position — puts the text labels on the right side (following the current candle) or the left side (where the range originally started).
- Label Text Color.
Indicator

Smart Money Concept [martineye15]Smart Money Concepts Toolkit — an all-in-one Smart Money / ICT overlay that auto-detects and draws the core concepts on any symbol and timeframe, then ties them together with a multi-factor confluence filter and a built-in risk:reward trade planner.
WHAT IT DRAWS
- Market structure: swing pivots labelled HH / HL / LH / LL, with Break of Structure (BOS, continuation) and Change of Character (CHoCH, first counter-trend break) and a persistent trend state. An optional faster "internal" structure stream can run alongside the major one.
- Liquidity: Equal Highs / Lows (EQH / EQL) detected within an ATR-based tolerance, plus liquidity sweeps / stop hunts (a wick beyond a prior swing that closes back inside).
- Order blocks: the last opposite-colour candle before a structural break, extended until mitigated. Choose Touch or Close mitigation, wick or body range, swing or internal origin, and optional breaker blocks.
- Fair value gaps: 3-candle imbalances, extended until filled, with Touch or Close fill logic and an option to keep only unfilled gaps.
- Premium / discount: dynamic zones from the current dealing range with a 50% equilibrium line and an optional OTE band (0.62-0.79).
- Sessions / kill zones: optional Asia / London / New York shading with a configurable timezone and session times.
CONFLUENCE ENGINE (optional)
A discreet long/short marker that prints only when the factors YOU enable all agree - any combination of: price in discount/premium, a BOS/CHoCH in the trade direction, an unmitigated order block, an unfilled FVG, an opposing liquidity sweep, and higher-timeframe bias alignment via an HTF EMA. A recency window controls how fresh an event must be to still count. Signals evaluate on bar close and only on the first bar the conditions are met, so they do not spam or flip intrabar.
TRADE SETUP (Risk:Reward)
When enabled, each confluence signal draws a full plan: an entry (market at the signal close, or a limit at the order-block midpoint), a stop anchored to the order block / swing point / ATR that would invalidate the idea (plus an ATR buffer), and TP1 to TP4 placed at your chosen R multiples. Levels project forward and the lines are draggable, so you can fine-tune the plan by hand.
ALERTS
Ready-made alerts for BOS, CHoCH, new bullish/bearish order block, new bullish/bearish FVG, liquidity sweep, and confluence long/short.
HOW TO USE
Add it to a standard candlestick chart. Read the market with structure, liquidity and premium/discount; use order blocks and fair value gaps as areas of interest; then, if you want a filter, enable the confluence engine and turn on only the factors that fit your approach. Enable the trade setup to auto-draw a structure-anchored R:R plan on each signal, and set alerts on the events you care about. Every module toggles independently, so you can keep the chart as clean or as detailed as you like.
WHAT MAKES IT DIFFERENT
Instead of isolating a single SMC concept, it unifies structure, liquidity, order blocks, FVGs, premium/discount and session timing, and adds two things on top: a configurable confluence filter that only signals when multiple user-chosen factors align, and an integrated R:R planner that anchors the stop to the actual level that invalidates the trade and projects targets by R multiple.
REPAINTING & LIMITATIONS
All structural logic is based on confirmed pivots and closed candles; fair value gaps are committed only on a confirmed bar; the higher-timeframe bias uses the previous closed HTF bar. Pivots appear after their lookback (the normal pivot lag), which is not repainting. Live drawings such as order blocks and premium/discount zones update as the current, unclosed bar develops and as new pivots confirm; this is expected behaviour, not a change to confirmed history.
This is a visual, decision-support tool. It is not a strategy, it produces no orders or performance statistics, and it is not financial advice. Indicator

Premium & Discount Matrix1. Dynamic Intraday Dealing Range
The core of the PD Matrix is the "dealing range." The script calculates this by finding the absolute highest high and lowest low of the current daily session:
It automatically detects when a new day begins.
As the day progresses and price creates new highs or lows, the script dynamically updates the top and bottom boundaries in real-time.
2. Matrix Box & Equilibrium
Once the dealing range is established, it draws the matrix components:
The Box: It draws a single, fully transparent rectangle around the entire daily range. The background is completely clear so it doesn't obstruct your candlesticks, and only the outer border is visible.
Equilibrium (50%): It automatically calculates the exact mathematical midpoint of the daily high and low. It then draws a dashed line straight through the middle of the box to represent the 50% Equilibrium level.
3. Smart Market Labeling
To make the zones instantly readable, the script places three floating text labels neatly to the right of your current live candle. These labels move with the price action:
Premium (Red): Positioned in the upper half (above 50%). According to ICT concepts, this is expensive pricing where institutional algorithms seek to distribute (sell short).
Eq (50%) (Gray): Points directly to the dashed equilibrium line, representing fair value.
Discount (Green): Positioned in the lower half (below 50%). This is cheap pricing where institutional algorithms seek to accumulate (buy long).
4. Customization & Performance
Like the previous script, this is highly optimized for PulseWire. It uses a single dynamic box, a single line, and three labels that constantly update on the very last bar, preventing your chart from being cluttered with hundreds of historical drawings.
You can fully customize the colors of the box border, the equilibrium line, and all three text labels directly from the indicator settings! Indicator

Fractal Structure Indicator BOS CHoCH TGFXFractal Market Structure — BOS / CHoCH
OVERVIEW
This tool maps market structure automatically using fractal pivots. It detects swing and internal structure, labels each break as BOS (continuation) or CHoCH (change of character / reversal), tracks the current fractal high and low (FH / FL), highlights the premium and discount zones of the active range, and summarises higher-timeframe structure in a table.
THE CONCEPTS
- Fractal pivots: highs and lows are detected as Williams-style pivots (a high or low with N bars on each side). Two layers are available — swing structure (larger pivots) and internal structure (smaller pivots inside the swings).
- BOS (Break of Structure): price closes beyond the prior structural point in the direction of the trend — a continuation event.
- CHoCH (Change of Character): the first break against the prevailing structure — an early sign of a potential reversal.
- Current FH / FL: the most recent fractal high and low, where liquidity tends to rest.
- Premium / Discount: the active range is split at its 50% equilibrium. Above it is premium (relatively expensive); below it is discount (relatively cheap).
- Multi-timeframe table: shows the structural bias and the zone (premium / discount) of higher timeframes at a glance.
NON-REPAINTING
A fractal is only confirmed once N bars have closed on each side, so a pivot is fixed after confirmation and does not repaint. Structure breaks (BOS / CHoCH) are evaluated on bar close.
SETTINGS
- Swing fractal length and internal fractal length.
- Show / hide internal structure.
- Show current FH / FL lines and labels.
- Show BOS / CHoCH labels.
- Show premium / discount zones.
- Colors, line extension, and the multi-timeframe table (timeframes and position).
HOW TO READ IT
- Green = bullish structure, red = bearish structure.
- BOS suggests trend continuation; CHoCH warns of a possible reversal.
- Price reaching discount within a bullish bias, or premium within a bearish bias, is the classic context many traders use to look for entries in the direction of structure.
NOTES
This script is an original implementation of standard, public price-action concepts (fractal pivots, market structure, BOS / CHoCH, premium / discount, equilibrium). It is a visualization and context tool — it does not generate buy/sell signals and makes no claim about future performance. Best used together with your own analysis and risk management. Indicator

Basis Divergence OscillatorBasis Divergence Oscillator — PulseWire publication description
## Overview
The Basis Divergence Oscillator turns the **futures-versus-spot basis** (the premium or discount of a future to its cash market) into a standardized, bounded oscillator, and then looks for **divergence between price and that basis**. The idea it tests is simple: when price makes a new extreme but the premium does not confirm it, the move is more likely leverage being unwound than fresh demand.
It is a single-pane oscillator. By default it pairs NSE NIFTY index futures with the NSE:NIFTY cash index, but every data input is user-configurable, so it runs on any future that has a cash/spot counterpart, in any market and on any timeframe.
## What it plots
- A z-scored **basis oscillator** (premium expanding = up, premium shrinking toward discount = down), with a glow line and σ-based overbought/oversold levels.
- **Extreme-zone bands** (default ±3σ) with a gradient fill that deepens toward the edge.
- **Divergence lines and labels** drawn on the oscillator — regular (reversal) and hidden (continuation), in two colors.
- **In-band reversal dots** where the oscillator turns inside an extreme zone.
- Optional **price-pane marks** at the confirmation bar (all generated by this one indicator).
- A **background-adaptive status dashboard** (oscillator value in σ, zone, last divergence, last reversal, live basis in points).
## Why these components are combined (mashup rationale)
This script deliberately combines a **cross-symbol calculation**, a **normalization stage**, a **divergence engine** and a **reversal read**, because each one answers a question the others cannot, and none of them is useful here on its own:
1. **Cross-symbol basis (two instruments → one series).** The basis is `chart price − cash/spot reference`. It isolates the small premium/discount component of price, which is driven by cost of carry, financing and leverage/positioning demand — information that the instrument's own price and its own volume do not contain. This is the whole reason a second symbol is pulled: remove either symbol and the basis is undefined. The two-symbol construction is intrinsic, not decorative.
2. **Standardization (rolling z-score).** The raw basis drifts slowly with time-to-expiry and carry, and its scale differs by instrument. The z-score detrends that drift and expresses the basis in standard-deviation units, so "overbought/oversold" and the extreme bands mean the same thing on NIFTY, on a commodity future, or on a crypto perpetual. Without this step the divergence thresholds would not transfer between symbols.
3. **Divergence engine.** A plotted basis line is already common; the original payload here is reading **price-versus-basis disagreement at confirmed pivots**. The engine pairs each new price pivot with the basis oscillator's value, then requires (a) a genuine new price extreme, (b) the basis failing to confirm it, (c) a minimum oscillator gap scaled to the oscillator's own stdev, (d) the two pivots within a maximum bar distance, and (e) optionally an overbought/oversold reading at the pivot. These gates exist so the combination produces meaningful signals rather than noise.
4. **Reversal read.** Independently, the engine flags oscillator turns that occur inside the extreme bands — a complementary "exhaustion" cue to the divergence cue.
In short, the components form one pipeline: **build an independent signal (basis) → make it comparable (z-score) → surface where price and that signal disagree (divergence) and where it exhausts (reversal).** They are read together; each is incomplete alone.
## How it works (method)
- `basis = price − request.security(reference, close)` on the chart's timeframe (no lookahead).
- `oscillator = z-score(basis, normalization window)`, optionally EMA-smoothed.
- Regular and hidden divergence are detected from confirmed `pivothigh`/`pivotlow` pivots and filtered by the gates above.
- Reversals are oscillator pivots that print within the ±extreme bands.
- Pivots confirm a few bars after they occur, so a printed signal does not repaint afterward. The confirmation lag equals the pivot length.
## How to use it
1. Put the indicator on a **future** (e.g. NIFTY index futures).
2. In **Data source**, set **Reference (cash/spot) symbol** to that instrument's spot (default NSE:NIFTY). A mismatched reference makes the basis meaningless.
3. Read divergence as **context, not a trigger**: a bearish divergence (price higher high, basis lower high) says the advance is not backed by premium; a bullish divergence says the opposite. Confirm with your own structure, levels and risk process.
4. Tune the **pivot length**, **max gap** and **min oscillator gap** to your timeframe; raise them for fewer, cleaner signals.
## Originality
This is an original implementation. It is not a basis line and not a generic divergence script: it is the specific combination of a cross-symbol basis, σ-standardization that makes the read portable across markets, a multi-gate divergence engine (magnitude + distance + extreme-zone), hidden-divergence and in-band reversal detection, and a background-adaptive dashboard. The code is written from scratch; helper functions use only their arguments and built-ins.
## Credits
The basis (futures premium/discount) is explained by the **cost-of-carry / theory-of-storage** framework in futures-pricing economics — foundational work by N. Kaldor (1939) and H. Working (1948–49). **Price/oscillator divergence** is a long-established, publicly documented technical-analysis technique. This script is not affiliated with, nor endorsed by, any third party.
## Notes / limitations
- The basis needs a clean reference feed and a matched contract; on illiquid or mismatched references, or when spot and future trade on different clocks, it is noisy.
- Divergence is descriptive context, never a guarantee of reversal.
- If the reference symbol is unavailable the oscillator holds flat and the dashboard shows "n/a".
## Disclaimer
Research and educational tool only. NOT financial advice and no guarantee of profitability or accuracy. Indicators describe past behaviour; they do not predict the future. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability for any use of this script.
Indicator

Indicator

Orderflow Synthesis Pro [JOAT]Orderflow Synthesis Pro
Introduction
The Orderflow Synthesis Pro is an advanced open-source institutional orderflow analysis indicator that combines Order Block detection, Fair Value Gap identification, Liquidity Pool mapping, and Premium/Discount Array analysis into a unified multi-dimensional flow system. This indicator helps traders identify where institutional money is positioning by analyzing price imbalances, supply/demand zones, and value arrays across the market structure.
Unlike basic support/resistance indicators that simply mark levels, this system dissects orderflow into actionable intelligence: Order Blocks reveal where institutions accumulated or distributed positions, Fair Value Gaps expose price inefficiencies that often get filled, Liquidity Pools identify where stop hunts occur, and Premium/Discount Arrays show whether price is trading at value or extremes. The indicator is designed for traders who understand that institutional footprints can be detected through systematic orderflow analysis.
Why This Indicator Exists
This indicator addresses a critical gap in retail trading: the ability to see institutional orderflow in real-time. Institutional traders leave detectable footprints through their large orders that create specific price patterns. By combining multiple orderflow methodologies, this indicator reveals:
Order Blocks: Last opposing candle before strong directional moves - marks institutional accumulation/distribution zones
Fair Value Gaps: Three-candle price imbalances where price moved too fast, leaving inefficiencies that often get filled
Liquidity Pools: Equal highs and lows where retail stops cluster - prime targets for institutional sweeps
Premium/Discount Arrays: Value zones showing whether price is expensive (premium) or cheap (discount) relative to range
Breaker Blocks: Failed Order Blocks that reverse - signal institutional trap or change in sentiment
Mitigation Blocks: Price returning to Order Blocks for retests - optimal entry opportunities
Each component provides a different lens on institutional behavior. Order Blocks show positioning, Fair Value Gaps show inefficiencies, Liquidity Pools show manipulation targets, and Value Arrays show context. Together, they create a comprehensive view of smart money activity.
Core Components Explained
1. Order Block Detection
Order Blocks represent the last opposing candle before a strong directional move. They mark zones where institutions placed large orders:
// Bullish Order Block: Last bearish candle before strong bullish move
bullishOB = close < open and close > open and
(high - low) > atr * 1.5 and
volume > avgVol * 1.3
The indicator identifies Order Blocks using three criteria:
Candle direction reversal (bearish to bullish or vice versa)
Strong momentum (candle range exceeds ATR threshold)
Volume confirmation (volume exceeds average by multiplier)
Each Order Block displays with a dark box, glowing border, and equilibrium line through the middle (50% level). Strength classification labels blocks as "STRONG" when volume exceeds 1.8x average. Order Blocks remain active until price closes through them (mitigation), at which point they're removed.
2. Fair Value Gap Analysis
Fair Value Gaps (FVGs) occur when price moves so fast that it leaves an imbalance - a gap between three consecutive candles:
// Bullish FVG: Current low > 2 candles ago high
bullishFVG = low > high
fvgSize = (low - high ) / high * 100
FVGs represent price inefficiencies where one side overwhelmed the other. The indicator:
Detects gaps with minimum size threshold (default 0.3%)
Draws semi-transparent boxes marking the imbalance zone
Tracks up to 15 active gaps simultaneously
Auto-removes gaps when price fills them (closes within the zone)
Institutions often return to fill these gaps, making them high-probability reversal or continuation zones depending on context.
3. Liquidity Pool Mapping
Liquidity Pools form at equal highs and lows where retail traders cluster their stop losses. Institutions target these zones to trigger stops before reversing:
The indicator identifies equal highs/lows using pivot detection with tolerance:
Detects swing highs and lows using configurable lookback
Compares pivots to find equal levels within tolerance percentage
Marks zones with thick horizontal lines and labels
Displays "SELL LIQ" above equal highs, "BUY LIQ" below equal lows
When price sweeps these levels and reverses, it signals institutional liquidity grab - often preceding significant moves in the opposite direction.
4. Premium/Discount Arrays
Premium/Discount Arrays classify price position relative to recent range, showing whether price is expensive or cheap:
rangeHigh = ta.highest(high, 50)
rangeLow = ta.lowest(low, 50)
rangeEQ = (rangeHigh + rangeLow) / 2
inPremium = close > rangeEQ and close > (rangeEQ + (rangeHigh - rangeEQ) * 0.5)
inDiscount = close < rangeEQ and close < (rangeEQ - (rangeEQ - rangeLow) * 0.5)
The indicator displays:
Multi-gradient background (red/orange in premium, cyan/green in discount)
Glowing iridescent equilibrium line with pulsing effect
Fibonacci-style levels at 75%, 50%, 25% of range
Dynamic adjustment as range evolves
Institutional traders typically buy in discount zones and sell in premium zones. This provides directional bias for entries.
5. Breaker Blocks
Breaker Blocks occur when an Order Block gets broken and price reverses. They signal failed institutional positioning or traps:
When a bullish Order Block breaks to the downside, it becomes a bearish Breaker Block. When a bearish Order Block breaks to the upside, it becomes a bullish Breaker Block. The indicator marks these with dotted boxes and "BREAKER" labels, showing zones where sentiment shifted.
6. Mitigation Blocks
Mitigation occurs when price returns to an Order Block for a retest. These provide optimal entry opportunities with defined risk:
The indicator marks mitigation with small "MIT" labels when price touches an active Order Block and shows rejection (bullish candle at bullish OB, bearish candle at bearish OB). This confirms the zone is holding and institutions are defending it.
Visual Elements
Order Block Boxes: Dark fill with glowing neon borders (cyan for bullish, magenta for bearish)
Equilibrium Lines: Dashed lines through Order Block midpoints
Fair Value Gap Boxes: Semi-transparent fills (green for bullish, red for bearish)
Liquidity Lines: Thick horizontal lines at equal highs/lows
Premium/Discount Background: Multi-color gradient showing value zones
Equilibrium Glow: Multi-layer iridescent line with pulsing effect
Gradient Candles: Optional candle coloring based on strength and context
Dashboard: Real-time metrics showing active zones and confluence
The dashboard displays 8 key metrics:
1. Confluence Level (Extreme/Strong/Moderate/Weak)
2. Active Order Blocks count
3. Open Imbalance Zones (FVGs)
4. Liquidity Pool count
5. Value Array position (Premium/Discount/Equilibrium)
6. Flow State (Explosive/Active/Dormant)
7. Signal Quality score (0-100)
Input Parameters
Order Block Detection:
Lookback Period: Bars to analyze for OB formation (default: 20)
Volume Multiplier: Threshold for volume confirmation (default: 1.3)
ATR Multiplier: Threshold for momentum confirmation (default: 1.5)
Maximum Active Blocks: Limit displayed OBs (default: 8)
Strength Classification: Enable/disable strength labels
Fair Value Gaps:
Minimum Gap Size: Percentage threshold for FVG detection (default: 0.3%)
Maximum Active Gaps: Limit displayed FVGs (default: 15)
Auto-Fill Detection: Remove gaps when filled
Quality Filter: All/Strong Only/Extreme Only
Liquidity Analysis:
Swing Detection Length: Pivot lookback for equal highs/lows (default: 5)
Level Tolerance: Percentage range for "equal" levels (default: 0.15%)
Show Sweep Markers: Display liquidity grab boxes
Volume Confirmation: Require volume spike for liquidity zones
Premium/Discount Arrays:
Array Lookback Period: Range calculation period (default: 50)
Fibonacci Levels: Show 75%/50%/25% levels
Dynamic Equilibrium: Adjust EQ line in real-time
Advanced Orderflow:
Volume Imbalance: Mark high-volume candles
Breaker Blocks: Show failed Order Blocks
Mitigation Blocks: Mark OB retests
Gradient Candles: Color candles by strength
How to Use This Indicator
Step 1: Identify Value Context
Check the Premium/Discount Array background. Look for entries in discount zones for longs, premium zones for shorts. The equilibrium line shows fair value.
Step 2: Locate Order Blocks
Find active Order Blocks in your direction. Bullish OBs in discount = high-probability long zones. Bearish OBs in premium = high-probability short zones.
Step 3: Watch for Fair Value Gaps
FVGs often get filled. When price approaches an FVG in your direction, prepare for potential retest entry. FVG + Order Block confluence = strongest setups.
Step 4: Monitor Liquidity Pools
Equal highs/lows are magnets for price. Expect sweeps before reversals. When price takes liquidity and shows rejection, it signals institutional positioning complete.
Step 5: Confirm with Mitigation
Wait for price to return to Order Blocks (mitigation). Enter on rejection candles at OB equilibrium lines with stops below/above the block.
Step 6: Check Confluence Score
Dashboard shows confluence level. Extreme/Strong = high-probability setups. Multiple components aligning (OB + FVG + Liquidity + Value Zone) = best entries.
Best Practices
Use on liquid instruments (major forex, large-cap stocks, major crypto) for reliable signals
Combine with higher timeframe bias - trade in direction of HTF structure
Order Blocks work best at key levels - look for OBs near support/resistance
FVG fills don't always happen immediately - be patient
Liquidity sweeps often happen at session opens (London/New York)
Premium/Discount context is critical - don't buy premium or sell discount
Breaker Blocks signal trend changes - respect them
Volume imbalance + Order Block = strongest zones
Multiple mitigation attempts weaken Order Blocks
Indicator Limitations
Orderflow analysis works best on trending markets with clear structure
Choppy, low-volume conditions produce unreliable signals
Order Blocks can fail - always use stop losses
Fair Value Gaps may not fill immediately or at all in strong trends
Liquidity sweeps can extend further than expected (stop hunts)
Premium/Discount zones are relative - not absolute support/resistance
The indicator shows where institutions likely positioned, not guaranteed future direction
Multiple Order Blocks can create conflicting signals - use confluence
Breaker Blocks require confirmation - don't trade the break alone
Technical Implementation
Built with Pine Script v6 using:
Custom Order Block detection with volume and ATR filters
Three-candle Fair Value Gap calculations
Pivot-based liquidity pool identification with tolerance
Dynamic Premium/Discount Array with gradient visualization
Breaker Block detection through OB invalidation tracking
Mitigation Block confirmation with candle pattern recognition
Real-time confluence scoring system
Advanced gradient color schemes with iridescent effects
Comprehensive dashboard with 8 real-time metrics
The code is fully open-source and can be modified to suit individual trading styles and preferences.
Originality Statement
This indicator is original in its comprehensive integration approach. While individual components (Order Blocks, Fair Value Gaps, Liquidity Pools, Premium/Discount) are established ICT concepts, this indicator is justified because:
It synthesizes four distinct orderflow methodologies into a unified system with confluence scoring
The Breaker Block detection provides failed Order Block analysis not available in standard OB indicators
Mitigation Block tracking combines OB retests with candle pattern confirmation for entry precision
The Premium/Discount Array uses multi-gradient visualization with iridescent equilibrium lines
Volume imbalance integration adds confirmation layer to all components
The confluence scoring system quantifies setup quality across all orderflow elements
Real-time dashboard presents 8 metrics simultaneously for holistic orderflow analysis
Each component contributes unique information: Order Blocks show positioning, Fair Value Gaps show inefficiencies, Liquidity Pools show manipulation, Premium/Discount shows context, Breakers show failures, and Mitigation shows retests. The indicator's value lies in presenting these complementary perspectives simultaneously with unified classification and visual hierarchy.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Orderflow analysis is a tool for understanding market dynamics, not a crystal ball for predicting future price movement. Order Blocks do not guarantee reversals. Fair Value Gaps may not fill. Liquidity sweeps can fail. Past orderflow patterns do not guarantee future orderflow patterns. Market conditions change, and strategies that worked historically may not work in the future.
The zones displayed are analytical constructs based on current market data, not predictions of future price movement. High confluence scores do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Esco Psychological Theory [v1]Esco Psychological Theory
An experimental framework for visualizing market psychology, crowd positioning, and institutional intent — derived entirely from price structure.
-Experimental Indicator
This tool does not generate buy or sell signals.
Esco Psychological Theory is a psychological lens — a way of interpreting what participants are likely feeling and who benefits from those emotional conditions.
Treat it as a research framework, not a trading system.
What This Is
Price does not simply move between support and resistance.
It moves through emotional states.
Every candle on your chart represents thousands of decisions made under fear, greed, hope, regret, and panic. Those emotions are not random — they tend to appear in recognizable structural patterns.
Smart money does not simply buy low and sell high.
It often creates the emotional conditions that force the crowd to do the opposite.
Esco Psychological Theory attempts to model this process. It reads structure, volatility expansion, displacement, liquidity sweeps, failed breakouts, and wick behavior — then infers what market participants are likely experiencing and how institutional players may be responding.
This indicator is not trying to predict price.
It is trying to frame why price may be behaving the way it is.
The Psychological Model
Markets tend to cycle through recognizable emotional regimes.
This indicator models those transitions using a sequential state machine. Regimes progress through adjacent states rather than jumping randomly, producing a more realistic psychological narrative.
The cycle:
COMFORT → TENSION → HOPE → TRAP RISK → PANIC → CAPITULATION → RELIEF → REACCUMULATION → …
Each regime leaves structural fingerprints that can be observed in price behavior.
Comfort
Low volatility, orderly trend behavior, shallow pullbacks.
The crowd feels positioned and confident.
This is often where smart money quietly builds exposure.
Tension
Equal highs/lows begin forming.
Repeated rejection at key levels.
Volatility compresses.
Something is building.
Hope
A displacement candle breaks structure.
Breakout traders enter aggressively.
Momentum appears convincing.
The move looks real.
Trap Risk
The breakout stalls or fails to continue.
Price reclaims prior levels.
Large wicks appear at extremes.
Late entries are now vulnerable.
Panic
Structure shifts against the prior trend.
Stops trigger.
Positions unwind quickly.
Volume spikes.
Capitulation
Consecutive displacement candles appear.
Multiple structure breaks occur rapidly.
Maximum forced repositioning.
Relief
Volatility begins to decline.
Price stabilizes and the market pauses.
Participants exit remaining positions.
Reaccumulation
Compression forms around new price levels.
Fresh pivots emerge.
Smart money quietly finishes positioning for the next cycle.
Modules
Emotional Regime Engine
Classifies the market’s current psychological regime using the sequential state model.
Transitions are constrained to realistic sequences rather than random jumps.
Labels appear only when the regime changes.
Optional background shading and a timeline ribbon allow you to visually track emotional phases across the chart.
Smart Money Intent
Estimates institutional behavior based on structural evidence.
Six possible classifications are evaluated simultaneously with confidence scoring.
Accumulation
Repeated demand absorption and compression near discount levels.
Distribution
Repeated supply rejection and compression near premium levels.
Liquidity Harvest
Sweeps of equal highs or lows followed by sharp displacement reversals.
Trap Engineering
Failed breakouts combined with equal level buildup and overextension.
Passive Absorption
Quiet wick rejection and declining volume at key levels.
Aggressive Repricing
Consecutive displacement candles and decisive structure breaks.
Crowd Bias
Infers likely crowd positioning based on structure alignment and momentum behavior.
Possible states include:
Positioned Long / Positioned Short
Trapped Long / Trapped Short
Chasing Momentum
Indecisive / Neutral
Pain & Pressure Engine
Estimates where future price movement would create the greatest psychological stress.
Pain direction is derived from:
trapped positioning
recent liquidity sweeps
failed breakout attempts
distance from equilibrium
premium / discount positioning
Pressure intensity (0–100%) measures the amount of latent repositioning energy in the market.
When pressure exceeds 70%, candles receive a subtle amber tint.
Soft gradient bands above and below price indicate potential pain direction — areas where movement could force the most participants to react.
Psychological Pressure Zones
Event-driven zones are created when structural events occur.
FOMO Zones
Breakout areas where late buyers or sellers entered.
Regret Zones
Failed breakout ranges containing trapped traders.
Trap Zones
Sweep-and-reclaim areas where liquidity was harvested.
Forced Zones
Panic and capitulation ranges created during liquidation events.
Zones automatically deduplicate, fade with time, and disappear once price cleanly resolves through them.
Premium / Discount Context
Using the most recent major swing high and low, the indicator calculates range positioning.
The chart displays:
Premium (top 25%)
Discount (bottom 25%)
Equilibrium midpoint
The dashboard shows the exact percentage location within the range.
Dashboard
A compact panel summarizes the full psychological read of the market.
Displayed metrics include:
Regime — current emotional state
Crowd — inferred crowd positioning
Intent — smart money classification with confidence score
Pain — directional pain bias
Pressure — psychological pressure intensity
Zone — premium / discount / equilibrium position
Phase — cycle phase progression
What This Indicator Is Not
This indicator does not predict price direction.
It does not have access to order flow, liquidation data, or actual market positioning.
Instead, it infers probable psychological conditions from the structural footprint that emotion leaves on a chart.
The classifications and intent scores are probabilistic interpretations, not definitive signals.
Use this as one analytical layer alongside your own discretionary framework.
Inputs
All modules can be enabled or disabled independently.
Key configuration options include:
Swing Lookback
Major Swing Lookback
Maximum Zone Age / Visible Zones
Regime Background and Timeline Ribbon
Pain Gradient and Pressure Bar Colors
Premium / Discount Shading
Event Markers (displacement candles, sweeps, MSS, squeeze events)
Notes
Overlay indicator (drawn directly on the price chart)
Pine Script v6
Compatible with all markets and timeframes
Lower timeframes may require smaller swing lookback values (10–14 recommended)
Higher timeframes benefit from larger values (21–50 recommended)
Feedback
This is the first public release of Esco Psychological Theory.
The framework is experimental and will continue evolving.
If you test it and have feedback, ideas, or suggestions for improving the psychological model or visual design, I would genuinely love to hear them.
Community input is welcome and appreciated.
Esco Psychological Theory
Structure reveals emotion.
Emotion reveals intent. Indicator

Statistical Reversion Engine [JOAT]Statistical Reversion Engine
Introduction
The Statistical Reversion Engine (SRE) is an advanced open-source mean reversion indicator that combines statistical deviation bands, premium/discount zone analysis, DCA level calculation, Z-score measurement, and enhanced reversion probability scoring to identify high-probability mean reversion opportunities. This indicator quantifies price deviation from statistical mean using multiple calculation methods (SMA, EMA, VWAP, HMA) and provides probabilistic assessment of reversion likelihood through multi-factor analysis including deviation magnitude, volatility regime, and historical reversion patterns.
Unlike basic Bollinger Band indicators that simply plot standard deviation bands, SRE employs a sophisticated statistical framework that calculates Z-scores, premium/discount percentages, enhanced reversion probability (incorporating volatility and premium factors), and tracks historical reversion speed to provide traders with quantitative mean reversion intelligence. The indicator also generates DCA (Dollar Cost Averaging) levels with volatility-adjusted spacing for systematic position building.
Why This Indicator Exists
This indicator addresses the challenge of identifying when price has deviated sufficiently from mean to warrant mean reversion trades. Traditional mean reversion indicators lack probabilistic quantification and don't account for volatility regime or historical reversion patterns. SRE systematically reveals:
Multiple Mean Calculations: SMA, EMA, VWAP (session/continuous), HMA for flexible mean definition
Statistical Deviation Bands: 1σ, 2σ, 3σ bands with customizable multipliers
Z-Score Calculation: Quantifies deviation in standard deviation units
Premium/Discount Analysis: Percentage deviation from mean with zone classification
Enhanced Reversion Probability: Multi-factor scoring (Z-score + premium + volatility)
DCA Level Generation: Volatility-adjusted levels for systematic position building
Historical Reversion Tracking: Measures average bars to return to mean after extreme deviation
Each component provides unique intelligence. Mean calculation defines center, deviation bands show extremes, Z-score quantifies magnitude, premium/discount shows percentage, probability scores likelihood, DCA levels provide entry framework, and historical tracking provides context.
Core Components Explained
1. Flexible Mean Calculation System
SRE supports four mean calculation methods:
f_calculate_mean(string type, int length) =>
float result = close
if type == "SMA"
result := ta.sma(close, length)
else if type == "EMA"
result := ta.ema(close, length)
else if type == "VWAP"
result := session_reset ? ta.vwap(hlc3) : ta.vwma(hlc3, length)
else if type == "HMA"
result := ta.hma(close, length)
result
Mean selection impacts reversion behavior:
- SMA: Simple average, slower to respond
- EMA: Exponential weighting, faster response
- VWAP: Volume-weighted, institutional reference
- HMA: Hull Moving Average, smoothest with minimal lag
2. Statistical Deviation Band System
Three deviation bands calculated using standard deviation:
float mean_line = f_calculate_mean(mean_type, mean_length)
float stdev = f_calculate_stdev(close, deviation_period)
float upper_band_1 = mean_line + (stdev * band_multiplier_1) // 1σ
float lower_band_1 = mean_line - (stdev * band_multiplier_1)
float upper_band_2 = mean_line + (stdev * band_multiplier_2) // 2σ
float lower_band_2 = mean_line - (stdev * band_multiplier_2)
float upper_band_3 = mean_line + (stdev * band_multiplier_3) // 3σ
float lower_band_3 = mean_line - (stdev * band_multiplier_3)
Default multipliers: 1.0, 2.0, 3.0 (customizable)
- 1σ: 68% of price action (normal range)
- 2σ: 95% of price action (extended range)
- 3σ: 99.7% of price action (extreme range)
3. Z-Score Calculation & Classification
Z-score quantifies deviation in standard deviation units:
f_calculate_zscore(float price, float mean, float stdev) =>
float zscore = stdev > 0 ? (price - mean) / stdev : 0.0
zscore
float zscore = f_calculate_zscore(close, mean_line, stdev)
Z-score interpretation:
- |Z| < 1.0: Normal deviation (40% reversion probability)
- |Z| 1.0-1.5: Moderate deviation (60% reversion probability)
- |Z| 1.5-2.0: Extended deviation (75% reversion probability)
- |Z| 2.0-2.5: Extreme deviation (85% reversion probability)
- |Z| > 3.0: 3-sigma event (95% reversion probability)
4. Premium/Discount Zone Analysis
Percentage deviation from mean with zone classification:
f_calculate_premium_discount(float price, float mean) =>
float pct = mean > 0 ? ((price - mean) / mean) * 100 : 0.0
pct
float premium_discount_pct = f_calculate_premium_discount(close, mean_line)
string current_zone =
premium_discount_pct >= premium_threshold * 2 ? "Extreme Premium" :
premium_discount_pct >= premium_threshold ? "Premium" :
premium_discount_pct <= discount_threshold * 2 ? "Extreme Discount" :
premium_discount_pct <= discount_threshold ? "Discount" :
"Fair Value"
Zone classification (default thresholds):
- Extreme Premium: >3.0% above mean (strong sell zone)
- Premium: 1.5-3.0% above mean (sell zone)
- Fair Value: -1.5% to +1.5% (neutral zone)
- Discount: -3.0% to -1.5% below mean (buy zone)
- Extreme Discount: <-3.0% below mean (strong buy zone)
5. Enhanced Reversion Probability Scoring
Multi-factor probability calculation:
f_enhanced_reversion_prob(float z, float premium_pct, float vol_rank) =>
float base_prob = f_reversion_probability(z)
// Adjust for premium/discount magnitude
float premium_factor = math.abs(premium_pct) > 3 ? 1.2 :
math.abs(premium_pct) > 2 ? 1.1 :
math.abs(premium_pct) > 1 ? 1.0 : 0.9
// Adjust for volatility (lower vol = higher reversion probability)
float vol_factor = vol_rank < 30 ? 1.2 :
vol_rank < 50 ? 1.1 :
vol_rank < 70 ? 1.0 : 0.85
math.min(base_prob * premium_factor * vol_factor, 99)
Enhanced probability accounts for:
- Base Z-score probability
- Premium/discount magnitude (larger deviation = higher probability)
- Volatility regime (lower volatility = more predictable reversion)
6. Volatility-Adjusted DCA Level Generation
DCA levels automatically adjust spacing based on volatility:
float current_atr = ta.atr(14)
float atr_pct = close > 0 ? (current_atr / close) * 100 : 0
float vol_multiplier = atr_pct > 3 ? 1.5 : atr_pct > 2 ? 1.2 : atr_pct > 1 ? 1.0 : 0.8
for i = 1 to dca_levels
float adjusted_spacing = (dca_spacing * vol_multiplier) / 100
float buy_level = mean_line * (1 - adjusted_spacing * i)
float sell_level = mean_line * (1 + adjusted_spacing * i)
array.push(dca_buy_levels, buy_level)
array.push(dca_sell_levels, sell_level)
Volatility adjustment:
- High vol (ATR% >3): 1.5x spacing (wider levels)
- Elevated vol (ATR% 2-3): 1.2x spacing
- Normal vol (ATR% 1-2): 1.0x spacing (default)
- Low vol (ATR% <1): 0.8x spacing (tighter levels)
7. Historical Reversion Speed Tracking
Measures average bars to return to mean after extreme deviation:
var array reversion_times = array.new_int(0)
var bool tracking_reversion = false
var int reversion_start_bar = 0
if math.abs(zscore) >= 2.5 and not tracking_reversion
tracking_reversion := true
reversion_start_bar := bar_index
if tracking_reversion and math.abs(zscore) < 0.5
int reversion_time = bar_index - reversion_start_bar
array.push(reversion_times, reversion_time)
tracking_reversion := false
float avg_reversion_time = array.size(reversion_times) > 0 ?
array.avg(reversion_times) : na
Average reversion time provides context for expected holding period.
Visual Elements
Mean Line: Electric lime line showing statistical mean
Deviation Bands: 1σ (lime), 2σ (violet), 3σ (deep violet) with gradient fills
Premium/Discount Zones: Background coloring (violet for premium, lime for discount)
DCA Levels: Dotted lines with "B1, B2, B3..." (buy) and "S1, S2, S3..." (sell) labels
Z-Score Label: Current Z-score displayed on price
Gradient Zone Fills: Progressive transparency between bands
Mean Reversion Signals: Triangle markers for strong buy/sell setups
Reversion Probability Heatmap: Background intensity based on enhanced probability
Dashboard: Real-time metrics including zone, P/D%, Z-score, reversion probability, mean value, distance, enhanced probability, deviation percentile, mean trend, nearest DCA, average reversion time, bars since extreme
Input Parameters
Mean Calculation:
Mean Type: SMA, EMA, VWAP, HMA (default: VWAP)
Mean Length: Period for mean calculation (default: 20)
Session Reset (VWAP): Toggle session anchoring (default: true)
Deviation Bands:
Band 1 Multiplier: 1σ multiplier (default: 1.0)
Band 2 Multiplier: 2σ multiplier (default: 2.0)
Band 3 Multiplier: 3σ multiplier (default: 3.0)
Deviation Period: Standard deviation calculation period (default: 20)
Premium/Discount:
Premium Threshold (%): Threshold for premium zone (default: 1.5%)
Discount Threshold (%): Threshold for discount zone (default: -1.5%)
DCA Levels:
Enable DCA Levels: Toggle DCA display (default: true)
Number of DCA Levels: Levels to generate (default: 5)
DCA Spacing (%): Base spacing between levels (default: 1.5%)
Visualization:
Show Deviation Bands: Toggle band display (default: true)
Show Band Fills: Toggle gradient fills (default: true)
Show Premium/Discount Zones: Toggle background coloring (default: true)
Show Z-Score Label: Toggle Z-score display (default: true)
How to Use This Indicator
Step 1: Identify Current Zone
Check dashboard "Zone" row. Extreme Discount = strong buy zone, Extreme Premium = strong sell zone.
Step 2: Assess Z-Score Magnitude
|Z| >2.0 indicates extended deviation. |Z| >3.0 is 3-sigma event (rare, high reversion probability).
Step 3: Check Enhanced Reversion Probability
Dashboard shows enhanced probability accounting for volatility and premium factors. >80% is high probability.
Step 4: Monitor Mean Trend
"Rising" mean suggests uptrend, "Falling" suggests downtrend. Trade with mean trend for higher probability.
Step 5: Use DCA Levels for Entry
Enter positions at DCA levels (B1, B2, B3 for longs; S1, S2, S3 for shorts) to average into position.
Step 6: Wait for Strong Signals
Triangle markers appear when:
- Extreme zone + enhanced probability >80% + band crossover
- These are highest conviction mean reversion setups
Best Practices
Mean reversion works best in ranging markets - avoid strong trends
3-sigma events (|Z| >3.0) have highest reversion probability but occur rarely
Use DCA levels to build positions systematically rather than all-in entries
Enhanced probability >80% indicates high-quality setup
Mean trend provides context - reversion against trend is lower probability
Volatility-adjusted DCA spacing prevents over-concentration in high vol
Average reversion time helps set realistic profit target timeframes
Combine with higher timeframe trend - mean reversion with trend is safer
Deviation percentile >90% indicates extreme deviation
Bars since extreme >50 suggests extended deviation may persist
Indicator Limitations
Mean reversion fails during strong trending markets
3-sigma events can persist longer than expected during major news
DCA levels don't account for fundamental catalysts
Enhanced probability is statistical, not deterministic
Historical reversion time doesn't guarantee future reversion speed
VWAP mean resets daily - may not be appropriate for all timeframes
Standard deviation assumes normal distribution - markets have fat tails
Premium/discount thresholds may need adjustment for different instruments
Technical Implementation
Built with Pine Script v6 using:
Four mean calculation methods (SMA, EMA, VWAP, HMA)
Three-tier deviation band system with customizable multipliers
Z-score calculation with standard deviation
Premium/discount percentage with zone classification
Enhanced reversion probability (Z-score + premium + volatility)
Volatility-adjusted DCA level generation
Historical reversion speed tracking with arrays
Deviation percentile ranking
Mean trend detection (fast vs slow mean)
Gradient zone fills with progressive transparency
Reversion probability heatmap background
Comprehensive dashboard with 12 metrics
The code is fully open-source and can be modified to suit individual trading styles.
Originality Statement
This indicator is original in its comprehensive statistical mean reversion approach. While Bollinger Bands and mean reversion are established concepts, this indicator is justified because:
It combines four mean calculation methods with three-tier deviation bands
Enhanced reversion probability incorporates Z-score, premium magnitude, and volatility regime
Volatility-adjusted DCA level generation adapts to market conditions
Historical reversion speed tracking provides empirical context
Premium/discount zone classification adds percentage-based perspective
Mean trend detection (fast vs slow) provides directional context
Deviation percentile ranking shows historical extremity
Integration of statistical measures (Z-score, stdev, percentile) with practical tools (DCA levels, signals)
Each component contributes unique information: mean defines center, deviation bands show extremes, Z-score quantifies magnitude, premium/discount shows percentage, enhanced probability scores likelihood, DCA levels provide framework, historical tracking provides context, and mean trend shows direction. The indicator's value lies in presenting these complementary perspectives simultaneously with unified statistical framework.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Mean reversion probabilities do not guarantee outcomes. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

SMC Statistical Liquidity Walls [PhenLabs]📊 SMC Statistical Liquidity Walls
Version: PineScript™ v6
📌 Description
The SMC Statistical Liquidity Walls indicator is designed to visualize market volatility and potential reversal zones using advanced statistical modeling. Unlike traditional Bollinger Bands that use simple lines, this script utilizes an “Inverted Sigmoid” opacity function to create a “fog of war” effect. This visualizes the density of liquidity: the further price moves from the equilibrium (mean), the “harder” the liquidity wall becomes.
This tool solves the problem of over-trading in low-probability areas. By automatically mapping “Premium” (Resistance) and “Discount” (Support) zones based on Standard Deviation (SD), traders can instantly see when price is overextended. The result is a clean, intuitive overlay that helps you identify high-probability mean reversion setups without cluttering your chart with manual drawings.
🚀 Points of Innovation
Inverted Sigmoid Logic: A custom mathematical function maps Standard Deviation to opacity, creating a realistic “wall” density effect rather than linear gradients.
Dynamic “Solidity”: The indicator is transparent at the center (Equilibrium) and becomes visually solid at the edges, mimicking physical resistance.
Separated Directional Bias: distinct Red (Premium) and Green (Discount) coding helps SMC traders instantly recognize expensive vs. cheap pricing.
Smart “Safe” Deviation: Includes fallback logic to handle calculation errors if deviation hits zero, ensuring the indicator never crashes during data gaps.
🔧 Core Components
Basis Calculation: Uses a Simple Moving Average (SMA) to determine the market’s equilibrium point.
Standard Deviation Zones: Calculates 1SD, 2SD, and 3SD levels to define the statistical extremes of price action.
Sigmoid Alpha Calculation: Converts the SD distance into a transparency value (0-100) to drive the visual gradient.
🔥 Key Features
Automated Premium/Discount Zones: Red zones indicate overbought (Premium) areas; Green zones indicate oversold (Discount) areas.
Customizable Density: Users can adjust the “Steepness” and “Midpoint” of the sigmoid curve to control how fast the walls become solid.
Integrated Alerts: Built-in alert conditions trigger when price hits the “Solid” wall (2SD or higher), perfect for automated trading or notifications.
Visual Clarity: The center of the chart remains clear (high transparency) to keep focus on price action where it matters most.
🎨 Visualization
Equilibrium Line: A gray line representing the mean price.
Gradient Fills: The space between bands fills with color that increases in opacity as it moves outward.
Premium Wall: Upper zones fade from transparent red to solid red.
Discount Wall: Lower zones fade from transparent green to solid green.
📖 Usage Guidelines
Range Period: Default 20. Controls the lookback period for the SMA and Standard Deviation calculation.
Source: Default Close. The price data used for calculations.
Center Transparency: Default 100 (Clear). Controls how transparent the middle of the chart is.
Edge Transparency: Default 45 (Solid). Controls the opacity of the outermost liquidity wall.
Wall Steepness: Default 2.5. Adjusts how aggressively the gradient transitions from clear to solid.
Wall Start Point: Default 1.5 SD. The deviation level where the gradient shift begins to accelerate.
✅ Best Use Cases
Mean Reversion Trading: Enter trades when price hits the solid 2SD or 3SD wall and shows rejection wicks.
Take Profit Targets: Use the Equilibrium (Gray Line) as a logical first target for reversal trades.
Trend Filtering: Do not initiate new long positions when price is deep inside the Red (Premium) wall.
⚠️ Limitations
Lagging Nature: As a statistical tool based on Moving Averages, the walls react to past price data and may lag during sudden volatility spikes.
Trending Markets: In strong parabolic trends, price can “ride” the bands for extended periods; mean reversion should be used with caution in these conditions.
💡 What Makes This Unique
Physics-Based Visualization: We treat liquidity as a physical barrier that gets denser the deeper you push, rather than just a static line on a chart.
🔬 How It Works
Step 1: The script calculates the mean (SMA) and the Standard Deviation (SD) of the source price.
Step 2: It defines three zones above and below the mean (1SD, 2SD, 3SD).
Step 3: The custom `get_inverted_sigmoid` function calculates an Alpha (transparency) value based on the SD distance.
Step 4: Plot fills are colored dynamically, creating a seamless gradient that hardens at the extremes to visualize the “Liquidity Wall.”
💡 Note
For best results, combine this indicator with Price Action confirmation (such as pin bars or engulfing candles) when price touches the solid walls. Indicator

Indicator

Market to NAV Premium Arbitrage Alpha IndicatorBitcoin treasury companies such as Microstrategy are known for trading at significant premiums. but how big exactly is the premium? And how can we measure it in real time?
I developed this quantitative tool to identify statistical mispricings between market capitalization and net asset value (NAV), specifically designed for arbitrage strategies and alpha generation in Bitcoin-holding companies, such as MicroStrategy or Sharplink Gaming, or SPACs used primarily to hold cryptocurrencies, Bitcoin ETFs, and other NAV-based instruments. It can probably also be used in certain spin-offs.
KEY FEATURES:
✅ Real-time Premium/Discount Calculation
• Automatically retrieves market cap data from PulseWire
• Calculates precise NAV based on underlying asset holdings (for example Bitcoin)
• Formula: (Market Cap - NAV) / NAV × 100
✅ Statistical Analysis
• Historical percentile rankings (customizable lookback period)
• Standard deviation bands (2σ) for extreme value detection (close to these values might be seen as interesting points to short or go long)
• Smoothing period to reduce noise
✅ Multi-Source Market Cap Detection
• You can add the ticker of the NAV asset, but if necessary, you can also put it manually. Priority system: PulseWire data → Calculated → Manual override
✅ Advanced NAV Modeling
• Basic NAV: Asset holdings + cash.
• Adjusted NAV: Includes software business value, debt, preferred shares. If the company has a lot of this kind of intrinsic value, put it in the "cash" field
• Support for any underlying asset (BTC, ETH, etc.)
TRADING APPLICATIONS:
🎯 Pairs Trading Signals
• Long/Short opportunities when premium reaches statistical extremes
• Mean reversion strategies based on historical ranges
• Risk-adjusted position sizing using percentile ranks
🎯 Arbitrage Detection
• Identifies when market pricing significantly deviates from fair value
• Quantifies the magnitude of mispricing for profit potential
• Historical context for timing entry/exit points
CONFIGURATION OPTIONS:
• Underlying Asset: Any symbol (default: COINBASE:BTCUSD) NEEDS MANUAL INPUT
• Asset Quantity: Precise holdings amount (for example, how much BTC does the company currently hold). NEEDS MANUAL INPUT
• Cash Holdings: Additional liquid assets. NEEDS MANUAL INPUT
• Market Cap Mode: Auto-detect, calculated, or manual
• Advanced Adjustments: Business value, debt, preferred shares
• Display Settings: Lookback period, smoothing, custom colors
IT CAN BE USED BY:
• Quantitative traders focused on statistical arbitrage
• Institutional investors monitoring NAV-based instruments
• Bitcoin ETF and MSTR traders seeking alpha generation
• Risk managers tracking premium/discount exposures
• Academic researchers studying market efficiency (as you can see, markets are not efficient 😉) Indicator

Indicator

Session Range ProjectionsSession Range Projections
Purpose & Concept:
Session Range Projections is a comprehensive trading tool that identifies and analyzes price ranges during user-defined time periods. The indicator visualizes high-probability reversal zones and profit targets by projecting Fibonacci levels from custom session ranges, making it ideal for traders who focus on time-based market structure analysis.
Key Features & Calculations:
1. Custom Time Range Analysis
- Define any time period for range calculation - from traditional sessions (Asian, London, NY) to custom periods like opening ranges, hourly ranges, or 4-hour blocks
- Automatically captures the highest and lowest prices within your specified timeframe
- Supports multiple timezone selections for global market analysis
- Flexible enough for intraday scalping ranges or longer-term swing trading setups
2. Premium & Discount Zones
- Automatically divides the range into premium (above 50%) and discount (below 50%) zones
- Visual differentiation helps identify institutional buying and selling areas
- Color-coded boxes clearly mark these critical price zones
3. Optimal Trade Entry (OTE) Zones
- Highlights the 79-89% retracement zone in premium territory
- Highlights the 11-21% retracement zone in discount territory
- These zones represent high-probability reversal areas based on institutional order flow concepts
4. Fibonacci Projections
- Projects 11 customizable Fibonacci extension levels from the range extremes
- Levels extend both above and below the range for symmetrical analysis
- Each level can be individually toggled and color-customized
- Default levels include common retracement ratios: -0.5, -1.0, -2.0, -2.33, -2.5, -3.0, -4.0, -4.5, -6.0, -7.0, -8.0
How to Use:
Set Your Time Range: Input your desired session start and end times (24-hour format)
Select Timezone: Choose the appropriate timezone for your trading session
Customize Display: Toggle various visual elements based on your preferences
Monitor Price Action: Watch for reactions at projected levels and OTE zones
Set Alerts: Configure sweep alerts for when price breaks above/below range extremes
Input Parameters Explained:
Time Range Settings
Range Start/End Hour & Minute: Define your analysis period
Time Zone: Ensure accurate session timing across different markets
Visual Settings
Range Box: Toggle the premium/discount zone visualization
Horizontal Lines: Customize high/low line appearance
Internal Range Levels: Show/hide equilibrium and OTE zones
Labels: Configure text display for key levels
Fibonacci Projections: Enable/disable extension levels
Display Settings
Historical Ranges: Show up to 10 previous session ranges
Alert Type: Choose between high sweep, low sweep, or both
Trading Applications:
Session-Based Trading: Analyze specific market sessions (Asian, London, New York, opening ranges, hourly ranges)
Reversal Trading: Identify high-probability reversal zones at OTE levels
Breakout/Reversal Trading: Monitor range breaks/reversals with built-in sweep alerts
Risk Management: Use Fibonacci projections as profit targets or rejection areas
Multi-Timeframe Analysis: Apply to any timeframe for various trading styles
Important Notes:
This indicator is for educational purposes only and should not be considered financial advice
Past performance does not guarantee future results
Always use proper risk management when trading
The indicator automatically manages historical data to maintain chart performance Indicator

Peak Reaction Zones [BigBeluga]Peak Reaction Zones is an advanced Smart Money Concept (SMC) indicator that identifies the most recent swing high and swing low zones, helping traders determine premium and discount areas for optimal trade positioning.
🔵 Key Features:
Swing High & Low Zones:
Automatically detects the latest swing high and swing low levels.
Helps traders identify key reaction points where price is likely to respond.
Premium & Discount Concept:
The high zone represents a premium area, where price is overextended and may reverse.
The low zone represents a discount area, where price is undervalued and may bounce.
The midline dynamically marks the equilibrium of the range.
Adjustable Zone Width:
Users can fine-tune the width of the zones to match their trading style.
Wider zones capture broader reaction ranges, while narrower zones focus on precise levels.
Zone Retest Signals:
Blue markers appear when price retests the lower reaction zone, signaling potential support.
Orange markers appear when price retests the upper reaction zone, indicating possible resistance.
Price Labels for Key Levels:
Displays the price value of the swing high, swing low, and midline for quick reference.
Helps traders recognize major reaction points at a glance.
🔵 Usage:
Smart Money Trading: Utilize the premium and discount concept to align trades with institutional order flow.
Zone Reactions: Watch for price tests of reaction zones and use the retest signals to confirm potential reversals.
Midline Confirmation: If price holds above or below the midline, it can indicate directional bias.
Scalping & Swing Trading: Short-term traders can look for zone rejections, while swing traders can use the levels for trend continuation setups.
Peak Reaction Zones is a must-have tool for traders looking to trade with Smart Money Concepts, allowing for precise entries and exits based on key liquidity areas and market structure. Indicator

Discount/Premium OTE LevelsThis indicator is created to identify discount/premium areas to provide additional confluence to trades taken. The underlying theory is that the trades taken in discounted areas are likely to have less risk due to a smaller stop loss and a higher reward/risk ratio.
The indicator operates by first identifying a zone between the last major swing high and low. These highs and lows are determined as price points that at the extremes within the number of bars to the left, as defined by the "Swing Sensitivity" setting.
Once a price zone is established, the indicator verifies that the zone meets the minimum size in points as configured via the "Minimum size" setting to be considered tradable. Zones that are too small may not provide a sufficient range even for scalping. The default value is 42 points based on Nasdaq, which means that the distance between inner most OTE levels (0.382 and 0.618) is at least 10 points.
When a valid zone is identified, it is then subdivided into areas of interest based on OTE levels, which can be configured/adjusted via the "Levels to Draw" setting. These levels represent the midpoint (50%), which distinguishes between premium and discount, and the three OTE levels 0.79, 0.705, 0.618, above the 50% for discount and below the 50% for premium.
For example, if a zone is formed initially by a swing low followed by a swing high with the assumption that the draw is higher, the indicator can be used to formulate long positions from below the 50% level starting at 0.38 OTE level, or ideally at 0.295 OTE level using 0 as a stop loss. Alternatively, if the 50% level is not yet tapped, short scalp positions can be made from 0.79-0.618 OTE levels with 50% as a partial or TP target.
See for long/short example
Typically, the indicator will show only a single zone. However, there may be cases with two zones: one larger parent zone containing a smaller, valid price zone within itself.
The indicator will automatically invalidate and remove the zone once the high/low of the zone is invalidated.
Configuration:
The indicator provides several visualization options for customization, including:
Color settings for OTE levels, with separate settings for edge/50% color, premium, and discount levels.
Settings for line style for OTE levels.
Settings to determine whether to show prices on level labels.
Settings to decide if lines should be extended to the right.
Indicator

Ultra Market StructureThe Ultra Market Structure indicator detects key market structure breaks, such as Break of Structure (BoS) and Change of Character (CHoCH), to help identify trend reversals. It plots lines and labels on the chart to visualize these breakpoints with alerts for important signals.
Introduction
This script is designed to help traders visualize important market structure events, such as trend breaks and reversals, using concepts like Break of Structure (BoS) and Change of Character (CHoCH). The indicator highlights internal and external price levels where the market shifts direction. It offers clear visual signals and alerts to keep traders informed of potential changes in the market trend.
Detailed Description
The indicator focuses on detecting "market structure breaks," which occur when the price moves past significant support or resistance levels, suggesting a potential reversal or continuation of the trend.
.........
Type of structure
Internal Structure: Focuses on smaller, shorter-term price levels within the current market trend.
External Structure: Focuses on larger, longer-term price levels that may indicate more significant shifts in the market.
.....
Key events
Break of Structure (BoS): A market structure break where the price surpasses a previous high (bullish BoS) or low (bearish BoS).
Change of Character (CHoCH): A shift in market behavior when the price fails to continue in the same direction, indicating a possible trend reversal.
Once a break or shift is detected, the script plots lines and labels on the chart to visually mark the breakpoints.
It also provides alerts when a BoS or CHoCH occurs, keeping traders informed in real-time.
The indicator can color the background and candles based on the market structure, making it easy to identify the current trend.
.....
Special feature
At news events or other momentum pushes most structure indicators will go into "sleep mode" because of too far away structure highs/lows. This indicator has a structure reset feature to solve this issue.
.........
Detects Break of Structure (BoS) and Change of Character (CHoCH) signals.
Marks internal and external support/resistance levels where market trends change.
Provides visual cues (lines, labels) and real-time alerts for structure breaks.
Offers background and candle color customization to highlight market direction. Indicator

Premium & Discount Delta Volume [BigBeluga]Premium & Discount Delta Volume is an advanced volume-based tool that helps traders identify zones of market imbalances by using the concepts of premium and discount pricing, commonly taught by ICT trader. It calculates and highlights periods where the market is trading at a premium (selling pressure is stronger) or a discount (buying pressure is stronger) and dynamically plots these zones over time. The indicator also calculates delta volume between buying and selling within these zones, showing shifts in market sentiment and potential areas for reversals or continuations.
🔵 IDEA
The Premium & Discount Delta Volume indicator is rooted in the ICT (Inner Circle Trader) concept of premium and discount zones. This concept divides the price action into two key zones:
Premium Zone : This area is where the market is trading at a level where sellers dominate, leading to more selling pressure. The idea is that the price is overvalued, and a potential drop could occur as the market reverts to a balanced state.
Discount Zone : This area is where the market is undervalued, with buyers dominating and applying upward pressure. Prices in this area often indicate opportunities to buy into strength as the market moves back to equilibrium.
At the core of the indicator is the delta volume, which measures the difference between buying and selling pressure within the premium and discount zones. When the delta volume is negative, it signals a downtrend with more selling pressure, while a positive delta volume signals an uptrend with more buying pressure. These zones and their associated delta values update dynamically, providing traders with real-time insights into market strength and potential price reversals.
The equilibrium in the middle of the premium and discount zones represents the balance point between buyers and sellers. When price moves away from equilibrium, it either enters the premium zone (potentially overbought) or the discount zone (potentially oversold), helping traders make more informed decisions based on volume and price structure.
🔵 KEY FEATURES & USAGE
Premium & Discount Zones:
The indicator automatically identifies and plots premium and discount zones on the chart. Premium zones count only negative (selling) volume, while discount zones count only positive (buying) volume. These zones are key areas of interest for identifying potential price reversals or continuations based on volume pressure.
Dynamic Delta Volume Calculation:
The indicator calculates delta volume between the premium and discount zones, showing the imbalance between buyers and sellers. A positive delta volume inside the discount zone suggests strong buying pressure, while a negative delta inside the premium zone suggests strong selling pressure. This helps traders quickly identify trends or market exhaustion.
Up Trend:
Down Trend:
Real-time Updates & Equilibrium Line:
The zones update dynamically every 100 bars or after price crosses them, ensuring that traders always have the most relevant market data. The equilibrium line in the middle of the zones helps traders gauge whether the market is balanced or moving into overbought (premium) or oversold (discount) territory.
Macro and Local Period Calculations:
The indicator allows traders to customize two different periods for analysis: a smaller lookback period (e.g., 50 bars) for short-term price action and a macro period (e.g., 200 bars) for larger trends. Each period has its own premium and discount zones, allowing for a multi-timeframe view of market strength.
Macro:
Both:
Color-coded background for Volume Pressure:
The background color of the smaller period premium and discount box changes based on delta volume. A positive delta turns the background blue, indicating higher buy pressure, while a negative delta turns the background red, signaling higher sell pressure.
🔵 CUSTOMIZATION
Toggle Premium & Discount: Traders can choose to display support and resistance levels based on the high and low points of the premium and discount zones.
Premium & Discount Lookback Period: Traders can adjust the lookback period to define the length of price action to be analyzed for premium and discount zones. A shorter period focuses on more recent market activity, while a longer period provides a broader view of trends.
Macro Highs/Lows Period: The indicator also offers a macro lookback period for identifying larger market trends and key levels of buying or selling volume.
Toggle Macro Levels: Macro levels help identify long-term price extremes, and traders can toggle this feature on or off as needed.
Indicator

Indicator

Previous Highs & Lows [LuxAlgo]The Previous Highs & Lows indicator highlights a user-set amount of previous maximum/minimum prices made within specific intervals, these are displayed as levels customizable levels.
Additionally, one upper and lower zone constructed from the previously displayed highs/lows is included, providing support/resistance areas.
🔶 USAGE
Previous highs/lows are often perceived as key trading levels with the potential of generating multiple reactions upon being reached.
While the daily interval is more commonly used, users can use different intervals, with the indicator supporting hourly, daily, weekly, monthly, and yearly intervals. Using higher intervals on low timeframes can return more distant levels relative to the most recent price, which might not be relevant.
Each level is numbered, with more recent previous highs/lows having a lower number associated with them, users can also highlight more recent levels through a transparency gradient.
Users can control the amount of previous highs/lows displayed using the "Show Last" settings, with a higher value providing more potential support/resistance. Returned previous highs/lows can eventually be filtered out based on their position by enabling the "Filter Based On Position" setting, only keeping previous highs above the current closing price and previous lows below the current closing price, giving more relevant levels as a result.
🔹 Previous High/Low Areas
The indicator includes two areas constructed from the respective percentiles of the returned previous highs/lows. These can be useful as more general support/resistance areas.
Wider areas are often indicative of a group of previous highs or lows being more dispersed, resulting in areas that are easier to reach. Wider areas can also be obtained by increasing the "Areas Width" setting.
Note: Areas will only be displayed if "Show Last" is greater than 1
🔶 SETTINGS
Show Last: Determines the amount of more recent previous highs and previous low levels displayed by the indicator.
Interval: Interval used to capture maximum/minimum price values,
Areas Width: Width of the displayed top/bottom areas, with higher values returning wider areas.
Filter Based On Position: When enabled only display previous highs above the current closing price and previous lows below the current closing price.
🔹 Style
Minimum Gradient Transparency: Minimum transparency value applied to the colors of the oldest displayed previous highs/lows levels.
Indicator
