Indicator

Head & Shoulders Auto Detector [AGPro Series]Head & Shoulders Auto Detector
🎯 **Overview**
Head & Shoulders Auto Detector is a precision pattern recognition tool that automatically identifies classic Head & Shoulders (bearish) and Inverse Head & Shoulders (bullish) reversal formations across any market and timeframe. Built from the ground up for traders who want the full lifecycle of a pattern tracked on-chart — not just a label and a line, but forming → confirmation → target/stop outcome — with a transparent, quality-scored framework that filters low-probability setups before they clutter the chart.
Every pattern carries a composite quality score, a symmetry percentage, an ATR-adaptive neckline, two projection targets, and a live status label that evolves through the pattern's lifespan.
🔹 **Unique Edge**
Most H&S indicators stop at detection. This one goes further:
• **Full lifecycle state machine** — every pattern moves through four explicit states (Forming → Confirmed → Target Hit / Stopped / Invalidated / Expired), and the visuals update in real time at each transition.
• **Dead pattern hygiene** — once a pattern fails or hits target, orphan TP and stop lines are removed, the neckline freezes at the decision bar, and the status label grays out. The chart never accumulates stale clutter.
• **Quality-driven visual hierarchy** — high-quality patterns (Q≥75) are rendered with a star marker and full saturation, mid-tier patterns get standard treatment, and low-tier patterns (Q<60) fade into the background so the trader's eye is guided to what matters.
• **Dual-target projection with R:R** — every confirmation displays both a classic measured-move TP1 and an extended 1.618× TP2, each labeled with the exact reward-to-risk ratio calculated at entry.
• **ATR-adaptive everything** — shoulder tolerance, neckline flatness, head prominence, stop buffer, and label offsets all scale with volatility, so the same settings work across BTC 4H, gold daily, or small-cap stocks.
🔹 **Methodology**
Patterns are detected from confirmed pivot highs and lows using a configurable pivot length. For a valid Head & Shoulders, three same-side pivots (Left Shoulder → Head → Right Shoulder) must satisfy:
• Head extends beyond both shoulders by at least the configured ATR multiple (prominence test).
• Shoulder heights differ by less than the shoulder tolerance in ATR units (symmetry test).
• Two opposite-side pivots between LS-Head and Head-RS define the neckline; their vertical distance must be within the neckline tolerance.
• Composite symmetry score (50% time symmetry, 50% price symmetry) must exceed the minimum threshold.
Quality score combines four weighted components:
• Symmetry (45%) — time + price balance between shoulders
• Neckline flatness (25%) — how horizontal the neckline is
• Volume profile (15%) — head-bar volume relative to shoulder average
• Head prominence (15%) — how clearly the head dominates
Confirmation triggers when price closes beyond the neckline level (interpolated for sloped necklines). Stop is placed at the head level plus an ATR buffer to avoid wick stop-outs. TP1 uses the standard head-to-neckline measured move; TP2 extends to 1.618× that projection.
🔹 **Signals & Alerts**
Four alert events available:
• **Pattern Forming** — a valid H&S or Inverse H&S structure has been detected but not yet confirmed.
• **Pattern Confirmed** — close has broken the neckline; entry is live with TP/Stop drawn.
• **Target Hit** — TP1 has been reached on a confirmed pattern.
• **Neckline Retest** — after confirmation, price has returned to touch the neckline (common high-probability re-entry zone).
🔹 **Key Inputs**
• **Pivot Length** — controls swing-point sensitivity
• **Min Symmetry Score** — minimum shoulder symmetry percentage to accept a pattern (default 60, balanced)
• **Neckline Tolerance (ATR)** — how sloped a neckline is allowed to be
• **Shoulder Height Tolerance (ATR)** — how different the two shoulders can be
• **Head Prominence (ATR)** — minimum head extension beyond shoulders
• **Volume Soft Confirmation** — toggle volume influence on quality score
• **TP1 Method** — Classic (horizontal neckline reference) or Measured Move (slope-aware)
• **Stop Buffer (ATR)** — extra room beyond the head level (default 0.35)
• **Max Pattern Lifetime** — bars after which an unconfirmed pattern expires
• Full visual controls: font size, panel position, theme, zone display, label offset, color palette
🔹 **How to Use**
1. Apply the indicator to any liquid market and timeframe. 4H and higher tend to produce the most reliable formations; intraday works but expects more noise.
2. Watch for patterns labeled with a ⭐ and bright color (Q≥75) — these are the highest-confidence setups.
3. Wait for the ✓ Confirmed status to appear before entering; the ⚡ breakout marker pinpoints the exact confirmation bar.
4. Use the TP1 / TP2 R:R labels to size the trade. Stop is pre-calculated at head level + ATR buffer.
5. Monitor the panel stats over time to understand the indicator's behavior on your specific market — Win Rate, Avg Quality, and Last Signal all update live.
6. Consider combining with trend context (a bearish H&S is far more powerful at resistance in a downtrend than in the middle of a strong uptrend).
🔹 **Limitations & Transparency**
• Pattern detection uses confirmed pivots, so signals appear with a natural delay equal to the Pivot Length setting. This is intrinsic to pivot-based logic, not a flaw.
• Quality score and historical win rate are chart-native calculations based on the loaded history; they are descriptive, not predictive.
• The script does not include multi-timeframe confluence or trend filters — these are deliberate design choices to keep the tool focused and composable with other indicators.
• Volume confirmation is a soft scoring input, not a hard filter, since many crypto pairs and indices have volume data of variable reliability.
• Pattern state transitions use close-based confirmation; intrabar wicks do not trigger state changes except for stop/target hits, which are high/low based as expected.
🔹 **Risk Disclosure**
This indicator is an analytical tool, not a trading recommendation or financial advice. Pattern recognition describes what has formed on a chart; it does not predict future price movement with certainty. Always use proper risk management, position sizing, and confirm signals with your own analysis. Past pattern statistics shown on the panel are descriptive of the visible history and do not guarantee future performance. Trading involves substantial risk of loss. Indicator

Double Top / Bottom Quality [AGPro Series]Double Top / Bottom Quality
Double Top / Bottom Quality is a disciplined, rules-based detector for the two most iconic reversal chart patterns: the Double Top (M-shape) and the Double Bottom (W-shape). Unlike basic pattern finders that fire on any two similar swings, this indicator scores every candidate pattern on a transparent 0–100 Quality Score across four independent factors — and only confirms patterns that pass a user-defined minimum. The result is a cleaner chart with fewer, higher-conviction setups.
Every confirmed pattern delivers a full trading lifecycle: a neckline flip S/R zone (resistance → support on a Double Bottom; support → resistance on a Double Top) and a measured-move target projection band. Pending, confirmed, target-hit and invalidated states are all tracked with disciplined cleanup, so the chart never becomes cluttered.
🔹 WHAT THE INDICATOR DOES
It detects classic Double Top and Double Bottom reversal structures using pivot-based swing analysis with ATR-normalised equality, depth and time-window filters. Each valid candidate is then scored on four independent quality factors. Only candidates that exceed the user-defined minimum score and break the neckline on close are confirmed. Once confirmed, the pattern draws its neckline flip zone and target projection band, labels the setup with its letter grade and score, and tracks the outcome until target hit or invalidation.
🔹 UNIQUE EDGE — WHY IT IS DIFFERENT
Most Double Top / Double Bottom scripts simply connect two similar swings and draw a line. This indicator adds a transparent 4-component Quality Score so every setup is rated before confirmation, not just flagged. Three factors that most scripts ignore are treated as first-class inputs here:
• Pattern Symmetry — the left leg and the right leg of the M / W must be comparable in time, or the pattern is penalised
• Break Volume Confirmation — the neckline break bar is compared to its rolling volume average, and thin breaks score lower
• Depth Quality — shallow, flat patterns are filtered out in favour of deep, decisive reversals
The full lifecycle visualisation (pending → confirmed → target hit) and same-region deduplication are also uncommon in this pattern category, and together they produce a chart that reads cleanly even on long history.
🔹 METHODOLOGY
• Pivot detection via ta.pivothigh / ta.pivotlow with user-configurable length
• Equality check: the two peaks (or troughs) must be within a configurable ATR tolerance
• Time-window filter: minimum and maximum bars allowed between the two pivots
• Depth filter: the vertical distance from peaks to neckline must exceed a minimum ATR threshold
• Neckline: lowest low between the two peaks for a Double Top, or highest high between the two troughs for a Double Bottom
• Confirmation trigger: daily close beyond the neckline
• Invalidation: price exceeds the pattern extreme before the neckline break
• Cooldown: after confirmation, new patterns in the same price region are suppressed for N bars to prevent clustering
🔹 QUALITY SCORE (0–100)
Each confirmed pattern receives a transparent score based on four equally-weighted factors (25 points each):
1. Peak / Trough Equality — how close the two extremes are to each other, measured in ATR units
2. Break Volume Confirmation — break-bar volume relative to the 20-bar average
3. Pattern Symmetry — ratio of the shorter leg to the longer leg (time-based)
4. Depth Quality — pattern height relative to ATR (deeper = higher score)
Score → Grade mapping:
• 85–100 = A
• 70–84 = B
• 55–69 = C
• <55 = D
🔹 SIGNALS, ZONES & ALERTS
Once a pattern confirms, the indicator renders:
• A solid neckline that extends to the right edge
• A neckline flip zone (rectangular S/R band at the neckline level)
• A target projection zone at the measured-move price (pattern height projected from neckline)
• A grade label (A / B / C) and numeric score on the pattern
Two alert types are available: "Confirmed Pattern" fires on confirmation, and "Target Hit" fires when the measured-move target is reached.
🔹 KEY INPUTS
• Pivot Length, ATR Length
• Peak / Trough Equality tolerance (ATR)
• Min / Max bars between peaks
• Minimum Pattern Depth (ATR)
• Break Volume Multiplier
• Cooldown bars
• Minimum Quality Score filter
• Show Pending Patterns toggle
• Show Neckline Flip Zone / Target Zone toggles
• Zone Width (ATR)
• Stale Cleanup Distance, Max Active Zones
• Label size, Panel position / theme / size
• Alert toggles
🔹 HOW TO USE
• Choose a liquid market and a timeframe that matches your trading style (4H and 1D are particularly well-suited to classic reversal patterns)
• Watch for Pending patterns (dashed lines) — these mark candidates awaiting a neckline break
• A Confirmed pattern with grade B or higher is the typical entry signal; aggressive traders may use C-grade while conservative traders may filter to A-grade only
• Use the neckline flip zone as a logical stop-loss reference (above it for Double Tops, below for Double Bottoms)
• Use the target projection zone as a take-profit reference based on the classical measured-move rule
• Combine with higher-timeframe trend, volume profile or an independent confluence tool for best results
🔹 LIMITATIONS & TRANSPARENCY
• Pivot-based detection means patterns confirm with a natural lag equal to the pivot length
• No strategy is 100% reliable — Quality Score filters improve average conviction but do not guarantee outcomes
• Very low-liquidity markets may produce unstable pivots; a longer pivot length helps
• Measured-move targets are a classical reference, not a prediction
• Historical statistics shown in the panel are pattern-completion counts on the loaded chart; they are not a guaranteed forward performance estimate
🔹 RISK DISCLOSURE
This script is provided for educational and analytical purposes only. It is not financial advice and does not constitute a recommendation to buy, sell or hold any asset. Trading involves substantial risk of loss; past pattern performance is not indicative of future results. Always perform your own research and use appropriate risk management.
Open-source under the Mozilla Public License 2.0 — contributions and feedback are welcome. Indicator

Indicator

AG Pro Structure Labels [AGPro Series]AG Pro HH HL LH LL Structure Labels
Overview / What it does
AG Pro HH HL LH LL Structure Labels is a clean market-structure reader built to simplify price action without turning the chart into a wall of signals. Its core purpose is straightforward: identify confirmed swing highs and swing lows, classify them as HH, HL, LH, or LL, and connect those points in a visually readable structure path so traders can understand the current sequence of price development at a glance.
Many market structure tools try to do too much at once. They mix structure, signals, zones, pattern scoring, and trade suggestions into a single publication, which can make the chart heavier and the analytical purpose less clear. This script takes the opposite route. It focuses on one job only: making confirmed swing structure easier to read, follow, and interpret in real time as the chart evolves.
That design choice is what gives this script its value. Instead of asking the user to interpret disconnected highs and lows manually, the script builds a visible structure chain from confirmed pivots and labels each important step. The result is a chart that remains visually disciplined while still communicating trend continuation, structural weakening, and flow transitions in a simple and repeatable format.
This script is especially useful for traders who want structure clarity before they bring in any other layer of analysis. It can be used as a standalone structure map, or as a first-pass chart-cleaning tool before applying other concepts such as support and resistance, trend continuation logic, pullback analysis, breakout validation, or discretionary execution rules.
Unique Edge
The unique edge of this script is not that it attempts to predict where price will go next. Its strength is that it organizes confirmed structure in a way that is visually clean, logically consistent, and immediately usable on live charts.
Unlike many AG Pro scripts that are built around event detection, confluence scoring, price-zone visualization, setup quality filtering, or breakout logic, this publication is intentionally narrower and more focused. It is not a BOS/CHoCH event detector. It is not a liquidity-sweep model. It is not an order-block or fair-value-gap engine. It is not a breakout-quality, retest-quality, or pattern-quality scorer. It is also not a fixed reference-level tool such as a prior-day or prior-week high/low mapper. This script is a structure readability tool first and foremost.
That distinction matters.
Previous AG Pro releases often revolve around a specific trading event: a sweep, a break, a retest, a zone reaction, a continuation pattern, or a multi-factor confluence state. This script does not begin from an event. It begins from the swing chain itself. It asks a simpler question: what is the current sequence of confirmed highs and lows, and what does that sequence imply about market flow right now?
Because of that, the script fills a different role in the broader AG Pro library. It is closer to a structural map than a setup engine. It helps answer whether the chart is still printing constructive highs and lows, whether the sequence has started to weaken, or whether the structure is now leaning in the opposite direction. That makes it useful both on its own and as a foundation layer beneath other tools.
Another important differentiator is presentation discipline. The structure path provides continuity between pivots, while the label set communicates classification without unnecessary chart clutter. The compact floating HUD reinforces the current flow state without dominating screen space. Together, these choices make the script visually premium while keeping the chart readable.
Methodology
The script uses a confirmed pivot framework. Swing highs and swing lows are identified using left and right lookback parameters selected by the user. Because pivots require confirmation, labels appear only after the structure point is confirmed by the specified number of bars. This helps reduce noise and keeps the structure map grounded in confirmed rather than speculative swing points.
Once a new pivot high is confirmed, it is compared with the prior confirmed pivot high. If it exceeds the previous confirmed high, it is classified as HH. If it does not, it is classified as LH. The same logic applies on the low side: if a confirmed pivot low is above or equal to the previous confirmed pivot low, it is classified as HL; if it is lower, it is classified as LL.
The script also includes an ATR-based structure filter. This filter is designed to suppress micro-swings that are too small relative to current volatility, which helps maintain visual cleanliness on choppier charts. Instead of drawing every minor fluctuation, the script attempts to keep attention on swings that are more structurally meaningful for the selected sensitivity.
A structure path, shown as a clean zigzag line, connects the confirmed pivots that pass the filter. This gives the user an immediate visual map of the sequence rather than a collection of isolated labels. In practice, this is one of the most useful parts of the script because it turns the market’s swing progression into a readable path.
The floating HUD summarizes the current market-flow bias in a minimalist format. It is not intended to act as a trade signal. Its job is to provide a quick structural read so the user can see whether the recent chain is leaning bullish, bearish, or transitional according to the internal swing logic.
Signals & Alerts
This script is not designed as a one-click entry engine. Its alerts are structural, not predictive.
The publication includes alerts for newly confirmed HH, HL, LH, and LL prints, which can help users monitor structure development without staring at the chart continuously. It also includes alerts for structure-flow transitions when the internal trend state turns bullish or bearish.
These alerts are best understood as workflow alerts. They tell the user that structure has progressed into a new confirmed condition. They do not guarantee continuation, reversal, breakout success, or trade profitability. Their purpose is to improve awareness of structural change, not to replace independent analysis.
Key Inputs
Pivot sensitivity is controlled through left and right lookback values. Higher values usually produce fewer but more mature structure points, while lower values usually produce a faster and denser structure map.
The ATR filter can be enabled to reduce insignificant swings. This can be particularly helpful on lower timeframes or during periods of uneven, noisy price movement.
Users can also control whether the structure path is drawn and can adjust the visual typography for labels and HUD elements. These inputs allow the script to stay visually flexible across different chart styles and screen densities.
How this script differs from other AG Pro scripts
This distinction is central to the publication.
Many AG Pro scripts are built to evaluate the quality of a setup. They may score breakouts, retests, continuation patterns, reversal candles, pressure conditions, or confluence states. Others are built around zones and reactions, such as supply-demand mapping, premium-discount logic, fair value gaps, order blocks, or support-resistance behavior. Others focus on structural events such as BOS/CHoCH changes, liquidity sweeps, inducement traps, or session-specific reactions.
This script does none of those things.
It does not measure the quality of a signal.
It does not score a setup.
It does not project targets.
It does not identify fixed daily or weekly reference levels.
It does not try to map every institutional concept on the chart.
It does not attempt to be an all-in-one decision engine.
Instead, it provides a cleaner foundation: confirmed HH, HL, LH, and LL sequencing with a filtered structural path and a compact market-flow summary.
That is precisely why it is different from the previous AG Pro script as well. If the previous release was anchored to fixed price levels, event detection, or context-specific reactions, this script is anchored to swing continuity. If another AG Pro script answers where price reacted, where a sweep occurred, whether a breakout was strong, or whether a setup deserves a quality score, this one answers a more basic but highly important question: what is the confirmed structure chain doing right now?
In that sense, this script is less about trading events and more about structural readability.
Limitations & Transparency
This script uses confirmed pivots, which means it is not attempting to label unconfirmed structure in advance. As a result, there is an intentional delay equal to the confirmation logic chosen by the user. That delay is not a flaw; it is part of the design tradeoff required to avoid premature structure labels.
Like any pivot-based structure tool, output will vary depending on sensitivity settings, timeframe, market volatility, and symbol behavior. A lower sensitivity may reveal more swing detail but can also make the map denser. A higher sensitivity may create a cleaner structure path but may respond more slowly to local shifts.
The ATR filter is a visual-cleanliness tool, not a universal truth engine. It can help reduce noise, but different traders may prefer different levels of structural compression depending on how aggressively or conservatively they define meaningful swings.
This script should also not be interpreted as a complete trading plan. It does not include position sizing, stop placement, target selection, execution logic, or market-specific risk rules. Users should combine it with their own framework, testing process, and judgment.
Risk Disclosure
This script is for analytical and educational use. It is not financial advice, investment advice, or a recommendation to buy or sell any instrument.
Market structure is an interpretive framework, not a guarantee of future price behavior. A bullish sequence can fail, a bearish sequence can reverse, and a clean structural print can still occur inside a broader context that changes the meaning of the move.
Always use independent judgment, apply appropriate risk management, and evaluate the script in the context of your own market, timeframe, and process.
Summary
AG Pro HH HL LH LL Structure Labels is built for traders who value structural clarity over indicator overload. Its role in the AG Pro catalog is distinct: it is not an event hunter, not a zone engine, and not a quality scorer. It is a clean structure reader designed to make confirmed swing progression easier to see, easier to follow, and easier to integrate into a disciplined chart workflow.
If your goal is to understand whether price is still producing constructive highs and lows, whether that chain is weakening, or whether the flow has shifted into a different structural condition, this script is designed for exactly that task.
Indicator

Trading Sessions Suite [BackQuant]Trading Sessions Suite
Overview
Trading Sessions Suite is a full intraday structure framework built around market sessions, kill zones, and session-specific order flow . It transforms the trading day into a sequence of structured regimes, allowing you to track how liquidity, volatility, and positioning evolve across Asia, London, and New York.
Instead of treating price as a continuous stream, this indicator segments the market into time-based auction phases , each with its own:
Range (high and low)
VWAP (fair value)
Open (reference anchor)
Equilibrium (midpoint)
Momentum (session oscillator)
It also overlays kill zones , highlighting the exact windows where volatility and participation tend to expand.
Example of kill zones in action:
Example combining RSI-style oscillator + VWAP structure:
This tool is designed for traders who want to understand how intraday structure builds, shifts, and resolves .
---
Core Philosophy
Markets are not random throughout the day. Liquidity, volatility, and institutional participation are time-dependent .
Each session has distinct characteristics:
Asia → accumulation, compression, range-building
London → expansion, breakout, liquidity grabs
New York → continuation, distribution, reversal potential
Rather than using static indicators, this script builds a dynamic framework tied to these time regimes .
---
Session Engine
The indicator tracks three primary sessions:
Asia Session
London Session
New York Session
Each session is defined by a configurable time window and processed as an independent structure.
Internally, each session maintains a full state:
Session high and low
Session open
Rolling VWAP
Start index (session start)
Drawn objects (box, lines, labels)
Oscillator data (if enabled)
This allows each session to behave like a self-contained market environment .
---
Session Boxes (Auction Structure)
Each session is visualized as a box:
Top = session high
Bottom = session low
Width = duration of the session
This gives you an immediate view of:
Range expansion vs compression
Relative volatility between sessions
Where price is positioned within each session
Interpretation:
Tight box → compression, buildup
Wide box → expansion, active participation
Overlapping boxes → consolidation across sessions
---
Session VWAP (Fair Value per Session)
Each session has its own VWAP:
VWAP = volume-weighted average price within that session only
This is critical because:
VWAP resets every session
Reflects session-specific positioning
Acts as a dynamic equilibrium level
Interpretation:
Price above VWAP → bullish control for that session
Price below VWAP → bearish control
Reversion to VWAP → mean reversion inside session
Unlike standard VWAP, this gives you multiple fair value anchors per day .
---
Session Open & Midline (Key References)
Each session also tracks:
Open Line → where the session started
Midline → (high + low) / 2
These act as:
Bias indicators (above/below open)
Equilibrium zones (midline)
Reaction levels
Typical behavior:
Holding above open → trend continuation
Crossing midline → shift in control
Rejecting midline → continuation signal
---
Range Extension (Forward Liquidity Levels)
When a session closes, its high and low can be extended forward.
These extensions act as:
Future support/resistance
Liquidity targets
Breakout validation zones
Mechanically:
High and low are projected into the next session
Remain until replaced or invalidated
Interpretation:
Next session often trades toward previous session extremes
Breaks of prior session range = regime shift
---
Kill Zones (High-Probability Windows)
Kill zones are specific time windows inside sessions where:
Liquidity spikes
Volatility expands
Institutional activity increases
Included zones:
Asia Kill Zone
London Open Kill Zone
New York Open Kill Zone
New York Close Kill Zone
They are visualized as shaded boxes separate from session boxes.
Why they matter:
Most breakouts occur during kill zones
Most reversals are initiated during kill zones
Liquidity sweeps cluster around these times
From the example:
You can see how price reacts specifically within these windows.
---
Session Oscillator (Embedded Momentum Engine)
Each session optionally includes its own oscillator plotted directly below the session box.
This is not a standard indicator overlay. It is:
Bound to the session range
Scaled relative to that session
Reset each session
Core mechanics:
Uses RSI-style calculation
Signal line = moving average of oscillator
Stored per bar within the session
Displayed as:
A mini panel under each session
With 30 / 50 / 70 reference levels
Example:
Interpretation:
Above 50 → bullish momentum within session
Below 50 → bearish momentum
30/70 → oversold/overbought zones
This gives you contextual momentum , not global momentum.
---
Why Session-Based Oscillators Matter
Standard oscillators ignore time segmentation.
This approach:
Resets momentum every session
Prevents carryover noise
Aligns signals with actual trading windows
So instead of:
“RSI is overbought”
You get:
“RSI is overbought within London session”
This is a much stronger contextual signal.
---
Labels & Range Statistics
Each session can display:
Session name (ASIA, LON, NY)
Range percentage
This helps quantify:
How much the market moved during that session
Which session is dominating volatility
---
Putting It All Together
This indicator gives you a full intraday map:
Where price moved (session boxes)
Where fair value sits (VWAP)
Where equilibrium lies (midline)
Where momentum stands (oscillator)
Where volatility expands (kill zones)
Where liquidity rests (extended highs/lows)
---
How to Use It
1) Identify the current session
Always start with:
Which session is active?
Each session behaves differently.
---
2) Use VWAP + midline for bias
Above VWAP + above mid → strong trend
Below VWAP + below mid → bearish control
Between → range
---
3) Watch kill zones for setups
Breakouts during kill zones are higher probability
Fake moves often occur just before them
---
4) Track previous session levels
Asia high/low often targeted during London
London extremes often targeted during NY
---
5) Use oscillator for confirmation
Momentum aligning with structure → stronger signal
Divergence → potential reversal
---
Strengths
Fully contextual intraday framework
Combines time, price, and volume-weighted logic
Visual and intuitive
Highly configurable
---
Summary
Trading Sessions Suite converts the trading day into a structured sequence of auctions. By combining session ranges, VWAP, kill zones, and a session-specific momentum engine, it provides a complete framework for understanding how price moves throughout the day. Instead of relying on static indicators, it aligns analysis with when liquidity actually enters the market, allowing for more precise timing, better context, and cleaner trade execution. Indicator

Volume Bubble Levels [BackQuant]Volume Bubble Levels
Overview
Volume Bubble Levels is a volume-expansion and liquidity-mapping tool designed to identify statistically significant participation events and project them forward as actionable structural levels.
Instead of treating volume as a secondary confirmation metric, this indicator treats volume spikes as primary events and builds a framework around them:
Detect abnormal volume relative to a rolling baseline.
Classify those events into tiers based on intensity.
Visualize them directly on price using scalable “bubble” markers.
Project their high and low as forward levels (“naked levels”).
Track whether those levels remain untouched, get retested, or are invalidated.
The result is a system that highlights where meaningful participation occurred , and more importantly, whether the market has returned to those areas .
This shifts the focus from “what price did” to “where size traded and what has or hasn’t been revisited since.”
Core idea
Markets move through phases of normal participation and abnormal participation . Most bars are noise. Occasionally, a bar prints with volume significantly above its baseline, indicating:
Aggressive positioning,
Large order execution,
Liquidity events,
Absorption or distribution,
Forced flows (liquidations, stops, news reactions).
These events often leave behind structural footprints.
Volume Bubble Levels captures those footprints and answers:
Where did abnormal participation occur?
How strong was it relative to recent history?
Have those levels been revisited?
Are there still “untouched” zones where liquidity may remain?
Volume baseline and normalization
The first step is establishing what “normal” volume looks like.
The script computes a rolling moving average of volume:
volMa = MA(volume, volMaLen, volMaType)
You can choose the type:
SMA for stable baseline,
EMA for faster adaptation,
RMA for smoother response,
WMA for weighted emphasis on recent bars.
Then the script computes a ratio:
volRatio = volume / volMa
This is the key metric.
Interpretation:
volRatio ≈ 1 → normal participation.
volRatio > 1 → above-average participation.
volRatio >> 1 → abnormal participation.
Everything in the script is built off this ratio.
Tiered volume classification
Instead of treating all volume spikes equally, the script classifies them into three tiers:
Tier 1 — Elevated : moderate expansion above baseline.
Tier 2 — High : strong participation.
Tier 3 — Extreme : major volume event.
Defined as:
Tier 1: volRatio ≥ t1Mult
Tier 2: volRatio ≥ t2Mult
Tier 3: volRatio ≥ t3Mult
Each higher tier overrides the lower:
Tier 3 > Tier 2 > Tier 1
This creates a hierarchy of importance:
Tier 1 = “noticeable”
Tier 2 = “significant”
Tier 3 = “structural”
Directional context (bull vs bear volume)
Each volume event is also classified directionally:
Bull = close ≥ open
Bear = close < open
This matters because:
Bull volume spikes often represent aggressive buying or short covering.
Bear volume spikes often represent aggressive selling or long liquidation.
So every event carries two dimensions:
Magnitude (Tier 1 / 2 / 3)
Direction (bull / bear)
Bubble visualization (what the circles mean)
Volume events are plotted directly on price as circular “bubbles.”
Key properties:
Position: plotted at the closing price of the bar.
Color: determined by tier and direction.
Size: determined by how far the volume exceeds the threshold within its tier.
Size bucketing within tiers
Each tier is subdivided into five size buckets:
Tiny
Small
Normal
Large
Huge
This is done by splitting each tier’s range into equal steps.
Example:
Tier 1 spans from t1Mult → t2Mult.
That range is divided into 5 segments.
Higher volRatio within that tier = larger bubble.
So a large Tier 1 bubble may still be smaller than a small Tier 2 bubble, preserving hierarchy.
What bubbles represent in practice
Each bubble is a localized participation event .
Interpretation:
Cluster of bubbles → sustained participation.
Single large bubble → isolated liquidity event.
Tier 3 bubble → major structural event, often worth tracking.
They are not signals by themselves. They are markers of where something important happened .
Naked levels: projecting volume events forward
The core feature of this script is not the bubbles themselves, but what happens after them.
For every qualifying volume event, the script creates:
A horizontal line at the bar’s high.
A horizontal line at the bar’s low.
These are called naked levels .
Why both high and low:
High captures the upper boundary of the event.
Low captures the lower boundary.
Together, they define the full price range where abnormal volume occurred.
What “naked” means
A level is “naked” if:
Price has not yet traded back through it.
These are important because:
They represent unresolved areas.
Liquidity may still be resting there.
Market participants involved in the original event may still be positioned around that level.
Level lifecycle
1) Creation
On a volume event:
High line and low line are created.
Stored with metadata:
- price
- tier
- direction
- creation bar
2) Extension
Each level extends forward in time:
Updated every bar.
Projected to the right until resolved.
3) Takeout (resolution)
A level is considered “taken” when price trades through it:
High level taken when: high > level price
Low level taken when: low < level price
Once taken:
The line is terminated.
Removed from active tracking.
4) Expiry
Levels also expire after a fixed number of bars:
If (current bar - birth bar) > extendBars → level is removed.
This prevents infinite clutter and ensures relevance.
Why naked levels matter
These levels act like:
Liquidity magnets,
Revisit zones,
Areas of unfinished business.
In practice:
Price often returns to high-volume zones.
Untouched levels can act as targets.
Revisits can trigger reactions, pauses, or reversals.
This aligns with auction market theory:
Markets seek to revisit areas of high participation.
Unfinished auctions tend to get completed.
Tier-aware level significance
Not all levels are equal:
Tier 1 levels = weaker, more frequent.
Tier 2 levels = meaningful.
Tier 3 levels = major structural zones.
The script reflects this visually:
Tier 3 lines are thicker.
Colors differ by tier and direction.
So you can quickly identify:
Which levels matter most.
Color system
Each tier has separate bull/bear colors.
This allows:
Bullish volume zones vs bearish volume zones.
Visual distinction between accumulation-type and distribution-type activity.
Because:
A high-volume bullish bar and a high-volume bearish bar represent very different order flow contexts.
Line styling
You can choose:
Dotted
Dashed
Solid
This does not affect logic, only readability.
What this indicator is NOT
It is important to understand what this tool is not doing:
It is not a volume profile.
It does not aggregate volume by price level.
It does not measure cumulative delta.
It does not predict direction directly.
Instead, it is:
Event-based , not distribution-based.
Forward-projecting , not historical summarizing.
Structure-focused , not signal-focused.
How to use it
1) Identify important zones
Focus on:
Tier 2 and Tier 3 bubbles.
Clusters of bubbles.
These represent areas of significant participation.
2) Track naked levels
Watch:
Untouched levels ahead of price.
Levels near current price.
These often act as:
Targets,
Reaction zones,
Liquidity pools.
3) Watch level interactions
When price approaches a level:
Rejection → confirms level relevance.
Clean break → invalidates it.
Chop around level → absorption.
4) Combine with structure
This tool works best with:
Trend context,
Support/resistance,
Market structure,
Other flow indicators.
Example interpretations
Scenario 1: Strong bullish bubble cluster
Multiple Tier 2–3 bullish bubbles form.
Price moves away without revisiting.
Interpretation:
Strong accumulation zone.
Untouched lows may act as future support or targets.
Scenario 2: Price returns to naked level
Price revisits a previously untested level.
Interpretation:
Liquidity is being re-engaged.
Potential reaction point.
Scenario 3: Level invalidation
Price blows through a level with strong continuation.
Interpretation:
That level no longer holds structural significance.
Market has repriced beyond that participation zone.
Strengths
Highlights meaningful participation events.
Projects actionable forward levels.
Separates noise from structural volume.
Works across assets and timeframes.
Limitations
Depends on volume quality (less reliable on low-liquidity assets).
Does not indicate direction by itself.
Can produce many levels in volatile environments.
Requires interpretation, not plug-and-play signals.
Summary
Volume Bubble Levels transforms abnormal volume events into forward-projected structural levels. By measuring volume relative to its own baseline, classifying it into tiers, and projecting both the high and low of those events, the indicator builds a dynamic map of where meaningful participation occurred and whether those areas remain unresolved. The bubbles highlight the event, but the real value comes from the naked levels, which act as evolving liquidity zones that can influence future price behavior. Indicator

Exponential Hull Momentum [BackQuant]Exponential Hull Momentum
Overview
Exponential Hull Momentum is a normalized momentum oscillator built from an Exponential Hull Moving Average -style transformation. Its purpose is to measure whether smoothed directional pressure is pushing toward the upper or lower end of its own recent range, while keeping the response faster and cleaner than a plain moving-average oscillator.
At a high level, the script does three things:
Builds a fast, low-lag smoothed series using an Exponential Hull-style calculation.
Normalizes that series against its own rolling high-low range so the output fits into a bounded oscillator-style scale centered around zero.
Optionally smooths the oscillator with a selectable moving average so you can use a secondary signal line or regime filter.
The final result is an oscillator that tries to answer:
Is momentum pushing toward the strong positive end of its recent range?
Is momentum collapsing toward the negative end?
Is the current move still expanding, or is it rolling over relative to its own smoothed state?
What this indicator is actually measuring
This indicator is not measuring raw returns, not measuring RSI-style up/down closes, and not measuring volatility. It is measuring the position of a low-lag smoothed price transform within its own recent rolling range .
That distinction matters.
It means:
Positive values indicate the Exponential Hull series is in the upper half of its recent normalized range.
Negative values indicate it is in the lower half of its recent normalized range.
Extreme positive values suggest strong upward momentum persistence.
Extreme negative values suggest strong downward momentum persistence.
Because it is normalized, the oscillator is less about absolute price level and more about relative momentum state .
Where the “Hull” idea comes from
The Hull Moving Average family exists to solve a classic moving-average problem:
If you smooth more, you reduce noise but increase lag.
If you smooth less, you reduce lag but increase noise.
Alan Hull’s core idea was to combine moving averages in a way that compensates for lag before applying a final smoothing stage. The classic HMA uses weighted moving averages. This script uses the same structural idea, but with EMAs instead , producing an Exponential Hull-style moving average .
So instead of a classic HMA, the script constructs:
A fast EMA on half-length input.
A slower EMA on full-length input.
A lag-compensated intermediate value using 2 * fast - slow.
A final EMA smoothing pass using sqrt(length).
This is why it is called Exponential Hull Momentum . The “Hull” part refers to the lag-reduction structure, the “Exponential” part comes from using EMA instead of WMA.
The EHMA calculation step by step
The core function is:
EHMA(_src, _length) =
EMA( 2 * EMA(_src, _length / 2) - EMA(_src, _length), round(sqrt(_length)) )
Let’s break that down.
1) Fast EMA on half length
EMA(_src, _length / 2)
This reacts quickly to recent price changes.
2) Slow EMA on full length
EMA(_src, _length)
This is smoother and more delayed.
3) Lag compensation
2 * fastEMA - slowEMA
This is the critical step. It pushes the result toward the faster average while subtracting part of the slower lagging component. Conceptually, it behaves like a “de-lagged” smoother. It is related in spirit to reduced-lag constructions like DEMA and TEMA, though implemented in a Hull-style framework.
4) Final smoothing
EMA(lag_compensated_series, sqrt(length))
This final pass cleans up the compensated series so it remains usable as a smooth momentum engine rather than a noisy de-lagged line.
So the oscillator’s underlying subject is not raw price, but this EHMA subject series .
Why use EHMA instead of a plain EMA or raw price
A raw price oscillator is often too noisy. A plain EMA oscillator is smoother, but can still lag too much. EHMA tries to balance:
Faster reaction than a standard EMA.
Cleaner shape than a raw de-lagged transform.
More sensitivity to directional bursts.
That makes it useful for momentum work, especially when you want:
Earlier momentum regime shifts.
Cleaner trend-state transitions.
A bounded oscillator rather than an overlay line.
Normalization: turning the EHMA into an oscillator
After computing the EHMA subject, the script normalizes it using its own rolling lowest and highest values over a user-defined normalization period:
lowest = lowest(subject, norm_period)
highest = highest(subject, norm_period)
plotosc = (subject - lowest) / (highest - lowest) - 0.50
This transforms the EHMA series into a bounded range centered around zero.
Interpretation:
If subject is near the rolling highest, plotosc approaches +0.5.
If subject is near the rolling lowest, plotosc approaches -0.5.
If subject is near the middle of the rolling range, plotosc is near 0.
So the oscillator is essentially:
Where is the current EHMA value sitting within its recent high-low envelope?
Why normalization matters
Without normalization, the EHMA value itself would still be in price units, which makes comparison harder across:
Different assets,
Different timeframes,
Different price regimes.
Normalization gives you a common scale:
-0.5 to +0.5, centered at 0
That makes the output much easier to use as a momentum state tool.
What the oscillator values mean
Near +0.5
The EHMA subject is pressing against the upper end of its rolling range. This usually means:
Strong bullish momentum,
Persistent upward movement in the smoothed series,
A possible “stretched” positive momentum condition.
Near -0.5
The EHMA subject is pressing against the lower end of its rolling range. This usually means:
Strong bearish momentum,
Persistent downward movement,
A possible stretched downside state.
Near 0
The EHMA subject is near the midpoint of its recent range. This can mean:
Momentum is neutral,
Momentum is transitioning,
The market is compressing or chopping relative to recent structure.
Important nuance about the oscillator scale
This is not a z-score . It is not measuring “standard deviations from mean.” It is a min-max style range normalization . That means:
The output depends on the recent highest and lowest subject values.
If the rolling range changes sharply, oscillator sensitivity can change too.
The same oscillator value does not imply the same statistical rarity across all contexts.
It is best read as a relative range-position momentum oscillator , not as a probabilistic metric.
Signal line / moving average layer
The script optionally applies a second smoothing layer directly to the oscillator:
sig_ma = MA(plotosc, malen, matype)
You can choose from many MA types:
SMA
EMA
DEMA
TEMA
RMA
WMA
HMA
T3
ALMA
LINREG
VWMA
This signal line is not required for the core oscillator to work. It is a secondary interpretation layer that can be used for:
Momentum confirmation,
Cross-based entry logic,
Smoothing out the oscillator for regime filtering,
Visual comparison between raw momentum and smoothed momentum.
The script note suggests that if you want to use the MA more like a signal histogram, you can change its style to columns in the style menu.
Why a selectable MA matters
Different traders want different signal characteristics:
SMA/EMA for classic smoothing,
DEMA/TEMA for lower lag,
HMA/T3/ALMA for smoother trend-state filtering,
LINREG for slope-sensitive behavior,
VWMA if you want volume-weighted smoothing.
This makes the indicator more flexible without changing the core EHMA oscillator.
Color gradient logic
The oscillator columns are colored using thresholded intensity zones rather than a continuous gradient function. The color changes as the oscillator moves further away from zero.
For positive values:
Weak positive: lighter cyan/green tones.
Moderate positive: stronger green.
Strong positive: bright green.
Extreme positive near +0.5: intense bright green.
For negative values:
Weak negative: orange/red tint.
Moderate negative: deeper red.
Strong negative: bright red.
Extreme negative near -0.5: intense red.
This means the plot does two jobs at once:
Direction from sign,
Relative momentum intensity from color saturation.
So even without reading the value numerically, you can see whether momentum is:
Barely positive,
Strongly positive,
Barely negative,
Or deeply negative.
Static levels and what they mean
The script draws fixed zones:
+0.5 and +0.4
-0.4 and -0.5
0 midline
These create:
An upper “overbought / strong positive momentum” zone from 0.4 to 0.5
A lower “oversold / strong negative momentum” zone from -0.4 to -0.5
A midline at 0 separating positive from negative momentum territory
Important:
These are momentum extreme zones , not traditional RSI overbought/oversold zones.
Strong trends can stay pinned near +0.5 or -0.5 for long periods.
Extreme readings do not automatically mean reversal.
The fill between the upper and lower static boundaries just makes those zones easier to identify visually.
Midline logic
The zero line is the most important structural level in the oscillator:
Above 0 = EHMA is in the upper half of its recent range, positive momentum regime.
Below 0 = EHMA is in the lower half of its recent range, negative momentum regime.
The alert conditions are built on this exact logic:
Long alert on crossover above 0
Short alert on crossunder below 0
So the core directional interpretation is midline-based.
How to interpret the indicator in practice
1) Momentum regime
The cleanest use is as a regime filter:
Above 0: positive momentum bias.
Below 0: negative momentum bias.
This alone can already be useful for:
Filtering entries,
Avoiding countertrend setups,
Aligning with the dominant smoothed momentum state.
2) Momentum intensity
The closer the oscillator moves toward +0.5 or -0.5, the stronger the recent momentum relative to its own normalized range.
This can help distinguish:
Weak trend drift,
Healthy trend continuation,
Momentum surge / expansion,
Potential exhaustion zones.
3) Transition behavior
Watch how the oscillator behaves around 0:
Fast thrust through 0 often signals a fresh momentum shift.
Repeated chop around 0 often signals indecision or sideways conditions.
A flattening oscillator after an extreme reading often shows momentum deterioration before price fully turns.
4) Using the moving average signal
If enabled, the MA of the oscillator can help identify:
When raw momentum is accelerating away from smoothed momentum,
When momentum is rolling over,
Whether the oscillator move is broad and sustained or only a short burst.
A common interpretation:
Oscillator above signal MA and above zero = strong bullish momentum structure.
Oscillator below signal MA and below zero = strong bearish momentum structure.
Divergence between oscillator and signal MA = momentum fading or transitioning.
What makes this different from RSI or stochastic-style oscillators
This script is structurally different from standard oscillators.
Compared to RSI
RSI is based on the ratio of average up closes to down closes. It measures directional internal strength of return behavior.
EHMA Momentum instead:
Starts from a low-lag smoothed price transform,
Then asks where that transform sits in its recent range.
So it is more “structure-relative momentum” than “up/down return balance.”
Compared to Stochastic
Stochastic asks where price closes relative to recent high-low range.
EHMA Momentum asks where the EHMA-smoothed subject sits relative to its own recent subject range.
That means:
It is less raw than stochastic,
More smoothed,
Potentially less noisy,
And more focused on directional structure than candle location.
Parameter behavior
Exponential Hull Calculation Period (len)
Controls how the EHMA subject is built.
Very low values make the subject extremely reactive.
Higher values smooth the subject more and reduce sensitivity.
Since the default is very small, this script is designed to be sharp and responsive by nature.
Normalization Period (norm_period)
Controls the rolling high-low range used to normalize the subject.
Higher values create a broader historical range and smoother normalization.
Lower values make the oscillator adapt faster, but it can become more jumpy and “range-reset” more often.
Signal MA Period and Type
Controls how smooth the optional secondary line is.
Shorter MA = faster cross behavior.
Longer MA = slower, steadier confirmation.
Strengths of this approach
Fast response because of the Exponential Hull construction.
Easy interpretation because of bounded normalized output.
Works well as a regime filter via the zero line.
Intensity is visually clear from both height and color.
Flexible because of optional multi-type signal smoothing.
Limitations and what to watch for
Because the oscillator is min-max normalized, extreme values can persist in strong trends.
A rolling highest/lowest normalization can make the oscillator “reset” as old extremes leave the window.
On very low lengths, the EHMA can become highly reactive and potentially noisy.
Zero-line crosses can whipsaw in sideways markets, especially if normalization is too short.
So this tool is best used with context:
Trend structure,
Market regime,
Higher timeframe bias,
Or combined with the signal MA and price action.
Summary
Exponential Hull Momentum is a normalized momentum oscillator built from an EMA-based Hull-style smoothing engine. It first creates a low-lag Exponential Hull series, then normalizes that series within its own rolling high-low range so the output oscillates around zero between roughly -0.5 and +0.5. Positive values indicate the EHMA subject is pressing into the upper half of its recent range, negative values indicate the lower half, and the distance from zero reflects relative momentum strength. Static zones highlight extreme positive and negative momentum states, while an optional multi-type moving average can be used as a secondary signal or smoothing layer. Indicator

Gamma Exposure Levels [BackQuant]Gamma Exposure Levels
This indicator allows you to paste Gamma Exposure (GEX) level data directly into a text input on PulseWire, automatically parsing the values and plotting them as labeled horizontal lines on your chart. It is designed for traders who use options-derived gamma exposure data as part of their technical analysis and want a fast, visual way to overlay those key price levels onto any chart and timeframe.
Rather than manually drawing lines for each level, this script reads a structured block of GEX output text, extracts every relevant dollar value, and draws color-coded, labeled levels across your chart. If two or more levels share the same price, their labels are automatically merged (for example, "Max Pain / Call Res $75,000") so the chart stays clean and readable.
What is Gamma Exposure (GEX)?
Gamma Exposure refers to the aggregate gamma held by options market makers (dealers) at each strike price. Gamma measures how much a dealer's delta (directional hedge) changes as the underlying price moves. When dealers hold large gamma positions, they must continuously hedge by buying or selling the underlying asset, which can either dampen or amplify price movement depending on the sign of that gamma.
When dealers are long gamma (positive GEX), they hedge against the prevailing trend: buying dips and selling rallies. This creates a stabilizing, mean-reverting effect around high-gamma strikes, making those levels act like magnets or support/resistance zones.
When dealers are short gamma (negative GEX), they hedge in the same direction as the move: selling into drops and buying into rallies. This amplifies volatility and can cause sharp, directional moves once a key gamma level breaks.
Understanding where these gamma levels sit gives traders a structural map of where options market makers are likely to add liquidity or accelerate a move.
How to Use This Indicator
Add the indicator to your chart.
Open the indicator settings and find the "Data Input" group at the top.
Paste your full GEX levels output into the text area. The indicator expects a structured text format (see the example format below).
The indicator will automatically parse all dollar values from the text and plot them as horizontal lines with labels.
Use the toggle checkboxes next to each level type to show or hide individual levels.
Customize colors, line style, line width, label size, label offset, and label position from the settings panel.
Expected Input Format
The indicator parses structured GEX output text. Below is an example of the expected format. Copy and paste a block like this directly into the text area input in the indicator settings:
GEX Levels - 04/03/2026, 12:17:19
All-Expiry Levels:
HVL: $72,000 +$1,841 (+2.62%)
Call Resistance: $75,000 +$4,841 (+6.90%)
Put Support: $60,000 $-10,159 (-14.48%)
0DTE Levels:
0DTE HVL: $68,000 $-2,159 (-3.08%)
0DTE Call: $71,000 +$841 (+1.20%)
0DTE Put: $66,000 $-4,159 (-5.93%)
Advanced:
Zero Gamma: $71,819 +$1,660 (+2.37%)
Max Pain: $74,000 +$3,841 (+5.47%)
Expected Move: $64,238 to $76,081
Flip Zones (All): $67,500
All-Expiry GEX Top 10 (by |gamma|):
1. $60,000 $-10,159 (-14.48%) | GEX: -20,711,741.86
2. $75,000 +$4,841 (+6.90%) | GEX: 18,876,578.2
3. $72,000 +$1,841 (+2.62%) | GEX: 17,530,960.01
4. $70,000 $-159 (-0.23%) | GEX: 17,494,795.02
5. $74,000 +$3,841 (+5.47%) | GEX: 13,573,146.08
6. $73,000 +$2,841 (+4.05%) | GEX: 10,380,107.7
7. $69,000 $-1,159 (-1.65%) | GEX: 10,341,883.98
8. $80,000 +$9,841 (+14.03%) | GEX: 8,636,674.83
9. $71,000 +$841 (+1.20%) | GEX: 7,962,084.65
10. $65,000 $-5,159 (-7.35%) | GEX: -7,257,124.01
0DTE GEX Top 10 (by |gamma|):
1. $69,500 $-659 (-0.94%) | GEX: 3,659,702.74
2. $70,500 +$341 (+0.49%) | GEX: 1,152,595.15
3. $69,000 $-1,159 (-1.65%) | GEX: 703,339.82
4. $72,000 +$1,841 (+2.62%) | GEX: 697,625.91
5. $73,000 +$2,841 (+4.05%) | GEX: 419,096.08
6. $68,000 $-2,159 (-3.08%) | GEX: 294,575.89
7. $74,000 +$3,841 (+5.47%) | GEX: 281,083.42
8. $75,000 +$4,841 (+6.90%) | GEX: 183,191.05
9. $66,000 $-4,159 (-5.93%) | GEX: -172,470.38
10. $68,500 $-1,659 (-2.37%) | GEX: 167,135.87
The indicator only extracts the dollar values from this text. The percentage changes, GEX magnitude values, and other metadata are informational context in the source data but are not plotted by this script.
Level Definitions
Below is a detailed explanation of every level this indicator can parse and plot. These are grouped the same way they appear in the indicator settings.
All-Expiry Levels
These levels are derived from gamma exposure aggregated across all option expiration dates.
HVL (High Volume Level) - The price with the highest total gamma exposure across all expirations. This is the strike where dealers hold the most aggregate gamma and therefore where hedging activity is most concentrated. Price tends to gravitate toward the HVL in positive gamma environments because dealer hedging creates a mean-reverting effect around this level. Think of it as the "center of gravity" for options-driven price action.
Call Resistance - The price level where call-side gamma creates overhead resistance. At this strike, the concentration of call gamma means that as price rises toward it, dealers who are long those calls must sell the underlying to stay delta-neutral. This selling pressure acts as a ceiling, making it harder for price to push through. Breaks above call resistance can signal a shift in positioning or the start of a gamma squeeze.
Put Support - The price level where put-side gamma creates downside support. At this strike, the concentration of put gamma means that as price falls toward it, dealers must buy the underlying to hedge. This buying pressure acts as a floor, cushioning the decline. A break below put support can accelerate selling as dealers flip from buying to selling, potentially triggering a sharp move lower.
0DTE Levels
These levels are derived exclusively from same-day (zero days to expiration) options. Because 0DTE options have extremely high gamma due to their proximity to expiration, they can dominate intraday price action even when their notional size is smaller than longer-dated positions.
0DTE HVL - The same-day high volume level. This is the intraday gamma center of gravity derived solely from options expiring today. It represents the strike where 0DTE dealer hedging is most concentrated and where intraday gamma polarity can flip. Particularly relevant for intraday traders, as 0DTE gamma effects intensify throughout the trading session and peak in the final hours before expiration.
0DTE Call - Same-day call resistance. The intraday ceiling created by 0DTE call gamma. Dealer hedging against these expiring calls creates selling pressure as price approaches this level. Because 0DTE gamma decays rapidly, this level can shift during the session and its strength increases as expiration approaches.
0DTE Put - Same-day put support. The intraday floor created by 0DTE put gamma. Dealer hedging against expiring puts creates buying pressure at this level. Like the 0DTE call level, its influence grows as the trading day progresses and gamma effects intensify near the close.
Advanced Levels
These levels provide additional structural context beyond the core support, resistance, and HVL framework.
Zero Gamma - The precise price where cumulative gamma across all strikes and expirations equals zero. This is one of the most important structural levels in gamma analysis. Above the Zero Gamma level, dealers are net long gamma and their hedging stabilizes price (buying dips, selling rallies). Below it, dealers are net short gamma and their hedging amplifies moves (selling into drops, buying into rallies). Crossing the Zero Gamma level often marks a regime change in how the market behaves, shifting from mean-reversion to trend-following dynamics.
Max Pain - The strike price at which the total value of all outstanding options (both calls and puts) would be minimized if the underlying expired at that price. In other words, it is the price where option holders collectively lose the most money. Max Pain theory suggests that there is a gravitational pull toward this level as expiration approaches, driven by dealers and market makers who benefit from options expiring worthless. It is most relevant in the final days before a major expiration.
Expected Move - The 1-sigma (one standard deviation) expected price range, plotted as two levels: Expected Move Upper and Expected Move Lower. This range represents the statistically expected boundaries of price movement based on current implied volatility. Roughly 68% of the time, price is expected to remain within this range. These levels help traders gauge whether the current price action is within normal bounds or represents an unusual move. A break beyond the expected move range can signal a volatility event or a shift in market regime.
Flip Zones - All price levels where gamma polarity changes sign. At these strikes, dealer hedging behavior transitions from stabilizing (long gamma) to destabilizing (short gamma) or vice versa. Flip zones act as transition boundaries. When price crosses a flip zone, the nature of dealer activity changes, which can lead to shifts in volatility, momentum, and the tendency for price to mean-revert or trend. Multiple flip zones in a narrow range can create a "no man's land" where positioning is mixed and price action becomes choppy.
GEX Top 10
The GEX Top 10 are the ten strike prices with the highest absolute gamma exposure, ranked by the magnitude of their gamma (|gamma|). These represent the strikes where dealer hedging activity is most significant, regardless of whether the gamma is positive (call-dominated, stabilizing) or negative (put-dominated, destabilizing).
The indicator provides a dropdown selector with five options for the GEX Top 10:
None - Do not plot any GEX Top 10 levels.
0DTE - Plot the Top 10 from same-day (0DTE) options only. Best for intraday analysis.
All Expiries - Plot the Top 10 from all expiration dates combined. Best for swing or multi-day analysis.
0DTE 1-5 - Plot only the top 5 from 0DTE options. Useful for reducing chart clutter while keeping the most significant intraday levels.
All Expiries 1-5 - Plot only the top 5 from all expiration dates. Useful for a cleaner multi-day view.
Each of the 10 GEX levels (GEX #1 through GEX #10) has its own individual toggle and color picker, so you can show or hide any specific rank and assign distinct colors to differentiate them.
Overlap Handling
It is common for multiple GEX levels to land on the same price. For example, Max Pain and Call Resistance might both be at $75,000, or a GEX Top 10 strike might coincide with the HVL. Rather than drawing overlapping lines and labels that clutter the chart, this indicator automatically detects when two or more levels share the same price (within a $0.50 tolerance). When a match is found, only one line is drawn at that price and the labels are merged with a "/" separator.
For example, if Max Pain is $75,000 and Call Resistance is also $75,000, the chart will show a single line labeled:
Max Pain / Call Res 75000
This keeps the chart clean and makes it immediately obvious when multiple structural levels converge at the same price, which often signals a particularly significant level.
Customization Options
The indicator provides extensive customization through its settings panel:
Per-Level Controls
Each level type has its own color picker and show/hide toggle on the same line.
GEX Top 10 levels (#1 through #10) each have individual color pickers and toggles.
A dropdown selector lets you choose which GEX Top 10 dataset to plot (0DTE, All Expiries, top 5 only, or none).
Line Style
Line Width: 1 to 4 pixels.
Line Style: Solid, Dashed, or Dotted.
Extend Lines: Both directions, Right only, Left only, or None.
Label Settings
Label Size: Tiny, Small, Normal, Large, or Huge.
Label Offset: Position the labels any number of bars to the right or left of the current bar (-200 to 500).
Label Side: Place labels on the Right or Left side of the chart.
Every toggle and input has a descriptive tooltip that appears on hover, explaining what the level represents and how it is used.
How the Parsing Works
The script uses Pine Script v6 string functions to scan the pasted text for known keywords (such as "HVL:", "Call Resistance:", "0DTE Call:", "Zero Gamma:", "Expected Move:", "Flip Zones:", etc.). For each keyword found, it locates the next "$" character and extracts the numeric value that follows, correctly handling both comma-separated thousands (e.g., $72,000) and decimal values (e.g., $71,819.50).
For the Expected Move, it parses both the lower and upper bounds from the "to" separator (e.g., "$64,238 to $76,081").
For Flip Zones, it scans for every "$" on the line and extracts each value, correctly distinguishing thousands-separator commas from delimiter commas between multiple zone values.
For the GEX Top 10 sections, it identifies the section header ("All-Expiry GEX Top 10" or "0DTE GEX Top 10") and parses the first dollar value from each numbered line, stopping when it hits a new section header or separator.
The indicator only draws on the last bar and uses a delete-and-redraw system to ensure that only one clean set of lines and labels exists at any time. Old drawings are removed before new ones are created on each update.
Important Notes
This indicator does not generate or calculate GEX data. It is a visualization tool that plots externally sourced gamma exposure levels onto your PulseWire chart.
The indicator requires you to paste GEX data in the expected structured text format. If the text area is empty, nothing will be plotted.
GEX data is a snapshot in time. Options positioning changes throughout the trading day as new trades are opened and closed. Levels should be updated periodically for the most accurate representation of current dealer positioning.
GEX levels are not guaranteed support or resistance. They represent areas where dealer hedging activity is concentrated, which can influence price behavior but does not determine it. Always use GEX data as one component of a broader analysis framework.
Indicator

Indicator

Trend Velocity Channel [BackQuant]Trend Velocity Channel
Overview
Trend Velocity Channel is a trend and momentum-acceleration overlay built around one idea, trend strength is the gap between a fast “lead” average and a slow “lag” average . When the lead line pulls away from the lag line, the market is accelerating in that direction. When that gap collapses, trend energy is fading and reversals become more likely.
Instead of using a single moving average slope or crossover, this indicator measures:
A leading trend line (DEMA) that reacts quickly.
A lagging trend line (slower EMA) that represents slower consensus value.
A normalized “velocity / crush” metric: the distance between them in ATR units .
A trend regime based on the sign of that velocity.
A dynamic channel defined by the lead line on one side and a padded lag boundary on the other.
A reversal level engine that marks flip bars and tracks retests and invalidations.
The result is a channel that visually answers:
Are we accelerating or decelerating?
How strong is the current acceleration relative to recent history?
Where is the “danger edge” where a reversal would be confirmed?
Which flip levels remain relevant and which got invalidated?
Concept: lead vs lag as a proxy for trend velocity
Markets trend when price doesn’t just move, it keeps moving faster than the slow baseline can follow . If a fast estimator (lead) separates from a slow estimator (lag), that separation is a practical proxy for “velocity”:
Lead above lag, bullish acceleration.
Lead below lag, bearish acceleration.
Lead converging back into lag, trend energy compressing.
This script calls that separation Crush , meaning the lead line is “crushing away” from the lag line.
Core components
1) Leading line: DEMA
The lead line is a Double Exponential Moving Average:
dema = DEMA(price, maLen)
Why DEMA:
It reduces lag relative to a standard EMA.
It reacts faster to genuine directional moves.
It still smooths noise enough to act as a structural line.
DEMA is used as the “inner” channel edge and the glow anchor.
2) Lagging line: Slow EMA
The lag line is a slower EMA:
lagMA = EMA(price, round(maLen * 1.5))
Why a slower EMA:
It represents a slower-moving consensus baseline.
It creates a meaningful “gap” against the lead line.
It is less sensitive to micro-chop, so separation signals are cleaner.
The lag line also becomes the basis for the channel’s outer edge.
3) Volatility normalization: ATR
Raw MA distance is not comparable across regimes. A 50-point gap might be huge in a low-vol market and nothing in a high-vol market. So the gap is normalized by ATR:
atr = ATR(14)
rawCrush = (dema - lagMA) / atr
Interpretation:
rawCrush = “how many ATRs the lead line is away from the lag line.”
This standardizes the signal across instruments and volatility states.
4) Crush smoothing
The gap can still jitter, especially in choppy markets. So it is EMA-smoothed:
crush = EMA(rawCrush, crushSmth)
Lower crushSmth:
Faster regime flips, more noise.
Higher crushSmth:
More stable regimes, slower reaction.
Trend regime and flips
Trend direction is derived directly from the sign of the smoothed crush:
trend = crush > 0 ? +1 : -1
flip = trend != trend
Meaning:
Bull regime: lead (DEMA) is above lag baseline in ATR units.
Bear regime: lead is below lag baseline.
Flip: the velocity sign changed, meaning acceleration has switched direction.
This is not a price crossover system, it is a lead-lag separation regime system .
Measuring strength: crushNorm
The script also grades how extreme current crush is relative to recent conditions:
crushAbs = abs(crush)
crushHigh = highest(crushAbs, 80)
crushNorm = crushHigh > 0 ? min(crushAbs / crushHigh, 1) : 0
Interpretation:
crushNorm near 0 means separation is small relative to recent extremes, trend is weak or compressing.
crushNorm near 1 means separation is near the largest seen recently, trend acceleration is strong.
This strength scale drives:
Color intensity (gradient)
Glow width
“Peak Crush” alert condition
Channel construction
Inner edge
The inner edge is the leading line:
inner = dema
This is the “fast structure” of the move.
Outer edge
The outer edge is built from the lag line plus an ATR padding:
outer = (bull) lagMA - atr * chanPad
outer = (bear) lagMA + atr * chanPad
This is important. The lag line sits behind price, so the script offsets it outward by a user-defined fraction of ATR. This creates a more realistic boundary that accounts for volatility.
Interpretation:
In bull regimes, the outer boundary is below lagMA, creating a support-like corridor beneath price.
In bear regimes, the outer boundary is above lagMA, creating a resistance-like corridor above price.
The channel is intentionally asymmetric
This channel is not “± ATR around a mean.” It is directional:
Inner edge hugs price via fast DEMA.
Outer edge is anchored to lagMA and padded outward.
So it behaves like a trend corridor where:
The inner edge shows where the trend is currently “being pulled.”
The outer edge shows the boundary where the trend would be meaningfully compromised if crossed.
Ribbon fill (3-layer depth)
Two midpoints are created between inner and outer:
mid1 = inner + (outer - inner) * 0.33
mid2 = inner + (outer - inner) * 0.66
Then the fill is layered:
inner → mid1 (most opaque)
mid1 → mid2
mid2 → outer (most transparent)
This creates a depth effect that visually communicates where price is sitting within the corridor. When the corridor is tight and strong, the ribbon looks concentrated. When it expands, the ribbon spreads and fades.
Color logic (trend + strength)
The indicator uses a gradient color where direction sets the palette and crushNorm sets intensity:
Bull: faint green → strong green as crushNorm increases
Bear: faint red → strong red as crushNorm increases
This means you can read two things instantly:
Direction (bull vs bear)
Acceleration strength (faded vs intense)
Glow engine on DEMA
Glow width scales with ATR and crushNorm:
glowW = atr * 0.07 * (0.5 + crushNorm)
So:
High acceleration = larger glow, more “energy” around the lead line.
Low acceleration = smaller glow.
Glow is built as multiple invisible plots above and below DEMA with layered fills, forming a halo around the lead line that encodes strength.
Flip-aware band breaking
The outer boundary line is broken on flips:
bandBrk = flip ? na : outer
plot(..., plot.style_linebr)
This prevents a misleading continuous line across regime changes, since the outer edge swaps sides on flip.
Crush reversal levels (flip levels engine)
This script includes a level system that plants a dashed horizontal level on every regime flip, then tracks:
Whether price retests it (first touch marker)
Whether price invalidates it (deletes it)
How long it extends forward
How many levels are kept
1) Level placement
On a flip:
If trend flips bullish, the level is placed at the flip bar’s low.
If trend flips bearish, the level is placed at the flip bar’s high.
That makes sense structurally:
Bull flip low is a “pivot low” candidate.
Bear flip high is a “pivot high” candidate.
Then a dashed line is drawn forward ~60 bars.
2) Level storage and maxLvls
Levels are stored in an array and capped by maxLvls. When the cap is exceeded, the oldest is deleted. This keeps the chart readable.
3) Level invalidation (broken logic)
Each level is monitored:
Bull flip level breaks if price closes far below it: close < level - atr * 2.5
Bear flip level breaks if price closes far above it: close > level + atr * 2.5
This is a volatility-scaled invalidation. If price pushes through a flip level by a large margin in ATR terms, it’s no longer acting like a meaningful reaction point.
4) Retest detection
A “touch” is detected when:
close is within 0.25 ATR of the level,
and close two bars ago was not close (distance > 0.5 ATR),
and the level hasn’t been marked retested yet.
On first retest, an “x” marker is printed and the level’s retested flag is set to true so it won’t spam.
What these levels represent
They are not generic support/resistance. They are regime pivot levels created by a change in lead-lag acceleration. In practice:
Untested flip levels can act like “memory zones” where price may react.
Retested levels become less special, still relevant but not “naked.”
Invalidated levels are removed to reduce noise.
Signals and alerts
The script provides:
Crush Bull: flip into bullish regime (crush crosses above 0 via smoothing logic)
Crush Bear: flip into bearish regime
Peak Crush: crushNorm > 0.85, meaning separation is near recent max, strong acceleration
Important: Peak Crush is not a reversal call. It flags strong trend energy. That can precede continuation or exhaustion, you use it as context, not a standalone trade trigger.
How to use it
Trend following framework
Stay aligned with the regime color.
In bull regime, treat the outer boundary as the “structure floor.”
In bear regime, treat the outer boundary as the “structure ceiling.”
The inner DEMA is your fast guide, the outer edge is your compromise boundary.
Acceleration read
Increasing color intensity and thicker glow imply acceleration is strengthening.
Fading color and shrinking glow imply acceleration is decaying and the move is losing energy.
A regime flip is a clean state change, not a micro-signal.
Using reversal levels
Treat naked flip levels as potential reaction zones.
Watch first retest behavior, clean rejection suggests the flip level is holding.
If the level invalidates by 2.5 ATR, it’s removed because structure has been overwritten.
Key inputs explained
MA Length (maLen)
Sets both the lead line length and the lag line length (scaled by 1.5). Lower values:
More sensitive, more flips.
Higher values:
Smoother, fewer flips, slower response.
Crush Smoothing (crushSmth)
Controls stability of the velocity signal. Lower:
Fast flips, noisier regime.
Higher:
More confirmation, later flips.
Channel Padding (chanPad)
Controls how much extra ATR space is added beyond lagMA. Higher padding:
Wider channel, fewer boundary touches.
Lower padding:
Tighter boundary, more reactive “risk edge.”
Max Levels
Controls how many historical flip levels are retained.
Summary
Trend Velocity Channel treats trend as lead-lag separation expressed in ATR units. A fast DEMA tracks the active move, a slower EMA defines baseline value, and their normalized gap (Crush) defines both direction and acceleration strength . That strength drives an adaptive visual language (gradient color, glow width, ribbon depth). The channel itself is directional, with the lead line as the inner edge and a volatility-padded lag boundary as the outer edge, acting as a structural “compromise line.” On every regime flip the script plants a pivot level, tracks retests, and deletes invalidated levels, giving you a clean map of acceleration-based reversal zones. Indicator

Indicator

VTS Strategy [Quision]Overview
This strategy is built on top of BackQuant's Volatility Trend Score indicator , an open-source tool that quantifies trend persistence through a volatility-adjusted trailing structure and a rolling comparison score.
The original indicator answers a critical question: "Is the market trending with conviction, or is it chopping?" - by scoring how consistently an ATR-based trailing level advances over a configurable lookback window. This strategy wraps that core logic into a fully tradeable system with proper risk management, flexible exit modes, and session filtering.
All credit for the core indicator logic goes to BackQuant. This publication adds only the strategy execution layer.
What This Strategy Adds
1. ATR-Based Stop Loss
A dedicated ATR stop loss (independent of the indicator's core ATR) protects every trade with a volatility-scaled risk level. The SL ATR period and multiplier are fully configurable, allowing you to tune risk independently from the signal generation.
2. Risk:Reward Take Profit
The take profit is calculated as a multiple of the stop loss distance.
3. Three Exit Modes
The strategy offers three distinct exit modes to match different trading styles:
- Signal Flip Only, Exits only when the VTS score flips to the opposite regime. No SL/TP. Pure trend-following.
- SL/TP Only, Exits only when the stop loss or take profit is hit. Ignores signal flips. Pure risk management.
- Signal Flip + SL/TP, Both mechanisms are active. Maximum flexibility.
4. Optional Trailing Stop
When enabled, the trailing stop progressively tightens the stop loss as the trade moves in your favor. It only activates after the position is in profit.
5. Session Filter
Restrict trading to specific hours. Configurable timezone support (Exchange, UTC, Europe/Rome, America/New_York, Europe/London, Asia/Tokyo).
Recommended Usage
This strategy works best on instruments with clear trending behavior and sufficient volatility. The VTS core logic excels at filtering out choppy conditions, making it particularly effective on:
Crypto pairs (BTC, ETH)
Gold (XAUUSD)
Major forex pairs
Index futures
Suggested starting settings:
ATR Period: 35, Factor: 1.2
Loop: 1–45 (default)
Long Threshold: 40, Short Threshold: -10 (default)
SL ATR Period: 14, SL Multiplier: 3.0
TP R:R: 6.0
Session: adjust to your instrument's active hours
Important Notes
The core indicator logic is entirely BackQuant's work. Please refer to the original publication for detailed documentation on the scoring mechanism, tuning guidelines, and theoretical foundations.
Strategy

Indicator

LOWESS Adaptive Envelope [BackQuant]LOWESS Adaptive Envelope
Overview
LOWESS Adaptive Envelope is a nonparametric trend-fit and volatility envelope tool built around LOWESS (Locally Weighted Scatterplot Smoothing). Instead of smoothing price with a fixed-form moving average, this indicator performs a rolling set of local weighted linear regressions across a chosen historical window and stitches those local fits into a single smooth curve that adapts to changing market structure.
On top of the fitted curve, the script builds an adaptive envelope whose width is driven by the local magnitude of the model’s residuals (how far price deviates from the fit). That means the envelope automatically expands when the market is noisy or trending aggressively, and contracts when price is stable or mean-reverting cleanly.
The output is a complete “structure map”:
A LOWESS fitted centerline (trend estimate).
Upper and lower adaptive bands derived from smoothed residual spread.
A filled region that changes color based on where price sits relative to the fit.
Optional extrapolation of the fit and envelope into the future using last slope, with widening uncertainty.
An info label showing fit quality (R²), position inside the envelope, and direction.
Where LOWESS comes from (and why it is different from moving averages)
LOWESS (also written LOESS) is a classic statistical smoothing technique used in exploratory data analysis and robust curve fitting. It became popular because it can approximate complex shapes without assuming a single global model. Instead of forcing the entire window to follow one equation (like a single linear regression or a single moving average kernel), LOWESS fits many small local regressions , each one tailored to its neighborhood.
Key distinction:
A moving average is a fixed smoother, it applies the same weighting rule everywhere, regardless of whether the market is trending, chopping, or accelerating.
LOWESS is a locally re-fitted model, it re-estimates slope and intercept at each point based on nearby data.
In price terms:
LOWESS is better at “hugging structure” when the market curves or transitions.
It can follow gradual regime shifts without the same lag profile as long-window MAs.
It does not assume the trend is constant across the whole lookback, it assumes trend can vary locally.
What the indicator is modeling
Think of the lookback window as a dataset of points:
x = bar index (0..length-1 inside the window)
y = price
For every point i inside that window, the indicator estimates the best local line:
y ≈ a + b * x
But it does this using only nearby points, and it weights them by distance from i. So the fitted value at i is a locally weighted regression prediction.
The final fitted curve is the collection of those predictions across i = 0..length-1.
Core mechanics: local weighted linear regression
1) Neighborhood size (bandwidth)
The “locality” is controlled by a bandwidth parameter. In this script:
h = max(bandwidth * length / 2, 2)
Interpretation:
h acts like a radius measured in bars inside the fitting window.
Lower bandwidth → smaller h → more local fit (more responsive, can track curvature, more sensitive to noise).
Higher bandwidth → larger h → more global fit (smoother, more stable, more lag in transitions).
So bandwidth controls the bias-variance tradeoff:
Small bandwidth: low bias, high variance.
Large bandwidth: higher bias, lower variance.
2) Tricube kernel weighting
LOWESS requires a weight function that decays smoothly with distance. This script uses the classic tricube kernel :
For each candidate point j around target i:
u = |i - j| / h
If u < 1:
- w = (1 - u³)³
If u ≥ 1:
- w = 0
Why tricube:
Weights go to zero smoothly at the boundary (no sharp cutoff artifacts).
Nearby points dominate the fit, distant points contribute little or nothing.
It is a standard LOWESS choice because it produces stable smooth curves.
3) Weighted least squares fit
For each i, the script accumulates weighted sums over j in the neighborhood:
sumW, sumWX, sumWY, sumWXX, sumWXY
These correspond to the normal equations for weighted linear regression. From those, it computes:
denom = sumW * sumWXX - sumWX²
a and b derived from sums (intercept and slope)
fitted = a + b * i
If denom is too small (numerical instability, insufficient variation), it falls back to the raw price at that i.
This entire process is repeated for every i in the window, which is why it is done only on the last bar (performance).
Why it fits inside the window rather than a single line
A single regression across 200 bars assumes one slope b explains the whole move. Markets rarely do that. LOWESS allows the slope to drift through time, which is exactly what “trend structure” actually does in real price.
Residuals: turning model error into volatility structure
Once the LOWESS fitted curve is computed, the script measures the residual at each point:
res = price - fitted
Residuals are the model’s error. In trading terms, residual magnitude is a proxy for:
Local noise level.
Deviations from trend structure (overextension/underextension).
Regime instability (trend is less “explanatory”).
The script takes absolute residuals:
absRes = |res |
This is important because envelope width should reflect spread size regardless of direction.
R²: fit quality and regime information
The indicator also computes R² over the window:
ssRes = Σ(res²)
ssTot = Σ((price - meanPrice)²)
R² = 1 - ssRes/ssTot
Interpretation:
Higher R² means the LOWESS fit explains more of the variation inside the window.
Lower R² means price is behaving in a way the smooth trend model cannot explain well (chop, shocks, irregular volatility).
In markets, R² can be read as “how trend-like vs how noisy” the recent environment is, but remember it depends on your chosen length and bandwidth.
Adaptive envelope construction (what makes it “adaptive”)
A normal envelope uses a constant width (like ±k*ATR or ±k*stdev). This script does something different: it estimates a local envelope width based on smoothed residual magnitude.
1) Smooth residual magnitude locally
It computes a residual averaging window:
rWin = max(3, int(h * 0.8))
So the residual smoothing window is linked to the LOWESS locality. If the fit is local, the envelope adapts locally. If the fit is global, the envelope adapts more slowly.
Then for each i:
envW = mean(absRes over ) * envMult
Interpretation:
The envelope width is proportional to how much price typically deviates from the fit around that region.
envMult is your “how many spreads” multiplier.
This creates an envelope that expands and contracts along the curve, not a single constant band.
2) Upper and lower envelopes
For each i:
upper = fitted + envW
lower = fitted - envW
This is a model-driven channel. It is not ATR-based directly, it is “error-based.” That makes it very effective at responding to the actual behavior of the market relative to the fitted structure.
How to interpret the envelope
The centerline is the best local structural estimate. The envelope is the expected deviation range around that structure.
Typical readings:
Price near centerline: balanced relative to structure.
Price riding upper band: strong bullish pressure, trend continuation or overextension depending on context.
Price riding lower band: strong bearish pressure, continuation or overextension.
Repeated band rejections: mean-reversion regime around the structural fit.
Envelope widening: instability rising, volatility expanding, structure less reliable.
Envelope tightening: compression, cleaner trend or coiling behavior.
Because the band width is based on residuals, widening often coincides with “trend breaks” and regime transitions, not just higher ATR.
Color logic and visual encoding
The envelope fill color is based on price relative to the most recent fitted value:
If close > fitted , bullish color.
Else bearish color.
So color is a regime/bias cue, not a volatility cue. The bands themselves are drawn with translucent versions of the same regime color, while the fit line is a subtle white.
The fill polygon is constructed by:
Walking forward through upper points.
Then walking backward through lower points.
So the shape is closed and can be filled cleanly using polyline fills.
Extrapolation: forward projection with widening uncertainty
This script can project the fitted line into future bars. This is not forecasting in a statistical sense, it is a deterministic extension based on the current slope.
How it extrapolates
It takes:
slope = fitted - fitted
lastFit = fitted
Then for i = 1..extrapBars:
futureFit = lastFit + slope * i
This is a linear continuation of the most recent fit direction. It is meant as a visual guide for “if the current local trend continues.”
Why the forward envelope widens
The script also grows the envelope slightly with each projected bar:
envGrow = lastEnv * 0.01
futureEnv = lastEnv + envGrow * i
This is a simple uncertainty widening mechanism. As you move further into the future, you should assume less confidence. The envelope expansion encodes that visually without claiming statistical rigor.
Info label: what it reports and how to read it
When enabled, the label shows:
1) Direction arrow
It computes a slope over the last few fitted points:
recentSlope = fitted - fitted (or closest valid index)
▲ if slope >= 0
▼ if slope < 0
This gives a slightly more stable direction read than one-bar slope.
2) R²
Displayed as R²: 0.xxx, representing how well the LOWESS curve explains window variation.
3) Envelope Position (Env Pos)
It measures where the current close sits inside the latest envelope:
0% = at lower band
50% = at centerline
100% = at upper band
This is extremely useful as a normalized “over/under extension” metric because it is scaled by the adaptive band width, not raw price units.
How to use it properly
Trend structure and regime filtering
Use the fit line as structural trend direction.
Use the fill color as quick bias context.
Use R² as a “trend quality” read: high R² tends to mean cleaner structure, low R² tends to mean chop or instability.
Mean reversion vs continuation
This tool can support both styles, but interpretation differs:
Mean reversion framing
If market repeatedly returns to the fit line, the fit is acting like value.
Upper band touches can be “overbought relative to structure.”
Lower band touches can be “oversold relative to structure.”
Envelope position becomes your normalized stretch gauge.
Trend continuation framing
In strong trends, price can ride a band rather than revert to centerline.
Band riding plus rising fit slope suggests persistence.
A sudden failure to hold the band plus falling R² can flag transition risk.
Breakdown/transition identification
Because the envelope width is residual-driven:
If price starts producing large residuals, the envelope expands.
That expansion is often a signature of regime change, not just volatility.
Combine expansion with slope flattening to identify trend exhaustion.
Parameter tuning (what each input really does)
Length
Defines how much historical data is used for the full fit. Larger length:
More stable curve.
More computational load.
Tends to represent macro structure.
Bandwidth
Controls locality:
Low bandwidth (0.10–0.25): more reactive, tracks curvature and micro-structure, more sensitive to noise.
Higher bandwidth (0.30–0.50+): smoother, more stable, more lag in fast turns.
Envelope Width (envMult)
Scales how wide the adaptive band is relative to the local residual spread:
Lower values create a tighter channel, more band interactions.
Higher values create a wider channel, fewer touches, better for regime filtering.
Extrapolation Bars
Purely visual. More bars gives a longer projected structure line and uncertainty region.
Limitations and correct expectations
LOWESS is powerful, but it is not a magic predictor.
LOWESS is descriptive, it fits what happened, then projects linearly if extrapolation is enabled.
In sudden shocks or gaps, the fit will update only after the new data is inside the window.
Very small bandwidth can overfit local noise, producing misleading curvature.
Very large bandwidth can underfit, behaving like a slow regression and missing turning points.
R² is window-dependent, a low value does not mean “bad indicator,” it often means “market is not smooth right now.”
Summary
LOWESS Adaptive Envelope applies locally weighted linear regression (LOWESS) with a tricube kernel to build a smooth, structure-following fitted price curve that adapts to regime changes without relying on a fixed moving-average form. It then converts the model’s local residual spread into a dynamic envelope that expands and contracts with real deviation behavior, provides fit quality via R², normalizes price position inside the band, and optionally extrapolates the latest structural slope forward with widening uncertainty. The result is a robust trend-structure and deviation framework that is equally useful for regime filtering, mean-reversion context, and trend persistence assessment. Indicator

Session Auction State Engine (SASE) Summary in one paragraph
Session Auction State Engine (SASE) is a session context indicator for liquid futures, FX, equities, and crypto on intraday to daily timeframes. It classifies the current session into one of four auction regimes, Balanced, Early trend, Trend continuation, or Failed auction, so you act only when multiple acceptance and expansion conditions align. It is original because it outputs a single interpretable auction state, not buy and sell signals, by combining time acceptance, range expansion, and return to value logic into a compact dashboard. Add it to a clean chart, read the table for Action and permissions, and use the optional markers and bands for quick visual context. Shapes can move while the bar is open and settle on close, for conservative workflows use alerts on bar close.
Scope and intent
• Markets. Major index futures, major FX pairs, large cap equities, liquid crypto
• Timeframes. 1 minute to daily
• Default demo used in the publication. ES1! on 5 minute
• Purpose. Prevent premature directional decisions by forcing regime confirmation before direction is considered actionable
• Limits. Indicator only. No backtest, no execution, no performance claims
Originality and usefulness
This is not a mashup of common indicators. It is a session auction classifier with an explicit decision hierarchy.
• Unique concept or fusion. A regime engine that gates trading by session auction state using Initial Balance, value acceptance, expansion, and return to value confirmation
• What failure mode it addresses. False starts in chop, early breakouts that never gain acceptance, and trend chasing inside balanced sessions
• Testability. Inputs expose each component and the table shows the state, direction, and pass or fail checklist so users can verify why a state appears and tune thresholds
• Portable yardstick. Expansion is normalized by an expected range unit (ATR based), so thresholds scale across symbols with different point values
Method overview in plain language
SASE runs inside a user defined session window. It builds an Initial Balance (IB), then evaluates whether the market is accepting prices outside value and outside IB, whether the session is expanding beyond IB, and whether price returns to value after a failed excursion.
Base measures
• Range basis. Value width is ATR of the chart timeframe over the Width ATR length, multiplied by Width ATR multiplier
• Normalization basis. Expected range is ATR, either daily or intraday based on Expected range mode, used to normalize session extension
Components
• Initial Balance (IB). High and low during the first IB minutes of the session. IB defines the first acceptance boundary
• Value anchor. A session anchored VWAP or TWAP (or auto) used as a value center
• Value width. ATR based band around value used to measure inside value and outside value
• Acceptance. Two acceptance channels are tracked, closes outside value in the breakout direction and closes outside IB in the breakout direction. An EMA plus a short streak score turns this into an acceptance strength metric
• Extension. Maximum distance beyond IB, normalized by expected range, measures range expansion
• Balance. An EMA of time spent inside the value band measures how rotational versus directional the session is
• Failed auction. Requires a real excursion outside value first, then a sustained return inside value, plus an acceptance collapse and a rebalance increase, optionally requiring price to be back inside IB
Fusion rule
SASE outputs exactly one state per bar inside the session.
• Balanced. No confirmed breakout from IB, or conditions indicate rotational trade, high balance, low acceptance, low extension
• Early trend. Breakout exists, but trend continuation checklist is not complete yet
• Trend continuation. All trend gates pass at once: enough time since breakout, acceptance above threshold, extension above threshold, and balance below threshold
• Failed auction. After an excursion outside value, price returns and holds inside value while acceptance collapses and balance rises, optionally requiring price back inside IB
Signal rule
This script does not issue trade signals. It outputs context.
• Direction is shown only when state is not Balanced
• The dashboard shows a Trend checklist (T, A, E). Trend continuation requires T pass, A pass, and E pass
• Early trend indicates direction may be forming but confirmation is incomplete
• Failed auction indicates the prior directional attempt was rejected and mean reversion conditions are stronger
What you will see on the chart
• Optional markers. Key markers appear on state transitions, typically when Trend continuation or Failed auction begins, depending on the Markers setting
• Optional reference levels. IB high and IB low lines, and value center plus value bands
• Optional background and bar color. Off by default for chart cleanliness
• Compact dashboard. A table showing state, direction, Action, permissions, IB progress, checklist, and component gauges
Table fields and quick reading guide
• State badge. Current auction state
• Direction. Up or Down when state is not Balanced, otherwise None
• Action. Plain language instruction for the current state
• Use. Two permissions, Trend and MeanRev, shown as ON or OFF
• IB. Progress and status, Wait until Complete
• Trend. Ready percent plus checklist T, A, E
• Accept. Acceptance strength and whether it meets the trend threshold
• Extend. Extension strength and whether it meets the trend threshold
• Balance. Balance score and whether it is low enough for trend continuation
• Fail. Excursion and return to value progress when relevant
Reading tip. Trend continuation is only intended when T, A, and E are all passing. If Balanced, do not force direction.
Inputs with guidance
Setup
• Session. Defines when the engine is active. Verify timezone and hours when changing symbol or venue
• Session timezone. Exchange or a named timezone
• Show last session snapshot when closed. When enabled, the table displays the last in session state after the session ends
Logic
• IB minutes. Typical 30 to 90. Higher reduces noise but delays classification
• Value anchor. Auto is recommended. VWAP requires reliable volume, TWAP is volume agnostic
• Value reference. Freeze at IB reduces value drift and makes acceptance and failed auction logic more stable
• Width ATR length. Typical 14 to 30. Higher smooths value width
• Width ATR multiplier. Typical 0.5 to 1.2. Higher widens value and increases Balanced time
• Breakout buffer as width fraction. Typical 0.1 to 0.4. Higher requires cleaner breakouts
• Acceptance EMA length. Typical 20 to 60. Higher reduces flicker
• Acceptance streak bars. Typical 4 to 10. Higher requires sustained acceptance
• Early trend acceptance threshold. Typical 0.25 to 0.45
• Trend continuation acceptance threshold. Typical 0.45 to 0.70
• Balance EMA length. Typical 30 to 80
• Trend continuation max balance. Typical 0.30 to 0.55. Lower makes trend continuation stricter
• Balanced min balance. Typical 0.55 to 0.80
• Trend continuation min bars since breakout. Typical 10 to 30
• Extension thresholds. Early 0.10 to 0.25, Trend 0.20 to 0.50, in expected range units
• Failed auction window bars. Typical 15 to 40. Larger windows require more sustained rejection
• Failed auction thresholds. Acceptance max 0.10 to 0.30, Balance min 0.55 to 0.80
• State change confirm bars. Typical 1 to 4
• Return to Balanced confirm bars. Typical 4 to 12
• Minimum bars to keep non Balanced state. Typical 6 to 20, increases stability
UI
• Theme. Dark or Light
• Dashboard position. Corner selection
• Markers. Off, Key only, or All changes
• Background tint and bar color. Off by default to keep charts readable
• Show IB lines and Show value bands. Off by default, enable for learning or debugging
Usage recipes
Intraday trend focus
• IB minutes 60
• Value reference Freeze at IB
• Breakout buffer 0.25
• Trend confirm bars 18
• Accept trend threshold 0.55
• Extend trend threshold 0.30
• Trend max balance 0.40
Goal. Trade only when Trend continuation is active and checklist is fully passing
Intraday mean reversion focus
• IB minutes 30 to 60
• Value reference Freeze at IB
• Wider value width, raise Width ATR multiplier to 0.9 to 1.2
• Raise Balanced min balance to 0.70
• Keep Markers on Key only
Goal. Focus on Balanced and Failed auction states, avoid early trend and trend continuation trades
Swing continuation
• Use 60 minute or 240 minute chart
• Expected range mode Daily ATR
• Trend confirm bars 12 to 30 depending on timeframe
• Raise Width ATR length to 30
Goal. Use Trend continuation as a higher level regime gate, then use your own entry timing tool inside that regime
Realism and responsible publication
• No performance claims. Past results never guarantee future outcomes
• Intrabar motion reminder. Shapes and table values can update while a bar forms and settle on close
• Session windows use the chart exchange time unless you override timezone. Verify hours when changing symbol or venue
Honest limitations and failure modes
• News releases and liquidity gaps can break normal auction behavior and can trigger rapid state transitions
• Symbols with unreliable volume may work better using TWAP or Auto rather than VWAP only
• Very quiet regimes can reduce contrast between Balanced and Early trend, consider longer windows or higher thresholds
• Non standard chart types can distort session and IB calculations, use standard candles for evaluation
Open source reuse and credits
None
Legal
Education and research only. Not investment advice. You are responsible for your decisions. Test on historical data and in simulation before any live use. Use realistic costs in any external testing workflow. Indicator

Harmonic Frequency Visualizer [BackQuant]Harmonic Frequency Visualizer
Overview
Harmonic Frequency Visualizer is a cycle-analysis and cross-asset resonance tool that uses a simplified Discrete Fourier Transform (DFT) to measure how strongly specific cycle periods are present in price. It is not a “trend indicator” and it is not trying to predict direction by itself. Its job is to quantify rhythm: which repeating periods (in bars) are currently dominant, whether those cycles are expanding or contracting (phase direction), and whether multiple instruments are sharing the same dominant periods at the same time (resonance).
This indicator has two main output modes:
Spectrum : a frequency “snapshot” showing amplitude at each tested period for up to five instruments.
Spectrogram : a history heatmap showing how the spectrum evolves through time (for the chart instrument).
Spectrum
Spectrogram
On top of that, it produces a Dominant Cycle Oscillator derived from the dominant cycle’s phase, which gives a continuous cycle position metric (peak/trough style zones) without repainting.
This is designed for traders who want cycle context the same way they want volatility context: not as a magic signal, but as structure.
What “frequency” and “cycles” mean in trading terms
A cycle period (say 21 bars) means: “a repeating pattern that tends to complete one full oscillation every 21 bars.” If price contains such a pattern, the DFT will detect a strong correlation between price and a 21-bar sine/cosine wave.
Markets do not have perfectly stable periodic motion, but they often show:
Mean-reverting swings around value.
Trend pulses with pullback cadence.
Volatility clustering that creates rhythmic expansions and contractions.
Cycle tools are trying to measure those repeating components, and DFT is the standard mathematical way to do it.
Where DFT comes from (the core idea)
The Discrete Fourier Transform comes from Fourier analysis, a foundational signal processing concept:
Fourier’s idea : any sufficiently well-behaved signal can be expressed as a sum of sine and cosine waves at different frequencies, each with:
An amplitude (how strong that wave is).
A phase (where you are within the wave cycle).
In continuous math you get the Fourier Transform. In sampled data (like candles) you use the Discrete Fourier Transform. It converts a time series (price over time) into a frequency description (strength of different cycles).
In markets:
Time domain: candles and price series.
Frequency domain: cycle periods and their strengths.
Why sine and cosine, not just sine
A sine wave alone cannot represent every phase alignment cleanly. DFT uses both cosine and sine components because together they form an orthogonal basis that can represent any phase shift.
You can think of it like this:
Cosine component captures “in-phase” alignment with the cycle.
Sine component captures “quadrature” (90-degree shifted) alignment.
Combining them gives full information: amplitude + phase.
Mathematically, a single frequency component can be written as:
A * cos(ωt + φ)
But DFT estimates A and φ by separately accumulating cosine and sine projections.
How this script implements the DFT (and what it is actually measuring)
This is not a full-spectrum FFT across every frequency. It is a targeted DFT across a fixed set of cycle periods:
Tested periods
The script tests 8 predefined periods:
5, 8, 13, 21, 34, 55, 89, 120
These are Fibonacci-like cycle candidates commonly used in cycle/market structure work. The point is not that Fibonacci is magic. The point is that these represent a reasonable spread from short to long rhythms without needing hundreds of frequencies (which would be heavy in Pine).
Normalization step (important)
Before computing the DFT, the script normalizes the series:
mn = SMA(src, lookback)
sd = stdev(src, lookback)
norm = (src - mn) / sd (if sd != 0)
Why normalize:
DFT amplitude depends on the scale of the input series.
If you compare BTC and TLT raw prices, the magnitude is meaningless.
Z-score normalization makes amplitude more comparable across instruments and regimes.
So the spectrum is measuring “cyclical structure in standardized deviations,” not raw dollars.
Projection onto cosine and sine
For each tested period P:
ω = 2π / P (angular frequency for that period)
Compute:
- sCos = Σ(norm * cos(ωk))
- sSin = Σ(norm * sin(ωk))
Interpretation:
You are correlating the last window of normalized price with a cosine wave of period P.
And also correlating it with a sine wave of period P.
If the price has a strong P-bar rhythm, these sums grow in magnitude.
Window length detail
The script uses:
window = min(lookback - 1, 99)
So even if lookback is 200, the internal DFT accumulation caps at 100 bars for performance stability. This is a deliberate trade: stable computation in Pine, while still letting you define normalization lookback and overall context.
Amplitude computation
Once sCos and sSin are computed:
raw magnitude = sqrt(sCos² + sSin²)
This is the length of the vector (sCos, sSin). That vector length is the standard way to combine the orthogonal components into one strength metric.
Then it scales it into a 0–100 “display amplitude”:
amp = sqrt(sCos² + sSin²) / lookback * 100 * sensitivity
amp is capped to 100
So:
Higher amplitude means stronger alignment with that cycle period.
Sensitivity is a user control to amplify or damp the display scaling.
Important: amplitude here is not a probability, and it is not guaranteed “signal quality.” It is a standardized “how much of that cycle exists in the recent window” metric.
Phase computation
Phase is computed using atan2(sSin, sCos). That matters because:
A simple atan(sin/cos) fails in different quadrants.
atan2 correctly resolves the angle from -π to +π.
Phase tells you where you are within the cycle:
Two cycles can have same amplitude but opposite phase.
Phase is what lets you infer “approaching peak vs trough” behavior.
Dominant cycle selection
The script chooses the dominant cycle as the period with the highest amplitude among the tested periods:
domIdx = argmax(amp )
domAmp = max amplitude
domPhase = phase at domIdx
This dominant cycle is used for:
Spectrogram history matrix (chart symbol).
Dominant cycle oscillator.
Data window outputs (dominant period, oscillator value).
Spectrum View: what you see and how to read it
In Spectrum mode, the indicator draws a frequency snapshot for up to five instruments. Each instrument gets a spectrum line (or bars/area depending on style) plotted across the 8 periods on the x-axis, with amplitude (0–100) on the y-axis.
X-axis meaning
Each x position corresponds to a period (5 → 120 bars). You are not looking at “frequency in Hz.” You are looking at “period in bars,” which is more intuitive in trading.
Y-axis meaning
Amplitude is a scaled measure of how strongly that period is present in the recent normalized data. Higher means stronger.
Plot styles
Waveform: connects amplitude points into a continuous shape, best for seeing spectrum shape.
Bars: draws vertical bars per period, best for quick comparison.
Area: similar to waveform but filled toward baseline for emphasis.
Dominant peaks and phase direction labels
The script highlights dominant cycles per symbol (if enabled):
If max amplitude > 20, it labels that peak with the symbol name.
If Show Phase Direction is enabled, it appends ▲ or ▼.
Phase direction logic:
rising = sin(phase) < 0
▲ means cycle is in a “rising” phase segment
▼ means cycle is in a “falling” phase segment
This is not “price will rise now.” It is “the dominant cycle’s instantaneous phase suggests you are on the upward vs downward half of that oscillation.” In real markets, you use this as context, not as a standalone trade trigger.
It also draws small ▲/▼ markers on secondary peaks (amp > 15) to show phase direction of other meaningful cycles, giving you a richer picture than “one dominant period.”
Resonance Zones: cross-asset harmonic alignment
Resonance is where this tool becomes more than a single-chart curiosity.
What resonance means here
A resonance zone is flagged when at least 3 out of 5 instruments have strong amplitude at the same tested period. Mechanically:
For each period i:
- Count instruments with amp > 30
- If count >= 3, mark resonance at that period
When resonance is detected:
A vertical highlight box is drawn behind that period.
A ⚡ marker is printed at the top.
Interpretation:
Multiple assets are expressing a similar cycle length at the same time.
This can indicate macro rhythm, shared liquidity timing, or cross-market synchronization.
This is especially useful when your instrument set includes:
Rates proxy (TLT), commodities (oil, gold), and crypto indices.
You can visually spot when markets are “vibrating” together at a shared period.
Resonance is not automatically bullish or bearish. It is telling you “cycle length agreement,” which can help with timing models and contextual trade planning.
Spectrogram View: frequency over time
Spectrum mode is a snapshot. Spectrogram mode adds time evolution.
What a spectrogram is
A spectrogram is a 2D heatmap where:
Rows = different periods (frequency bands).
Columns = time history (bars ago → now).
Color = amplitude strength.
This allows you to see:
Which cycles are persistent vs fleeting.
When dominant cycle shifts occur (energy moves from one period to another).
Cycle regime transitions (short cycles dominating in chop vs longer cycles dominating in trend).
How the script builds the spectrogram matrix
It maintains a matrix with:
NUM_PERIODS rows (8 periods)
histBars columns (history length)
Each bar:
Remove the oldest column.
Append the newest amplitude array from chartSpec.
So the spectrogram is always a rolling history of the chart symbol’s cycle amplitudes. It does not attempt to store five symbols (too heavy), it focuses on the active chart for time evolution.
Heat coloring
Amplitude values map to a custom gradient:
Low = dark blue
Mid = blue/cyan to orange
High = yellow
This makes dominant energy bands visually obvious. A stable bright band means persistent cycle dominance.
Dominant Cycle Oscillator: phase mapped to a 0–100 oscillator
The oscillator is derived from the dominant cycle phase (chart symbol):
oscRaw = cos(domPhase)
oscValue = 50 + 50 * oscRaw (maps -1..1 into 0..100)
Interpretation:
When cos(phase) ≈ +1, oscillator near 100 (cycle peak zone).
When cos(phase) ≈ -1, oscillator near 0 (cycle trough zone).
Midline 50 corresponds to the quarter-cycle transition points.
It also colors the oscillator by phase direction:
oscRising = sin(domPhase) < 0
Rising phase = green-ish
Falling phase = red-ish
This gives you a clean timing reference:
The dominant period tells you the cycle length.
The oscillator tells you where you are within that cycle.
It is not forecasting price. It is telling you the current phase position of the strongest detected cycle component.
Alerts and practical timing usage
Alerts are based on the oscillator:
Cross above 80: dominant cycle entering peak zone.
Cross below 20: dominant cycle entering trough zone.
Cross 50: midline cross (phase transition).
In practice, you use these as “timing context” alerts, for example:
If your trend model is bullish and cycle oscillator enters trough zone, it can hint at a favorable pullback timing window.
If you are mean-reversion trading and cycle peak zone aligns with resistance, that confluence matters.
Again: cycle timing needs structure confirmation. The oscillator alone is not a trade system.
Multi-instrument design and non-repaint behavior
The indicator requests five external instruments via request.security. It uses:
close with lookahead_on
This forces the data to be “previous confirmed close” so the spectral calculations do not repaint intra-bar. That matters because cycle measures can change drastically within a bar if you let them use live values.
So:
Spectra for external symbols are based on confirmed historical closes.
Chart symbol spectrogram and oscillator are also stable in the sense they depend on confirmed series values (dominant phase updates bar-to-bar).
Key parameters and how they change behavior
Analysis Lookback
Affects normalization and the DFT window cap:
Higher lookback stabilizes mean/stdev normalization and reduces random shifts.
Lower lookback makes the tool more reactive but more prone to regime noise.
Because the inner DFT accumulation caps at 100 bars, very high lookback mostly affects normalization rather than the raw projection length.
Sensitivity
Scales displayed amplitude:
Higher sensitivity makes peaks stand out more.
Lower sensitivity compresses amplitude.
It is a display control, not a physics constant.
View Mode
Spectrum: cross-asset snapshot comparison, resonance detection.
Spectrogram: time evolution of cycle energy for chart symbol.
Show Phase Direction
Adds ▲/▼ markers derived from sin(phase). Useful for quick cycle position intuition, but do not treat ▲ as “buy.”
Show Resonance Zones
Marks periods where many instruments share strong energy. Useful for macro rhythm alignment.
Highlight Dominant Cycles
Labels peaks. If you disable it, the chart becomes cleaner but less informative.
Spectrogram History
Controls how many columns are stored. Higher makes a longer heatmap but costs more drawing.
Limitations and what not to assume
This tool is honest DSP applied to market data, but market data is not a stationary sine wave generator. Key limitations:
Cycles drift. Dominant period can shift as regime changes.
The tool only tests 8 candidate periods. If the true dominant period is 30, it will express as energy near 34 or distributed across neighbors.
Normalization helps comparability, but does not make amplitude “absolute truth.”
DFT assumes a stable frequency over the window. Markets often violate that.
Phase-based oscillators are timing aids, not predictors.
This is why the indicator is best used as:
Context for entries/exits, not a standalone system.
A way to see when cycle energy concentrates or disperses.
A way to detect when multiple markets share a timing rhythm.
How to use it properly (workflows)
1) Cycle regime identification
If short periods (5–13) dominate, market is often choppy, reactive, and mean-reverting.
If mid periods (21–55) dominate, market often shows swing structure.
If long periods (89–120) dominate, market can be in slower macro drift, trend legs, or compressed volatility regimes.
2) Timing layer for an existing strategy
Use your trend model to decide direction.
Use dominant cycle oscillator to decide timing within that direction.
Use spectrogram to avoid trading when dominant period is unstable or flipping rapidly.
3) Cross-asset confirmation
If you see resonance at a period, watch whether your main instrument is also showing strength there.
Resonance can justify holding a cycle-based timing thesis with more confidence because it is not isolated.
4) Expectation management
If the spectrum is flat (no peaks above threshold), that is information:
No clean dominant cycle, randomness dominates.
Cycle-based timing will be unreliable.
Summary
Harmonic Frequency Visualizer uses a targeted Discrete Fourier Transform across predefined cycle periods to measure amplitude and phase of cyclical components in price. It supports multi-instrument spectrum comparison, resonance detection when several markets share strong energy at the same periods, and a spectrogram heatmap for the chart instrument showing how cycle dominance evolves over time. A dominant cycle oscillator maps phase into a 0–100 timing readout with alerts for peak/trough/midline transitions. It is a cycle context engine designed to complement trend, structure, and risk models, not replace them. Indicator

Ehlers Super Smoother Trend Score [BackQuant]Ehlers Super Smoother Trend Score
Overview
Ehlers Super Smoother Trend Score is a regime and trend-strength indicator built on a signal-processing filter created by John F. Ehlers. Instead of smoothing price with a standard moving average (which is mathematically crude and prone to noise and aliasing), this indicator applies the Ehlers Super Smoother, a Butterworth-style low-pass filter designed specifically for market data. The filtered series is then scored for directional persistence across a configurable lookback window, producing an oscillator-like trend score that measures how consistently the smoothed trend is advancing or deteriorating.
This is not a simple “MA slope” tool. It is:
A proper low-pass filter (Super Smoother) to reduce noise while preserving structure.
A persistence score that converts the filtered trend into a quantitative regime signal.
A threshold framework that turns the score into long/short regime transitions with clean state logic.
Where the filter comes from (and why it matters)
John F. Ehlers is known for applying digital signal processing (DSP) techniques to technical analysis. Traditional moving averages are not designed as proper frequency-selective filters. They blur price, lag heavily, and can introduce distortions, especially when the market contains high-frequency components (noise) near the Nyquist limit (the maximum representable frequency in sampled data).
The Super Smoother is derived from a Butterworth low-pass filter design. Butterworth filters are engineered to have a maximally flat passband, meaning they smooth without introducing ripples in the filtered output. In trading terms:
Less “wavy” smoothing artifacts than many MA variants.
Better suppression of high-frequency noise.
Cleaner trend structure for downstream logic.
This script implements Ehlers’ recursive coefficient form, giving you a 2-pole (classic) or 3-pole (heavier) filter.
What “Super Smoother” actually is
The Super Smoother is a recursive IIR filter (Infinite Impulse Response). Unlike an SMA which averages a fixed window of past values, an IIR filter uses feedback from its own prior output values. That matters because it can achieve strong smoothing with less lag for a given “smoothness target.”
Conceptually:
Input: price series.
Output: filtered estimate of the “low-frequency” component (trend structure).
Mechanism: combine current input (or pre-filtered input) with previous filter outputs using coefficients derived from a chosen cutoff period.
The coefficients (c1–c4) are not arbitrary, they are computed from exponential decay and cosine terms based on the cutoff period. This is what makes it a real DSP filter rather than “just another MA.”
2-pole vs 3-pole behavior
2-pole (classic)
A standard Ehlers Super Smoother configuration. It offers a strong improvement over typical MAs in smoothness vs lag balance.
3-pole
Adds an additional feedback term (one more prior filtered state). This increases smoothing and noise rejection, but introduces slightly more lag. The advantage is a cleaner structural line, which often improves regime stability when the market is noisy or mean-reverting.
Anti-aliasing pre-filter step
Before applying the recursive formula, the script averages the current and previous price:
avg = (src + src ) / 2
This is a simple but important pre-filter that reduces high-frequency components that can alias into lower frequencies in sampled data. In practice, it helps stop “one-bar spikes” from contaminating the filter output as much.
Inputs and what they really control
Super Smoother Period (ssPeriod)
This is the cutoff period used in the coefficient derivation. It is not the same as “MA length,” but it behaves similarly in that:
Lower period = faster response, less smoothing, more sensitivity to noise.
Higher period = smoother output, better noise rejection, more lag.
Poles
Selects filter order:
2 poles = balanced default.
3 poles = smoother, more conservative.
Score Lookback Start/End
Defines the persistence scoring window. The script compares the current filtered value to many prior filtered values across that range. A longer range makes the score more “confidence-based” and slower to change, while a shorter range makes it more reactive.
Thresholds (Long/Short)
Turns the score into a regime classification:
Long threshold defines when bullish persistence is strong enough to be considered a trend regime.
Short threshold defines when persistence has deteriorated enough to signal a bearish transition.
How the trend score is computed
After filtering, the indicator computes a directional persistence score on the filtered series (not raw price). That distinction matters because you are scoring structure, not noise.
Mechanically:
For each i in the scoring window:
- If filt_now > filt , add +1
- Else add -1
Sum across the window to produce the score.
Interpretation:
High positive score means the filtered trend is consistently higher than many past points, persistent bullish structure.
Low or negative score means the filtered trend is not advancing, or is consistently below prior points, bearish structure.
Scores near the middle mean the filtered series is oscillating without clear persistence, chop or transition.
This is a persistence metric, not a slope metric. It does not care about one-bar direction, it cares about consistency relative to history.
Signal and state logic (why it stays clean)
The indicator uses state logic to prevent constant flip-flopping:
Long condition: score > long threshold.
Short condition: score crosses below short threshold (uses prevScore and current score).
That short logic is event-based, it triggers only on the breakdown transition, not on every bar below the threshold. Once a regime is set, it remains until a real threshold event forces change.
Signals are plotted only on regime flips:
Long marker when signal becomes +1 and prior was -1.
Short marker when signal becomes -1 and prior was +1.
This is designed for alerts and for clean backtesting interpretation.
Visual layers
The indicator can be used purely as a panel oscillator or as a structure overlay.
Pane
Trend Score line, colored by active regime.
Optional reference lines at long/short thresholds for fast regime reading.
On-chart (optional)
Super Smoother line plotted over price, colored by regime.
Optional candle painting and background shading to reflect active regime.
This lets you treat the filter as a dynamic trend structure line while using the score as the regime classifier.
How to interpret it properly
1) The Super Smoother line
This is the cleaned trend structure estimate:
When price respects the smoother line, trend structure is intact.
When price repeatedly chops through it, structure is weak or range-bound.
2) The score
This is the quantified persistence of that structure:
Rising score implies strengthening trend persistence.
Falling score implies deterioration, transition risk, or mean reversion.
Score compression often shows consolidation before a regime shift.
3) Threshold regimes
Above long threshold: bullish persistence regime, trend-following conditions.
Below short threshold: bearish regime transition, defensive or short-biased conditions.
Between thresholds: neutral/transition zone, where chop and fakeouts are common.
Practical use cases
Trend filter
Only take long setups when score is above the long threshold.
Reduce exposure or avoid trend trades in the neutral band.
Treat a breakdown through the short threshold as regime invalidation.
Trend quality assessment
High score = continuation environment.
Moderate score = trend exists but is fragile.
Low/negative score = distribution, downtrend, or unstable structure.
Trade management
Use the Super Smoother line as a structure reference for trailing risk.
Use score deterioration as an early warning before full regime flips.
Use regime flips as hard exits or bias changes.
Tuning guidelines
If you want fewer signals and cleaner regimes
Increase ssPeriod.
Use 3 poles.
Increase scoreEnd (longer scoring window).
If you want faster reaction
Decrease ssPeriod.
Use 2 poles.
Reduce the scoring window length.
Keep in mind: faster settings increase sensitivity to chop. The filter is good, but no filter removes the reality of mean reversion.
What makes this different from “just a smoothed MA score”
The difference is the filter quality. The Super Smoother is a proper low-pass filter with coefficients derived from DSP principles, designed to suppress high-frequency noise and avoid common smoothing artifacts. Scoring that filtered structure gives you a regime metric that is more stable and more meaningful than scoring raw price or scoring a basic MA that still carries a lot of aliasing and distortion.
Summary
Ehlers Super Smoother Trend Score combines a DSP-derived Butterworth-style Super Smoother filter with a directional persistence scoring model. The filter provides a clean, low-noise trend structure series, and the score quantifies how consistently that structure is advancing or deteriorating across a defined window. Threshold-based regime logic converts the score into clean trend states and alerts, making it a practical tool for trend filtering, regime detection, and structure-aware trade management. Indicator

Step Generalized Moving Average [BackQuant]Step Generalized Moving Average
Overview
Step Generalized Moving Average (StepGMA) is a trend-structure moving average designed to solve two common problems with classic MAs:
They overreact to noise in chop, causing constant micro-flips.
They lag too much when you smooth them enough to stop that noise.
StepGMA tackles this by combining two layers:
A Generalized Moving Average (GMA) that increases responsiveness without simply shortening length.
A Step Filter that converts the MA into discrete “steps” sized by ATR, suppressing insignificant movement and only updating when the move is meaningful.
The output is a trend line that behaves more like market structure: it holds its level through noise, then “reprices” in chunks when volatility-adjusted movement is large enough.
What the indicator is trying to represent
Instead of showing every tiny MA wiggle, StepGMA tries to represent the idea that:
Most price movement is noise relative to volatility.
Trend only matters when it advances by a meaningful amount.
A good trend line should stay stable until the market forces it to move.
That makes this indicator useful as:
A regime filter (trend vs chop).
A trend-following bias line.
A structure-like dynamic S/R reference.
A signal generator with fewer low-quality flips.
Component 1: Moving Average engine (selectable)
The base smoothing is not fixed. You can choose between multiple MA types:
SMA, EMA, WMA, VWMA: classic smoothing families.
DEMA, TEMA: reduced-lag EMA variants.
T3: smooth yet responsive, good for trend.
HMA: very low lag, can be twitchy without filtering.
ALMA: center-weighted smoothing, often “cleaner” visually.
KAMA: adaptive smoothing based on efficiency ratio, good in mixed regimes.
LSMA: regression-based, tends to track trend direction well.
McGinley: dynamic smoothing designed to reduce lag during fast moves.
This matters because the StepGMA is not “one MA.” It is a framework that lets you pick the underlying smoothing behavior, then applies the generalization and step logic on top.
Component 2: Generalized Moving Average (GMA)
Where the idea comes from
Generalized MA here is essentially a form of two-stage smoothing compensation . A common trick in signal processing and technical analysis is:
Apply a smoother once (MA1).
Apply it again (MA2).
Use MA2 as a “lag reference,” then combine MA1 and MA2 to reduce lag while keeping smoothness.
This is related in spirit to reduced-lag filters (like DEMA/TEMA) and “zero-lag” style constructions that subtract part of the lag component. You are not magically removing lag, you are biasing the output toward the first-pass MA while subtracting some of the second-pass smoothing that represents delayed response.
How this script does it
It computes:
ma1 = MA(src, len)
ma2 = MA(ma1, len)
Then combines them using a volume factor (vf):
generalized = ma1 * (1 + vf) - ma2 * vf
Interpretation:
ma2 is a “more delayed” version of ma1.
Subtracting vf * ma2 and adding (1+vf) * ma1 pushes the output toward responsiveness.
vf controls how aggressive that push is.
Volume Factor (vf) is really an aggressiveness knob
The script clamps vf between 0.01 and 1.0 to keep it stable. Conceptually:
Low vf: behaves closer to a normal MA1, smoother, more lag.
High vf: more compensation, faster response, more risk of overshoot or noise sensitivity (which is then handled by the step filter).
So the GMA stage tries to give you a cleaner, faster trend estimate without just shrinking the MA period.
Component 3: Step Filter (the key behavior)
What a step filter is
A step filter turns a continuous signal (here, the generalized MA) into a discrete “staircase” signal. Instead of updating every bar, it updates only when the input has moved far enough to justify a new step.
This is conceptually similar to:
A quantizer in signal processing (rounding changes to discrete increments).
A volatility threshold filter (ignore changes smaller than X).
Market structure logic where levels matter more than micro movement.
How it works in this script
The filter maintains a persistent value: stepped .
Each bar:
diff = src - stepped
If |diff| < stepSize, do nothing (hold the level).
If |diff| >= stepSize, move stepped by a number of step increments.
The step increment size is:
stepSize = (stepMult / 100) * ATR(atrPeriod)
This is critical:
In higher volatility, ATR is larger, so steps are larger, fewer updates, more stability.
In lower volatility, ATR is smaller, so steps are smaller, more updates, more sensitivity.
So the step behavior automatically adapts to volatility.
Multiple-step catching behavior
If price jumps far beyond one step, the script does not move only one step. It moves by:
floor(|diff| / stepSize) * stepSize
So it “catches up” in discrete blocks, preserving the stepped character without lagging massively after large moves.
Direction and regime
Direction is determined by the stepped line, not the raw MA:
direction = +1 if steppedMA is rising
direction = -1 if steppedMA is falling
otherwise direction stays the same
Signals only trigger on direction state changes:
Long when direction flips to +1
Short when direction flips to -1
This matters because it prevents repeated signals while the trend remains intact. You only get a signal when the market has moved enough (in ATR terms) to justify a structural step in the opposite direction.
Secondary line and gradient fill
The script also plots a secondary “slow MA” (length 25, same MA type). This is not the core logic, it is a visual context layer:
StepGMA is the structure line (discrete, regime-driven).
Slow MA is a smoother reference for the underlying drift.
The gradient fill highlights separation and dominance.
When StepGMA sits above the slow MA, the fill reinforces bullish bias. When below, it reinforces bearish bias. It is basically a “trend pressure” visual, not a separate signal.
How to interpret it
1) StepGMA as trend structure
Flat steps mean price is not making enough volatility-adjusted progress to move structure.
Up-steps mean the market has advanced enough to reprice the trend line upward.
Down-steps mean deterioration significant enough to reprice structure downward.
2) Direction is a regime, not a tick-by-tick call
Because direction is derived from step changes, it is naturally a regime filter:
Fewer flips in chop.
Clearer regime transitions.
Signals tend to occur later than ultra-fast tools, but with better confirmation quality.
3) Step size controls noise rejection
StepMult is the main “anti-chop” control:
Higher stepMult = bigger ATR steps = fewer updates, fewer signals, more confirmation, slower to react.
Lower stepMult = smaller steps = more updates, more signals, more sensitivity, more chop risk.
4) Generalization controls responsiveness of the underlying trend estimate
vf controls how “fast” the MA tries to be before stepping:
Higher vf makes the MA respond faster to new price information.
Lower vf makes the MA smoother and more conservative.
The step filter then decides whether that change is meaningful enough to matter.
Practical use cases
Trend filter for entries
Only take longs when direction is bullish.
Only take shorts when direction is bearish.
Avoid trades when StepGMA is flat for long periods, market is not repricing meaningfully.
Dynamic support and resistance
Because the line holds levels, it often behaves like structure:
In uptrends it can act as a rising support reference.
In downtrends it can act as falling resistance.
Signal quality layer
The step-based flip signals tend to be higher quality than basic MA crossovers because they require:
A meaningful volatility-adjusted move.
A confirmed direction change in the stepped trend structure.
Trade management
Use StepGMA as a trailing invalidation reference.
Use direction flips as “hard” regime exits.
Use separation vs slow MA as a “pressure” gauge for scaling decisions.
Tuning guidelines
MA Type
Pick based on the character you want:
T3, ALMA, KAMA are usually good defaults for clean trend representation.
HMA/LSMA are faster but may need larger stepMult to avoid twitch.
SMA is slow and stable but can be too laggy unless vf is increased.
MA Period
Sets the base smoothing horizon. Longer periods give “macro trend,” shorter periods give “tactical trend.”
Volume Factor (vf)
Sets responsiveness compensation:
0.05–0.25 is usually sensible.
Higher than that can get aggressive, step filter will save you, but your steps may fire more often.
ATR Period and StepMult
These define your structure sensitivity:
ATR Period controls how stable the volatility estimate is.
StepMult controls how large a move must be to change structure.
If you want fewer flips, increase StepMult or ATR Period. If you want quicker reaction, lower StepMult or ATR Period.
What this indicator is and is not
It is:
A trend structure MA that ignores sub-threshold noise.
A regime tool that uses volatility-adjusted repricing logic.
A configurable framework that works across assets and timeframes.
It is not:
A predictive reversal tool.
A scalping signal machine.
A replacement for risk management.
Summary
Step Generalized Moving Average combines a lag-compensated moving average (generalization via MA1/MA2 blending) with a volatility-scaled step filter (ATR-based quantization). The result is a stable, structure-like trend line that updates only when price movement is meaningful relative to volatility, producing cleaner regimes, fewer chop flips, and clearer trend bias than conventional moving averages.
Indicator

Laguerre Filter [BackQuant]Laguerre Filter
Overview
The Laguerre Filter is a powerful trend-following tool designed to smooth price action while maintaining responsiveness to market changes. It is based on the Laguerre recursive filter, which is a type of signal processing filter that adapts to both the current price dynamics and the underlying trend. The Laguerre Filter can be seen as a method to reduce market noise, enabling traders to more easily identify the strength and direction of trends while minimizing lag.
The Laguerre Filter is well-suited for markets with varying volatility levels, offering a smoother representation of price action without the delay associated with traditional moving averages. By dynamically adjusting to price movements, the Laguerre Filter provides a more adaptive and reliable signal compared to simpler smoothing techniques.
What is the Laguerre Filter?
The Laguerre Filter is derived from the Laguerre polynomial, which is used in signal processing for smooth filtering of data. The Laguerre filter is a recursive filter, meaning that each new value is calculated based on both the current price data and previous values, with a weighting system that allows it to adapt to market conditions. This recursive nature helps reduce the impact of short-term fluctuations, enabling the filter to focus on the underlying trend.
The Laguerre filter uses a feedback mechanism, where the input signal (price data) is smoothed iteratively. This iterative process helps avoid the lag that is typically associated with traditional moving averages while still capturing the overall trend direction.
The filter is designed to have:
Adaptive behavior: It reacts quickly to significant price changes while ignoring minor fluctuations.
Reduced noise: By filtering out random short-term price movements, it provides a clearer view of the underlying trend.
Customizability: Traders can adjust the filter’s sensitivity through user inputs, making it adaptable to different market conditions.
Core Calculation Methodology
The core of the Laguerre Filter lies in its recursive calculation:
Each new value is calculated using the previous value along with the current price input.
The recursive formula is governed by two key parameters: the damping factor (gamma) and the order of the filter (number of Laguerre elements).
The damping factor controls how responsive the filter is to changes in price. A higher gamma value makes the filter smoother but introduces more lag, while a lower gamma value makes it more reactive to price changes but can introduce more noise.
The order defines how many Laguerre elements are used in the calculation. A higher order results in a smoother output but with more delay, while a lower order provides a faster response but less smoothing.
The filter works by weighting previous values with a binomial weighting system, which assigns more weight to recent values and less weight to older values. This creates a dynamic smoothing effect that adapts to price volatility, ensuring that the filter is neither too slow nor too noisy.
Signal Logic and Trend Detection
The Laguerre Filter continuously evaluates the strength and direction of the trend by comparing the current smoothed value to the previous value:
If the current value is greater than the previous value, the trend is considered bullish, and the filter will signal a long condition.
If the current value is less than the previous value, the trend is considered bearish, and the filter will signal a short condition.
The trend detection logic is based on the recursive nature of the filter, which smooths price movements over time. This allows the filter to capture the broader trend while minimizing the influence of short-term price fluctuations.
The trend state is also visually represented by color-coding:
Green color represents an uptrend (bullish condition).
Red color represents a downtrend (bearish condition).
Neutral (white) indicates no clear trend direction.
This color-coding helps traders easily identify the prevailing trend and decide whether to enter or exit trades based on the trend's strength.
Laguerre Filter Behavior and Performance
The performance of the Laguerre Filter can be influenced by several factors:
Gamma (Damping Factor): A higher gamma value results in a smoother filter but increases lag. A lower gamma value allows for a faster response but may introduce more noise, making it more reactive to smaller price changes.
Filter Order: The order determines how many Laguerre elements are used in the filter calculation. A higher order provides more smoothing but increases lag, while a lower order results in a quicker response but less smoothing.
The sweet spot for gamma is typically between 0.7 and 0.85, where the filter offers a good balance between smoothness and responsiveness. The filter order is usually set to 4 for classic Laguerre filtering, but higher orders can be used for more smoothing if needed.
The Laguerre Filter’s performance shines in markets with sustained trends, where the filter can effectively capture and represent the underlying direction without excessive lag. It is particularly useful in volatile markets, as it helps smooth out noise while providing a clear picture of the trend.
Visual Presentation
The Laguerre Filter provides a dynamic, color-coded line that follows the trend direction. This line can be displayed alongside price data to visually highlight the market trend. In addition to the main Laguerre line, several visual enhancements can be applied:
Gradient fill between the price and the Laguerre Filter line, providing a visual cue for bullish or bearish market conditions.
Candle coloring to reflect the current trend, making it easier to spot trend reversals or confirmations directly on the chart.
Background shading to visually highlight areas of strong trend or consolidation.
Edge glow effect that highlights trend boundaries, making it easy to spot key levels of support or resistance.
These visual elements enhance the usability of the Laguerre Filter, allowing traders to quickly assess the market trend and make informed decisions.
Practical Use Cases
1) Trend Following
The Laguerre Filter is ideal for trend-following strategies. By using the filter to identify the prevailing trend, traders can:
Enter long positions when the Laguerre Filter turns bullish (green).
Enter short positions when the Laguerre Filter turns bearish (red).
By aligning trades with the dominant trend, traders can improve their chances of success.
2) Trend Strength Assessment
The Laguerre Filter can also be used to assess the strength of the trend:
A rising Laguerre value indicates a strengthening uptrend.
A falling Laguerre value indicates a strengthening downtrend.
A flattening Laguerre value signals weakening momentum or consolidation.
This information can be used to adjust position sizing or to decide when to enter or exit a trade.
3) Trade Management
The Laguerre Filter can also assist in trade management:
Use the Laguerre line as a trailing stop for long positions in an uptrend.
Scale out of positions as the Laguerre value begins to flatten or reverse.
Use the Laguerre Filter to avoid trades when the market is in consolidation or lacks a clear trend.
Tuning Guidelines
The Laguerre Filter can be adjusted for different market conditions using the following parameters:
Gamma (Damping Factor): Adjust for the desired level of responsiveness versus smoothness. Typical values range from 0.7 to 0.85.
Filter Order: Adjust to control the level of smoothing. The default value of 4 is a good starting point, but higher orders can be used for smoother filters.
Summary
The Laguerre Filter is a versatile and adaptive trend-following indicator that smooths price data and reduces noise, making it easier to identify and follow trends. By using recursive smoothing techniques and adjustable parameters, the Laguerre Filter provides an accurate representation of market conditions with minimal lag. It is especially useful in volatile markets where traditional moving averages may fail to capture the underlying trend. With its color-coded trend detection, gradient fills, and customizable settings, the Laguerre Filter is a powerful tool for traders looking to stay aligned with the prevailing market direction.
Indicator

Kalman Hull Trend Score [BackQuant]Kalman Hull Trend Score
Overview
Kalman Hull Trend Score is a trend-strength and regime-evaluation indicator that combines two ideas, Kalman filtering and Hull-style smoothing, then measures persistence of that filtered trend using a rolling score. The goal is to produce a cleaner, more stable trend read than typical moving average tools, while still reacting fast enough to be practical in live markets.
Instead of treating a moving average as a simple line you cross, this indicator turns the filtered trend into an oscillator-like score that answers: “Is the smoothed trend consistently progressing, or is it stalling and degrading?”
Core idea
The indicator is built from two components:
A Kalman-based smoothing engine that estimates price state and reduces noise adaptively.
A Hull-style construction that uses multiple Kalman passes to create a responsive, low-lag trend filter.
Once the Kalman Hull filter is built, a persistence score is calculated by comparing the current Kalman Hull value to many past values. The result is a trend score that rises in sustained trends and compresses or flips during deterioration.
Why Kalman instead of standard smoothing
Traditional moving averages apply fixed smoothing rules regardless of market conditions. A Kalman filter behaves differently, it is designed to estimate an underlying state in noisy data, adjusting how much it “trusts” new price information versus prior estimates.
This script exposes that behavior through two key controls:
Measurement Noise: how noisy the observed price is assumed to be.
Process Noise: how much the underlying state is allowed to evolve from bar to bar.
Together, these settings let you tune the balance between smoothness and responsiveness without relying on blunt averaging alone.
Kalman filter mechanics (conceptual)
Each update cycle follows the classic structure:
Prediction: assume the state continues, and expand uncertainty by process noise.
Update: compute Kalman Gain, then blend the new price observation into the estimate.
Correction: reduce uncertainty based on how much the filter accepted the new information.
When measurement noise is higher, the filter becomes more conservative, smoothing harder. When process noise is higher, the filter adapts faster to regime changes, but can become more reactive.
Check out the original script:
Kalman Hull construction
The “Hull” component is not a standard HMA built from WMAs. Instead, it recreates the Hull idea using Kalman filtering as the smoothing primitive. The structure follows the same intent as HMA, reduce lag while keeping the line smooth, but does it with Kalman passes:
Apply Kalman smoothing over multiple effective lengths.
Combine them using the Hull-style weighting logic.
Run the combined output through another Kalman pass to finalize smoothing.
The result is a Kalman Hull filter that aims to track trend with less jitter than raw price, and less lag than slow averages.
Another Kalman Hull with Supertrend
Trend scoring logic
The trend score is computed by comparing the current Kalman Hull value to past Kalman Hull values over a fixed lookback range (1 to 45 bars in this script):
If current kalmanHMA > kalmanHMA , add +1
If current kalmanHMA < kalmanHMA , add -1
This produces a persistence score rather than a simple direction signal. Strong trends where the filter keeps advancing will accumulate positive comparisons. Weak trends, chop, or reversals will cause the score to flatten, decay, or flip negative.
Interpreting the score
Read the score as trend conviction and persistence:
High positive values: bullish persistence, the filtered trend is progressing consistently.
Low positive values: trend exists but is fragile, progress is slowing.
Near zero: indecision, range behavior, frequent challenges to structure.
Negative values: bearish persistence or sustained deterioration in the filtered trend.
The rate of change matters:
Score expansion suggests trend is gaining traction.
Score compression often signals consolidation or exhaustion.
Fast flips usually accompany regime transitions.
Signal thresholds and regime transitions
User-defined thresholds convert the score into regimes:
Long threshold: score must exceed this level to confirm bullish persistence.
Short threshold: a crossunder of the score triggers bearish regime transition.
This is intentionally conservative. Long bias is maintained while the score holds above the long threshold. Short transitions are event-triggered on breakdown via crossunder, helping avoid constant flipping during minor noise.
Signals are only plotted on regime changes (first bar of the flip), keeping them clean for alerts and backtests.
Visual presentation
The indicator provides multiple layers depending on how you want to use it:
Kalman Hull Trend Score oscillator, color-coded by active regime.
Optional Kalman Hull filter plotted on the price chart for structure context.
Optional threshold reference lines for quick regime mapping.
Optional candle coloring and background shading for instant readability.
You can run it as a pure score panel or as a combined panel + on-chart trend overlay.
How to use in practice
Trend filtering
Favor long setups when the score remains above the long threshold.
Reduce directional aggression when score compresses toward zero.
Treat a short-threshold breakdown as a regime risk event, not just a signal.
Trend quality assessment
Rising score supports continuation trades and adds confidence to breakouts.
Flat or falling score warns that trend persistence is fading.
If price trends but score fails to expand, trend may be weak or liquidity-driven.
Trade management
Use the Kalman Hull line as dynamic structure reference on chart.
Use score deterioration to scale out before a full regime flip.
Use regime flips as confirmation for bias shifts rather than prediction.
Tuning guidelines
Measurement Noise
Higher: smoother filter, fewer false shifts, slower to adapt.
Lower: more responsive, more sensitive to microstructure noise.
Process Noise
Higher: adapts quicker to sudden changes, but can become twitchy.
Lower: steadier state estimate, but slower during sharp regime transitions.
A practical approach is to first tune measurement noise until the Kalman Hull line matches the “clean trend structure” you want, then adjust process noise to control how quickly it reacts when the regime genuinely changes.
Summary
Kalman Hull Trend Score transforms a Kalman-based Hull-style trend filter into a quantified persistence oscillator. By combining adaptive Kalman smoothing with low-lag Hull logic and a rolling comparison score, it provides a cleaner read on trend quality than basic moving averages or single-condition trend tools. It is best used as a regime filter, trend strength gauge, and structure-aware trade management layer.
Indicator

Volatility Trend Score [BackQuant]Volatility Trend Score
Overview
Volatility Trend Score is a trend-strength and regime-evaluation indicator built to measure directional persistence, not just direction. Most trend tools answer “up or down” using slope, crossovers, or a single condition. This indicator answers a more useful question for real trading: “How consistently is trend structure holding up once volatility is accounted for?”
It does this by building a volatility-scaled trailing structure (ATR-based) and then scoring how that structure evolves over a configurable lookback range. The output is a continuous score that rises when trend is persistent and decays when price action becomes noisy, mean-reverting, or unstable.
What it is measuring (the real goal)
This indicator is not trying to predict reversals. It is trying to quantify whether the market is behaving like a trend market or a chop market. It focuses on:
Persistence: does structure keep pushing in one direction bar after bar?
Stability: are pullbacks being absorbed without breaking the trailing structure?
Regime: is the market trending strongly enough to justify directional bias?
If you already have entries from other systems, this becomes a high-quality trend filter and trade management layer.
Core idea
At its foundation, the indicator combines two parts:
A volatility-adjusted trailing level derived from ATR and a user-defined factor.
A rolling persistence score that compares the current trail to prior trail values over a configurable loop window.
The trailing structure adapts to volatility and enforces one-sided movement, while the scoring logic converts that behavior into a numeric measure of trend quality.
Inputs and what they actually control
Average True Range Period (calc_p)
Defines the ATR window used to estimate volatility. A higher value smooths the volatility estimate and makes the trailing structure less reactive.
Factor (atr_factor)
Scales the ATR band size. Higher values widen the trailing band, filtering more noise, reducing flip frequency, and generally producing slower but more stable regimes.
For Loop Start/End (start/end)
Defines the comparison window used to build the score. It effectively sets how many historical trail values the current trail is compared against.
Shorter ranges produce a faster, more responsive score.
Longer ranges produce a slower, more “confidence-based” score that only climbs when trend persistence is sustained.
Long/Short Thresholds (thresL/thresS)
Convert a continuous score into regime thresholds.
Long threshold is a “trend quality requirement” for bullish bias.
Short threshold is used as a deterioration / breakdown trigger via crossunder logic.
Volatility-adjusted trailing structure
The trailing line is built from ATR bands around price:
up = close + ATR * factor
dn = close - ATR * factor
Then a trailing value is maintained with one-sided ratcheting behavior:
If dn rises above the previous trail, the trail steps up (ratchets upward).
If up drops below the previous trail, the trail steps down (ratchets downward).
This “ratchet” behavior is important. It prevents the trail from oscillating with small countertrend moves, forcing the trail to represent meaningful structure rather than micro-noise. On-chart, this trail often behaves like dynamic support/resistance in trends.
Why the trail is a better base than raw price
Price itself is noisy, and volatility changes the meaning of “big move” vs “small move.” By anchoring structure to ATR:
A move is interpreted relative to current volatility, not in absolute points.
High-volatility chop is less likely to be misread as a trend.
Trend structure is normalized across assets and timeframes more reliably.
This is why the score remains usable even when switching from low-vol assets to high-vol crypto pairs.
Trend scoring logic
The score is built by repeatedly comparing the current trailing value to trailing values from prior bars across a loop window:
If current trail > trail , add +1
If current trail < trail , add -1
This is a persistence test, not a momentum calculation. In a strong trend, the trail should generally keep stepping in the trend direction, so current values will be greater than many past values (bullish) or lower than many past values (bearish). In chop, the trail fails to progress meaningfully, so the score compresses, oscillates, or bleeds out.
How to interpret the score
Think of the score as a “trend conviction meter”:
High positive values: bullish persistence, structure is advancing consistently.
Low positive values: bullish bias may exist, but trend quality is weak or unstable.
Near zero: indecision, range behavior, or frequent structure challenges.
Negative values: bearish dominance or sustained deterioration in structure.
The speed of score change matters too:
Fast expansion suggests a fresh regime gaining traction.
Slow grind suggests mature trend continuation.
Rapid compression often signals consolidation, exhaustion, or a transition phase.
Signals and regime transitions
This script uses two different styles of conditions (important detail):
Long condition: score > long threshold (state-based, persistent while true).
Short condition: crossunder(score, short threshold) (event-based trigger).
That means:
Long bias can remain active as long as score stays above the long threshold.
Short regime flips are triggered at the moment the score breaks down through the short threshold.
On the chart, long/short shapes are only plotted when the regime flips (first bar of the change), not on every bar, using:
Long shape when signal becomes 1 and previous signal was -1
Short shape when signal becomes -1 and previous signal was 1
This keeps signals clean and avoids spam, making it usable for alerts and regime tagging.
Visual presentation
The indicator is designed to work both as a panel oscillator and as an on-chart overlay:
Score plot (oscillator): color reflects active regime state.
Optional trail on price: volatility-scaled structure line on chart.
Optional threshold reference lines: clear regime boundaries.
Optional candle coloring: makes regime obvious without reading the panel.
Optional background shading: useful for quick scanning and backtesting visually.
You can use only the score, only the trail, or both together depending on your workflow.
Practical use cases
1) Trend filter for systems
Use the score as a regime gate:
Allow long entries only when score is above the long threshold.
Avoid longs when score compresses toward zero or loses the threshold.
Treat the short threshold break as “trend is no longer healthy.”
This often improves system expectancy by reducing exposure during low-conviction conditions.
2) Trend quality grading
Instead of treating all uptrends as equal:
Higher score = higher persistence, better continuation odds.
Score plateau = trend losing pressure, continuation becomes less reliable.
Score decay while price rises = trend is getting weaker under the hood.
This is useful for position sizing or deciding whether to add to winners.
3) Trade management and exits
Two complementary tools exist here:
Trail line can act as a dynamic stop reference or structure invalidation level.
Score behavior can be used to scale out when persistence fades (before a full flip).
Many traders use the trail for “hard structure” and the score for “soft deterioration.”
4) Breakout confirmation vs fakeouts
A breakout that immediately fails to build score is often low quality.
Healthy breakouts usually come with score expansion as structure advances.
Fakeouts often revert quickly, score fails to climb, and regime stays unstable.
Tuning guidelines
These are general behaviors you can expect when adjusting settings:
Higher ATR period and factor: slower regimes, fewer flips, cleaner structure.
Lower ATR period and factor: faster reaction, more sensitivity, more noise risk.
Longer loop range: score becomes more “confidence-based,” slower to change.
Shorter loop range: score becomes more “tactical,” faster but more jittery.
A good way to tune is to pick the trail behavior first (ATR period and factor), then tune the score window (loop) to match how quickly you want “trend conviction” to build.
Market behavior focus
Volatility Trend Score is most valuable in markets where volatility shifts frequently and fake trends are common, especially crypto. It is designed to:
Stay out of low-quality chop where most indicators whipsaw.
Quantify when volatility is being expressed directionally (constructive trend).
Provide a clean regime framework for filtering, alignment, and management.
Summary
Volatility Trend Score converts volatility-adjusted structure into a quantified measure of trend persistence. By combining an ATR-based trailing mechanism with a rolling comparison score, it provides a more reliable read on trend quality than single-condition indicators. It is best used as a regime filter, a trend strength gauge, and a trade management layer, helping you stay aligned with strong directional phases while avoiding low-conviction envir
Indicator

Zero-Lag ATR Trend [BackQuant]Zero-Lag ATR Trend
Overview
Zero-Lag ATR Trend is a volatility-adaptive trend-following overlay designed to identify directional market regimes with minimal delay while preserving structural clarity. The indicator combines a zero-lag moving average framework with a zero-lag volatility model to produce a trailing trend line that reacts quickly to meaningful price changes without becoming unstable or overly sensitive.
Unlike conventional ATR-based trend tools that rely on lagging averages and delayed volatility estimates, this indicator applies zero-lag logic to both the trend centerline and the volatility calculation. The result is a trend structure that aligns more closely with real-time price action while still maintaining the discipline required for trend continuation trading.
Core design philosophy
The core idea behind Zero-Lag ATR Trend is simple:
Reduce signal delay without sacrificing trend integrity.
Adapt dynamically to changing volatility regimes.
Provide a single, clean structure that defines trend direction, continuation, and invalidation.
Instead of stacking multiple indicators, the script builds a complete trend framework from two tightly integrated components: a zero-lag trend spine and a zero-lag ATR trailing mechanism.
Zero-lag trend spine
The trend spine is constructed using a zero-lag moving average (ZLMA). This is achieved by applying a corrective step to a traditional moving average, effectively compensating for smoothing delay.
Conceptually, the process works as follows:
A base moving average is calculated from the selected price source.
That moving average is then passed through a zero-lag correction.
The correction pulls the line closer to current price without introducing noise.
This produces a trend line that reacts faster than standard EMA, SMA, or HMA signals, particularly during early trend acceleration phases. Multiple moving-average types can be used inside the zero-lag framework, allowing traders to fine-tune responsiveness based on asset behavior and timeframe.
Zero-lag volatility model
Volatility is measured using True Range, but instead of applying classic ATR smoothing, the indicator uses a zero-lag smoothing pass on the True Range itself.
This approach offers several advantages:
Volatility expands more quickly during impulse moves.
Volatility contracts faster during consolidations.
Band width adjusts in near real-time to changing conditions.
The smoothed zero-lag ATR is multiplied by a user-defined factor to create adaptive upper and lower boundaries around the trend spine. These boundaries define how much counter-movement price is allowed before the trend structure is invalidated.
Volatility-aware trailing structure
The trailing output is the defining feature of the indicator. It behaves as a one-directional trailing structure:
In bullish conditions, the trailing line can only move upward.
In bearish conditions, the trailing line can only move downward.
Minor pullbacks inside the volatility envelope do not flip the trend.
This logic prevents the indicator from reacting to shallow retracements and focuses instead on structural trend changes. Because the trailing behavior is volatility-scaled, the indicator remains stable during high volatility while still responding promptly during regime shifts.
Trend flips and regime transitions
Trend direction is determined by changes in the trailing structure itself rather than raw price crosses. A trend flip occurs only when price movement is strong enough, relative to current volatility, to force the trailing line to reverse direction.
This means:
Bullish flips represent genuine transitions into upward regimes.
Bearish flips represent genuine transitions into downward regimes.
Sideways noise is largely filtered out.
As a result, the indicator is well suited for identifying medium-to-long trend phases rather than short-term oscillations.
Visual structure and chart clarity
The visual design is intentionally minimal and functional:
The main trailing line is color-coded by trend direction.
An optional ribbon or cloud reinforces directional bias.
Optional candle coloring aligns price bars with the active trend.
These elements allow traders to assess trend state instantly without interpreting multiple signals or overlays.
How to use for trend following
Trend bias
Maintain a bullish bias while price holds above the trailing line.
Maintain a bearish bias while price holds below the trailing line.
Entries
Trend flips can be used as initial directional entries.
Pullbacks toward the trailing line often act as continuation opportunities.
Momentum confirmation can be layered on top for additional confluence.
Trend management
The trailing line naturally functions as a dynamic stop reference.
As long as price respects the trailing structure, the trend remains valid.
A flip in direction signals a full regime transition rather than a minor correction.
Why zero-lag matters for trend trading
Traditional trend indicators often react late, especially during fast expansions, resulting in delayed entries and early exits. By reducing lag in both the trend calculation and the volatility model, Zero-Lag ATR Trend aims to capture a larger portion of directional moves while maintaining consistency and discipline.
This makes it particularly effective for momentum-based trend following, breakout continuation strategies, and traders who prioritize staying aligned with dominant market structure rather than predicting reversals.
Summary
Zero-Lag ATR Trend is a complete trend-following framework built around responsiveness, adaptability, and clarity. Its zero-lag architecture allows it to respond earlier to meaningful price changes, while its volatility-aware trailing logic ensures that trends are only invalidated when structure truly breaks. The result is a clean, intuitive tool that supports disciplined trend participation across assets and timeframes.
Indicator
