Directional PurityDirectional Purity
Rather than a simple standalone strategy, Directional Purity is a professional trend-filtering and directional stability engine designed to supercharge any existing trading strategy. It eliminates the fatal flaw of traditional indicators like ADX—which measure trend strength with significant lag—by equipping your strategy with a zero-lag, mathematically precise gauge of directional purity.
Traditionally, ADX relies on double-smoothed EMAs of directional movements, causing delayed responses to trend breakouts and exhaustion. Directional Purity resolves this by using the mathematical equivalence of Chande's CMO and Kaufman's Efficiency Ratio (ER) as a volatility index to dynamically adapt a 13-period VIDYA (Variable Index Dynamic Average) base.
By utilizing a telescoping sum optimization, this script is fully vectorized (loop-free), ensuring extremely fast execution on any time frame.
Features:
- Live Dashboard: Shows real-time market state (Trending Bullish, Trending Bearish, Ranging) and Trend Purity %.
- Visual Fills: Highlights ranging zones in gray to prevent overtrading.
- Built-in Alerts: Triggers for trend breakouts, entering ranges, and direction shifts.
``` Indicator

Zero Lag CVD, RSI & Stochastic Divergence (All-in-One) [D4A]Zero Lag CVD, RSI, Stochastic Divergence
Overview
Zero-Lag Divergence indicator is designed to identify bullish and bearish divergences as they happen, without relying on traditional pivot confirmation delays. By comparing price action with output of CVD, RSI and Stochastic across two independent detection periods, the indicator helps traders spot potential trend exhaustion and reversal opportunities earlier than conventional divergence tools.
How is this indicator different from other similar tools?
- Provides real-time non-repainting divergence signals for CVD, RSI and Stochastic in one convenient script
- Provides instant and separate divergence signals for one of the three oscillators (CVD, RSI, Stochastic), combination of two oscillators or combination of all three (Agreement Mode), thus marking double or triple confirmation of discrepancy between the price, momentum and volume, signalling potentially important reversal zone.
- To maximize probability of validity of the signal, the user can configure overbought and oversold conditions for both momentum oscillators (RSI & Stochastic) to filter only the strongest signals.
- To keep chart clutter under control the tool combines divergence labels into one common label in Agreement Mode
- The indicator tracks divergence simultaneously using two different and configurable periods (short- and long-term divergence) thus allowing to track shorter and longer periods for possible divergences while using only one timeframe
- Displays all signals directly on the chart - no need for additional panel below or above the chart
- All three oscillators can be independently configured, eg. signal length, smoothing, overbought and oversold levels.
Bullish Divergence Logic
Occurs when price forms a lower low while oscillator forms a higher low, suggesting weakening bearish momentum (volume) and the possibility of an upward reversal.
Bearish Divergence Logic
Occurs when price forms a higher high while oscillator forms a lower high, indicating weakening bullish momentum (volume) and the potential for a downward move.
Why Zero-Lag?
Most divergence indicators require future candle confirmation before displaying a signal. This indicator prioritizes immediacy by highlighting potential divergences as they form, allowing traders to react sooner to developing momentum shifts.
While this approach can generate earlier opportunities, it may also create false signals and market noise. For best results, consider combining divergence signals with trend analysis, support and resistance levels, volume studies, or additional confirmation tools.
Notes
* Signals are non-repainting once generated.
* Earlier detection may result in more frequent signals compared to traditional pivot-confirmed divergence indicators.
* Suitable for stocks, forex, cryptocurrencies, indices, and other liquid markets.
* Can be used on any timeframe, from intraday trading to higher-timeframe swing analysis.
SETTINGS
- Zero-Lag Divergence - enable the display of signals
- Mode - select for which oscillator should divergence signals be plotted:
CVD - Cumulative Volume Delta
RSI - Relative Strength Index
Stochastic - Momentum oscillator
Agreement - two or three indicators agree at the same time (same candle)
- Minimum Agreement - how many indicators should agree at the same time: Any Two or Any Three
- Cumulative Volume Delta Length
- RSI Length, OB (overbought) level , OS (oversold) level. OB and OS levels can be used to select more extreme zones to find divergence (stronger signals).
- Stochastic: %K and Smoothing settings, as well as OB and OS settings (work similar to RSI logic)
- Show Labels - show labels on the chart
- Bullish Label - can be set and color coded for different indicators
- Bearish Label - can be set and color coded for different indicators
- All Oscillators Agree - displays label when all three oscillators generate divergence signals at the same time
- RSI + Stochastic - displays label when both RSI and Stochastic agree at the same time
- CVD + Stochastic - displays label when both CVD and Stochastic agree at the same time
- CVD + RSI - displays label when both CVD and RSI agree at the same time
- RSI Divergence Label only if RSI >=OB or RSI <= OS - display the label only when RSI divergence signals are detected at user-defined overbought or oversold levels
- Stochastic Divergence Label only if Stochastic >=OB or Stochastic <= OS - display the label only when Stochastic divergence signals are detected at user-defined overbought or oversold levels
- Show Lines - draw lines between divergence points.
- Short Period - define the 1st period for which divergence is detected
- Long Period - define the 2nd period for which divergence is detected
- Distance Multiplier & ATR - used to position the labels at specific distance from divergence point
What is CVD?
CVD measures the cumulative difference between buying and selling volume. A rising CVD indicates more buying pressure, while a falling CVD indicates more selling pressure. Divergence occurs when the price action contradicts the CVD's direction, suggesting a potential shift in momentum or trend reversal.
What is RSI?
The relative strength index (RSI) is a momentum indicator used to measures the speed and magnitude of a asset's recent price changes to detect overbought or oversold conditions.
What is Stochastic?
Trading View definition: Stochastic Oscillator (STOCH) is a range bound momentum oscillator. The Stochastic indicator is designed to display the location of the close compared to the high/low range over a user defined number of periods. Typically, the Stochastic Oscillator is used for three things; Identifying overbought and oversold levels, spotting divergences and also identifying bull and bear set ups or signals.
-----------------
Disclaimer
The content provided in this script is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indicator

Kalman Auction Ribbon [JOAT]Kalman Auction Ribbon is an open-source Pine Script v6 overlay that builds a six-layer adaptive ribbon from a zero-lag source and Kalman-style velocity smoothing. The goal is to show trend alignment, slope strength, deviation zones, and confirmed retest behavior in one restrained chart layer.
The script focuses on auction behavior around a dynamic ribbon. When the ribbon layers align and slope together, the state becomes directional. When price stretches beyond the deviation envelope and then returns, the script can mark supply or demand zones for later retests.
Core Concepts
1. Zero-Lag Source
The source is adjusted by comparing current price with a half-length historical value. This produces a more responsive input for the ribbon calculations.
zeroLagOffset = math.max(1, int(math.round(baseLength * 0.50)))
zeroLagSource = src + (src - nz(src , src))
2. Kalman-Style Velocity Estimate
Each ribbon layer uses a compact velocity smoother that maintains an estimate and speed component. The speed term helps the estimate respond to directional movement without relying on future bars.
prior = na(estimate ) ? value : estimate + nz(speed ) * gain
error = value - prior
speed := nz(speed ) * (1.0 - alpha * 0.50) + error * alpha * gain
estimate := prior + error * alpha
3. Six-Layer Ribbon Alignment
The script calculates six different ribbon lengths. Alignment and slope scores are combined into a trend score from -100 to +100. This score controls the ribbon color and dashboard power reading.
4. Deviation Zones
Upper and lower deviation levels are built around the ribbon midpoint using ATR. If price pushes beyond a deviation level and closes back inside, the script creates a compact supply or demand zone.
5. Retest Logic
Retest signals occur when price interacts with a live zone or the ribbon itself while the ribbon state remains directional. These signals are confirmed on closed bars.
Features
Six-layer adaptive ribbon: Multiple Kalman-style layers reveal alignment and spread
Velocity weighting: Gain input changes how aggressively the smoother responds
Deviation envelope: ATR-based upper and lower zones around the ribbon midpoint
Soft supply and demand boxes: Created only on confirmed deviation rejection behavior, with overlap suppression so the chart does not stack redundant boxes
Labeled deviation boxes: Supply and Demand Deviation boxes include midpoint guide lines and fade after invalidation
Confirmed buy/sell markers: Compact BUY and SELL dots appear only after confirmed ribbon or zone retest behavior
Trend-state candles: Optional bar coloring by ribbon state
Dashboard: Shows state, power, distance, and retest status
Alerts: Confirmed buy, confirmed sell, lower deviation zone, and upper deviation zone
Input Parameters
Core:
Source: Price source used by the ribbon
Base Length: Main length from which all ribbon layers are derived
Velocity Weight: Strength of the speed component
Deviation ATR Length: ATR length for deviation zones
Deviation Width: ATR multiplier for the envelope
Zones:
Show Deviation Zones: Toggles supply and demand boxes
Zone Extension Bars: How far active boxes extend to the right
Maximum Zones Per Side: Caps active supply and demand boxes
Signals:
Show Confirmed Buy/Sell: Toggles compact confirmed signal dots
Signal Spacing Bars: Minimum spacing between signal markers
Zone Extension Bars: Forward box extension length
Maximum Zones Per Side: Object cap for zone storage
Visual:
Palette: Selects the color pair
Show Ribbon: Toggles ribbon plots and fill
Trend-State Candles: Enables candle coloring
Dashboard: Shows the top-right panel
How to Use This Indicator
Step 1: Read Ribbon Alignment
A strongly stacked ribbon with a high dashboard power value indicates directional alignment. A mixed ribbon shows a less decisive state.
Step 2: Watch Deviation Zones
Zones are created when price rejects beyond an ATR deviation envelope. These boxes represent areas where price stretched away from the ribbon and returned.
Step 3: Use Retests With Context
Retest dots identify confirmed interactions with the ribbon or zones. They should be evaluated with trend state, market structure, and risk placement.
Indicator Limitations
Kalman-style smoothing is reactive and does not know future price direction
Strong news bars can move through deviation zones without meaningful retests
Object limits require older zones to be removed when the maximum is exceeded
The ribbon can compress during range conditions and produce mixed readings
Originality Statement
Kalman Auction Ribbon is original in its combination of zero-lag preprocessing, six independent Kalman-style layers, ATR deviation boxes, and confirmed retest tracking. It uses public Pine primitives in a custom structure and does not paste or disguise another author's source.
Disclaimer
This script is provided for educational and informational use only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Ribbon states and zones can fail during unusual volatility or thin liquidity. Always use independent analysis and proper risk management.
-Made with passion by jackofalltrades
Indicator

Momentum Pulse | AnonycryptousMomentum Pulse | Anonycryptous
Description & user manual
Why this indicator is different
Standard momentum indicators give you one line. RSI tells you whether the market is overbought or oversold at one specific lookback period. MACD tells you whether one moving average is pulling away from another. One perspective. One answer.
The problem is that momentum does not exist at one lookback period. A 14-period RSI can be flat while a 7-period RSI is already reversing. A 21-period RSI can still be bullish while the fast momentum has already rolled over. By looking at one line you are always missing what is happening at adjacent timescales — and those are precisely where the early signals live.
Momentum Pulse works differently.
Instead of one RSI it runs twenty simultaneously, each at a different lookback period. The shortest strand captures the fastest momentum shifts. The longest strand reflects the slower, sustained trend. Together they form a ribbon — a fluid, living visualization of where momentum is coming from, where it is heading, and how much agreement exists across timescales.
The ribbon does not just show direction. It shows compression and expansion. When the strands fan out, momentum is building with conviction. When they compress, the market is coiling — and that compression often precedes the next directional move. When the fast strands lead the slow strands, the trend has energy behind it. When they cross or collapse toward each other, momentum is fading before it is visible in price.
This is momentum before the move.
Important notice
Momentum Pulse is provided for analytical and educational purposes only.
It does not generate trading signals.
It does not predict market direction.
It does not guarantee any outcome.
All trading decisions remain entirely with the user.
Always apply your own judgment and manage your own risk.
1. Overview
Momentum Pulse is a twenty-strand RSI ribbon oscillator built on RSI processed through zero lag EMA smoothing. It maps momentum across twenty simultaneous lookback periods and visualizes the full structure of momentum strength, direction, compression, and divergence in a single pane.
What it includes:
- Twenty RSI strands normalized to a −50 to +50 scale around a zero midline
- Zero lag EMA smoothing applied per strand to reduce response lag
- Fast and slow group averaging with spread-based trend detection
- Twist/Squeeze detection when fast and slow groups compress below the threshold
- Momentum histogram showing the distance between fast and slow group averages
- Ribbon slope line showing the rate of change of the fast group average
- Divergence detection comparing price pivots with fast group momentum pivots
- Three presets: default for swing, fast for scalping, smooth for position trading
- Live dashboard showing momentum state, averages, spread, twist, zone, slope, and divergence
- Six alert conditions covering state changes, compression, and divergence events
2. Core components
2.1 RSI strands
Twenty RSI calculations run simultaneously, each at a different lookback period. The first strand uses the base length. Each subsequent strand adds the length step, spreading the ribbon from fast to slow momentum perspectives. All values are normalized to a −50 to +50 scale around a zero midline, making every strand directly comparable regardless of its period.
2.2 Zero lag EMA smoothing
Each RSI strand is smoothed using a zero lag EMA. Standard EMA smoothing introduces lag because it weights recent bars less than current price. ZLEMA compensates by incorporating the momentum of recent change before applying the average — the ribbon reacts to momentum shifts on the current bar, before the move has confirmed on price.
2.3 Fast and slow group trend detection
The ribbon is divided into two groups. The fast group uses strands one through five — the shortest lookback periods. The slow group uses strands sixteen through twenty — the longest. When the fast group average is above the slow group average, momentum is bullish. When it is below, momentum is bearish. When the spread between the two groups falls below the twist threshold, the oscillator enters a Twist/Squeeze state.
This logic is independent of overbought and oversold levels and works reliably in all market conditions.
2.4 Momentum histogram
The histogram plots the distance between the fast and slow group averages near the zero midline. Wide bars indicate strong momentum separation — the trend has conviction. Narrow bars indicate the ribbon is compressing — momentum is fading or transitioning.
2.5 Ribbon slope
The slope line measures the rate of change of the fast group average over a configurable number of bars. A rising slope indicates momentum is accelerating into the trend. A falling slope indicates momentum is decelerating, a possible sign of exhaustion. A flat slope indicates consolidation or a transition that has not committed to a direction.
2.6 Divergence detection
The indicator compares recent price pivots against fast group average pivots over a configurable lookback window. A bullish divergence fires when price makes a lower low but the fast group average holds higher — hidden strength beneath the surface. A bearish divergence fires when price makes a higher high but the fast group average rolls over — hidden weakness. Both conditions trigger a background flash on the pane.
3. Presets
Three preset configurations are available. Selecting a preset overrides the core calculation parameters.
-Default — swing trading on 4H and daily charts
RSI base 10 | ZLEMA 5 | step 2 | twist threshold 1.5
Balanced ribbon for trend following and swing setups across most market conditions.
-Fast — scalping on 1 minute to 15 minute charts
RSI base 7 | ZLEMA 3 | step 2 | twist threshold 1.0
Shorter periods and a tighter twist threshold for early detection of momentum shifts and reversals before they appear in price.
-Smooth — position trading on daily and weekly charts
RSI base 14 | ZLEMA 8 | step 3 | twist threshold 2.5
Wider spread and longer periods. Only high-conviction momentum moves register. Filters out intraday noise.
4. Visual guide
Ribbon fanning upward — bullish momentum expanding across multiple timescales.
Ribbon fanning downward — bearish momentum expanding.
Ribbon compressing toward center — Twist/Squeeze state, potential breakout building.
Grey background shading — active Twist/Squeeze state.
Green background flash — bullish breakout bar, ribbon exiting compression.
Red background flash — bearish breakout bar.
Warm/orange flash — bullish divergence detected.
Red dim flash — bearish divergence detected.
Green circle at oversold — bullish signal condition.
Red circle at overbought — bearish signal condition.
Histogram bars — momentum strength between fast and slow groups. Wide = strong trend. Narrow = compression.
Slope line — acceleration or deceleration of fast group momentum.
5. Dashboard reference
The dashboard provides live readings across all components.
Momentum — current ribbon state: bullish, bearish, or twist.
Fast avg — average of the five fastest strands.
Slow avg — average of the five slowest strands.
Spread — distance between fast and slow group averages.
Twist — whether the ribbon is compressed below the twist threshold.
Zone — whether the ribbon is extended, compressed, or neutral relative to overbought/oversold levels.
Slope — momentum acceleration state: accel, decel, or flat.
Divergence — active bullish divergence, bearish divergence, or none.
Signal — last signal fired.
6. Alerts
Six alert conditions are available:
- Bullish: ribbon flips to bullish state.
- Bearish: ribbon flips to bearish state.
- Twist: ribbon enters Twist/Squeeze compression.
- Bullish divergence: price makes a lower low while momentum holds higher.
- Bearish divergence: price makes a higher high while momentum weakens.
- Any change: fires on any of the above transitions.
All alerts include exchange, ticker, and interval in the message.
7. Settings reference
Calculation parameters
- Source: price input for RSI calculations
- Base length: lookback period for the fastest ribbon strand
- Length step: increment between each subsequent strand
- RSI length: base RSI period for all strand calculations
- ZLEMA length: zero lag EMA smoothing period per strand
- Twist threshold: minimum spread required to declare a trend; below this = Twist/Squeeze
- Divergence lookback: window for comparing price and momentum pivots
- Slope length: bars used to calculate ribbon acceleration
- Preset: default, fast, or smooth
Visualization settings
- Color preset: classic (green/red) or custom
- Bullish, bearish, and twist/squeeze colors
- Min transparency: opacity of the fastest (leading) strand
- Max transparency: opacity of the slowest (lagging) strand
Level settings
- Overbought level: reference line (does not affect trend logic)
- Oversold level: reference line (does not affect trend logic)
Dashboard settings
- Show dashboard
- Dashboard size: tiny, small, or normal
8. How to use
8.1 Lower timeframes (1 minute to 15 minutes)
Use the fast preset. Monitor the ribbon for compression before expansion — Twist/Squeeze states often precede directional moves. A rising slope combined with bullish ribbon expansion confirms momentum is accelerating. A divergence forming while the ribbon is still in compression indicates a directional move is building before it appears in price.
Only take bullish setups when the ribbon is bullish or just exiting a Twist state with a rising slope and no active bearish divergence. Only take bearish setups with the reverse conditions.
8.2 Higher timeframes (1H, 4H, daily)
Use the default preset on 1H and 4H. Use the smooth preset on daily and weekly charts.
A wide, sustained ribbon fan on higher timeframes confirms momentum has conviction. Ribbon compression while price action narrows indicates trend exhaustion — consider reducing exposure and waiting for re-expansion. Divergence on daily charts carries significant weight and should be treated as a major reversal warning.
8.3 Dashboard reading guide
Slope accel + momentum bullish — trend strengthening, momentum building.
Slope decel + momentum bullish — trend weakening, watch for reversal.
Divergence bear + trend bullish — exit warning, confluence fading.
Twist yes + spread narrowing — breakout setup forming, wait for direction.
8.4 Standalone use
Momentum Pulse works as a standalone oscillator for any strategy or existing indicator setup. The ribbon provides directional momentum bias. The divergence detector flags hidden reversals before they appear in price. The slope line shows whether momentum is building or fading. The histogram confirms trend strength between fast and slow groups. No other indicator is required.
9. Disclaimer
This indicator is provided for educational and informational purposes only.
All outputs are based on historical price action calculations and do not guarantee future results.
Trading financial instruments involves significant risk of loss.
Past performance does not indicate future results.
Use at your own discretion.
Indicator

Zero Lag Kalman Structure [BOSWaves]Zero Lag Kalman Structure - Adaptive Trend Filtering with Deviation-Based Structure Detection
Overview
Zero Lag Kalman Structure is a precision trend identification system that tracks directional price movement through a zero-lag-compensated Kalman filter ribbon, where deviation-based structural levels dynamically form at volatility-normalized extremes and persist as active support and resistance zones until price invalidates them.
Instead of relying on fixed moving average crossovers or static support/resistance lookbacks, trend state, level formation, and break detection are determined through Kalman velocity tracking, ATR-normalized deviation measurement, and swing-based structure identification.
This creates adaptive trend boundaries and structural zones that reflect actual price conviction rather than arbitrary historical levels - contracting the ribbon during trending conditions when directional certainty is high, forming fresh levels during deviation extremes when price has meaningfully separated from the Kalman baseline, and incorporating BOS/CHoCH detection to reveal whether market structure is continuing or reversing.
Price is therefore evaluated relative to a filter that adapts to momentum velocity rather than conventional lagging averages.
Conceptual Framework
Zero Lag Kalman Structure is founded on the principle that meaningful structural zones emerge when price deviates from its statistically optimal estimated path by a volatility-significant margin, and that trend context is best captured by a filter engineered to eliminate the lag inherent to traditional smoothing methods.
Conventional support/resistance tools identify levels through historical pivot lookbacks, which ignore the dynamic nature of price conviction and the statistical state of the current trend. This framework replaces static pivot logic with Kalman-anchored deviation measurement informed by actual filter velocity and error covariance state.
Three core principles guide the design:
Trend direction should be captured by a velocity-aware Kalman filter with active lag compensation, not by lagging moving averages.
Structural levels must form at statistically significant deviation extremes, normalized to current volatility rather than fixed price distances.
Market structure breaks and character changes should be identified through swing-based logic tied to the same price data the filter operates on.
This shifts trend and structure analysis from static indicator crossovers into adaptive, filter-anchored confidence zones.
Theoretical Foundation
The indicator combines Kalman filter estimation theory, zero-lag error compensation, ATR-normalized deviation measurement, deviation zone persistence modeling, and swing pivot structure detection.
A Kalman filter baseline provides statistically optimal price estimation by balancing process noise and measurement noise parameters, while a velocity tracker within the filter captures directional momentum. Zero-lag compensation applies the residual error between current price and the filter estimate back onto the output, reducing phase delay. Deviation measurement identifies when price has separated from the filter by an ATR-scaled threshold, triggering level creation at the extreme point once price snaps back. BOS/CHoCH detection uses pivot highs and lows to identify structural breaks and character changes.
Four internal systems operate in tandem:
Kalman Filter Engine : Computes error-covariance-weighted price estimates with integrated velocity tracking, Kalman gain adaptation, and zero-lag correction applied to each bar.
Ribbon Construction System : Runs six parallel Kalman instances with incrementally increasing process noise to produce a multi-layered trend ribbon whose spread and color reflect directional strength.
Deviation Level Formation Logic : Monitors ATR-normalized distance from the Kalman estimate, records extreme highs and lows during deviation events, and creates persistent zone boxes upon mean reversion.
Market Structure Detection : Tracks swing pivot highs and lows using configurable lookback, identifies crossovers of those pivots, and classifies each break as either a BOS continuation or a CHoCH reversal depending on prior structural trend.
This design allows the trend filter, structural zones, and structure labels to operate as a unified system rather than independent overlapping indicators.
How It Works
Zero Lag Kalman Structure evaluates price through a sequence of filter-aware and deviation-driven processes:
Kalman State Initialization : On the first bar, filter state initializes with estimate equal to source price, zero velocity, and unit error covariance to establish a clean starting condition.
Prediction Step : Each bar predicts the next estimate by advancing the prior estimate by the velocity component weighted by the velocity weight parameter.
Velocity Tracking : A separate exponential tracker computes price-change velocity using a 95/5 blend of decayed prior velocity and current bar price change.
Kalman Gain Calculation : Gain is computed from current error covariance and measurement noise, controlling the balance between trusting the filter model versus reacting to new price data.
Estimate Update : The filtered estimate updates using the Kalman gain applied to the innovation - the difference between current price and the predicted estimate.
Zero-Lag Correction : Residual lag error between price and estimate is computed, then multiplied by the zero lag factor and current Kalman gain, and added back to the estimate to compress phase delay.
Ribbon Smoothing : The zero-lag estimate passes through a 0.8/0.2 exponential blend each bar to produce the final ribbon line, providing continuity without reintroducing significant lag.
Ribbon Color Gradient : The spread between the fastest and slowest ribbon lines is normalized by ATR to produce a ribbon strength value, which drives a color gradient between the configured bullish and bearish colors.
Deviation Monitoring : Each bar, the distance between close and the main Kalman line is measured in ATR units. When this exceeds the deviation threshold, the system begins tracking the extreme high or low of that deviation event.
Level Creation on Snap-Back : Once price returns inside 50% of the deviation threshold after an extended move, a new zone box is created centered on the tracked extreme, with width scaled to the level width ATR parameter.
Level Management : Active levels extend forward each bar. Broken levels - where price closes beyond the zone boundary - are deleted. When the level count reaches the configured maximum, the oldest level is removed to make space.
Retest Detection : Depending on the selected retest method, the system either monitors price interaction with zone boundaries or price proximity to the main Kalman line, applying cooldown periods to prevent signal clustering.
BOS/CHoCH Detection : Pivot highs and lows are tracked using the swing lookback parameter. Crossovers of the most recent pivot high trigger bullish structural breaks, and crossunders of the most recent pivot low trigger bearish structural breaks. The prior structural trend determines whether each break is classified as continuation (BOS) or reversal (CHoCH).
Together, these elements form a continuously updating trend and structure framework anchored in Kalman estimation theory.
Interpretation
Zero Lag Kalman Structure should be interpreted as a filter-anchored trend state with deviation-driven structural memory:
Ribbon Direction : The relative positioning and color of the six-line ribbon communicates directional trend bias. Bullish gradient color with spread above zero reflects upward trend conviction; bearish gradient with inverted spread reflects downward conviction.
Ribbon Spread Width : A widening spread between the fastest and slowest Kalman lines indicates strong directional momentum. A compressing spread suggests trend deceleration or potential transition.
Resistance Zones (Red) : Created at extreme highs where price deviated significantly above the Kalman line before snapping back, marking areas where price showed unsustainable separation to the upside.
Support Zones (Green) : Created at extreme lows where price deviated significantly below the Kalman line before recovering, marking areas where price showed unsustainable separation to the downside.
Zone Persistence : Active zones extend forward until broken by a close beyond the zone boundary, treating them as live structural reference until price demonstrably invalidates them.
BOS Labels : Dashed lines with "BOS" text mark continuation breaks of prior swing structure in the direction of the established trend.
CHoCH Labels : Dotted lines with "CHoCH" text mark counter-trend breaks of prior swing structure, signaling potential trend character changes.
▲ / ▼ Retest Signals : Small directional arrows identify price retesting either a deviation zone boundary or the main Kalman line, depending on the selected retest method.
Colored Candles : Bar coloring reflects the current ribbon gradient state for immediate directional reference across the entire chart history. Note: The original chart candles must be disabled in chart settings for the trend-colored candles to display properly.
Ribbon gradient strength, zone validity, and structural trend classification outweigh isolated price movements or individual bar reactions.
Signal Logic & Visual Cues
Zero Lag Kalman Structure presents two categories of structural interaction signals:
BOS / CHoCH Events : Labeled lines appear when price crosses a tracked swing pivot. BOS signals continuation of existing structure; CHoCH signals the first counter-trend structural break, indicating potential trend change.
Retest Signals (▲ / ▼) : Arrows appear when price interacts with an active deviation zone boundary (Levels mode) or touches the main Kalman line after sufficient separation (Kalman Line mode), confirmed by cooldown period to prevent rapid repeat signals.
Alert generation covers deviation level creation, BOS and CHoCH events, Kalman line retests, and support/resistance level retests for systematic monitoring across instruments and timeframes.
Strategy Integration
Zero Lag Kalman Structure fits within structure-aware and trend-following analytical frameworks:
Filter-Confirmed Directional Bias : Use ribbon color and spread direction as the primary trend filter before evaluating entries, favoring positions aligned with ribbon gradient.
Deviation Zone Re-entries : Use active support and resistance zones as high-probability re-entry reference areas when price returns to a level from the correct side.
BOS/CHoCH Context Alignment : Treat BOS events as continuation confirmation within established trends; treat CHoCH events as early warning of structural regime change requiring reassessment.
Retest-Based Entries : Use Kalman line or zone retests as lower-risk entry points within an established trend after initial separation has confirmed directional conviction.
Zone Invalidation as Exit Logic : Use level deletion events - where price closes beyond a zone boundary - as structural evidence that the prior support or resistance thesis is no longer valid.
Multi-Timeframe Structure Layering : Apply higher-timeframe deviation zones and BOS/CHoCH context to filter lower-timeframe entry signals for improved precision.
Technical Implementation Details
Core Engine : Kalman filter with error covariance tracking, Kalman gain adaptation, and integrated velocity model
Lag Correction : Zero-lag factor applied multiplicatively with current Kalman gain to preserve filter responsiveness at the correction stage
Ribbon System : Six parallel Kalman instances with linearly incremented process noise, blended via gradient fill
Level Formation : ATR-normalized deviation threshold with extreme tracking, snap-back detection, and box-based zone persistence
Structure Detection : Pivot high/low crossover logic with trend state tracking for BOS/CHoCH classification
Retest Logic : Dual-mode detection supporting zone boundary interaction and Kalman proximity, each with configurable cooldown
Visualization : Gradient ribbon fills, persistent zone boxes, labeled structure lines, and signal arrows
Performance Profile : Optimized for real-time execution with per-bar level management across all timeframes
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Short-term structure tracking with responsive deviation settings for intraday scalping
15 - 60 min : Intraday trend context with balanced deviation threshold and level persistence
4H - Daily : Swing-level structure identification with ATR-normalized zones carrying multi-session significance
Suggested Baseline Configuration:
Process Noise (Q) : 0.01
Measurement Noise (R) : 0.5
Zero Lag Factor : 1.0
Velocity Weight : 0.5
Ribbon Spread : 0.003
Deviation Threshold (ATR) : 1.5
Level Width (ATR) : 0.25
Maximum Levels : 6
Level Extend Bars : 50
Swing Lookback : 5
Retest Method : Kalman Line
Retest Cooldown : 50
Show Ribbon : Enabled
Show Deviation Levels : Enabled
Show BOS / CHoCH : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the asset's volatility profile, structural characteristics, and preferred signal frequency, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Filter too reactive to noise : Increase Measurement Noise (R) to make the Kalman gain more conservative and smooth the estimate more aggressively.
Filter too slow to respond : Increase Process Noise (Q) to allow faster adaptation to genuine price movements, or increase Zero Lag Factor to strengthen lag correction.
Levels forming too frequently : Increase Deviation Threshold to require greater ATR-normalized separation before a level is created.
Levels forming too rarely : Decrease Deviation Threshold to trigger level creation at more moderate deviations.
Zones too wide or too narrow : Adjust Level Width multiplier to scale zone thickness proportionally to current ATR.
Too many active levels cluttering the chart : Reduce Maximum Levels so older zones are removed sooner, keeping only the most recent structural reference.
BOS/CHoCH signals too frequent : Increase Swing Lookback to require more significant pivot formations before a structural break is recognized.
BOS/CHoCH signals too infrequent : Decrease Swing Lookback for faster swing detection and more responsive structural classification.
Retest signals clustering : Increase Retest Cooldown to enforce greater bar separation between consecutive retest events.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear directional phases where Kalman velocity remains consistently signed
Instruments with regular mean-reversion behavior where deviation extremes produce reliable structural zones
Swing and position trading approaches where BOS/CHoCH context informs multi-bar directional bias
Structure-based strategies that benefit from ATR-normalized level placement over fixed-point lookback methods
Reduced Effectiveness:
Choppy, range-bound markets with frequent shallow deviations that trigger premature level creation
Extremely low volatility environments where ATR normalization compresses zones to negligible significance
News-driven or gapped markets with discontinuous price behavior that bypasses zone boundaries without interaction
Markets with highly irregular volatility profiles where ATR scaling produces inconsistently sized zones
Consolidation and sideways price action where trend-following and structure-based methodologies inherently struggle due to lack of sustained directional conviction
Integration Guidelines
Confluence : Combine with volume analysis, higher-timeframe trend context, or momentum oscillators to confirm deviation zone significance
Ribbon Alignment : Trust structural breaks and retest signals occurring in the direction of the current ribbon color gradient
Zone Side Discipline : Treat deviation zones as directional only - approach support zones from above for bullish entries, resistance zones from below for bearish entries
CHoCH Awareness : Reduce directional exposure when CHoCH events occur against the prior established structural trend until a confirming BOS in the new direction appears
Velocity Respect : During periods of high Kalman velocity as reflected by wide ribbon spread, expect price to sustain moves further from the filter before meaningful retests occur
Level Invalidation Response : When a zone is broken, treat the break as structural confirmation of the new directional move rather than a retest opportunity
Disclaimer
Zero Lag Kalman Structure is a professional-grade trend filtering and structure analysis tool. It uses Kalman estimation theory with zero-lag compensation and ATR-normalized deviation measurement but does not predict future price movements. Results depend on market conditions, volatility characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates volume context, higher-timeframe bias, and comprehensive risk management. Indicator

SMI Fractal Iron HMASMI FRACTAL IRON HMA
Professional Multi-Engine Trading Overlay
Version 7.0 • February 2026 • Pine Script™ v6 • Overlay Indicator
By NPR21
FIVE INTEGRATED ENGINES
Fractal Pivots │ SMI Filter │ HMA Forecast │ Risk Management │ Short Trend Dashboard
DESCRIPTION
SMI Fractal Iron HMA integrates five complementary analytical engines into a single overlay indicator, designed so that each component addresses a different dimension of trade analysis — structure, momentum, trend context, risk parameters, and real-time directional scoring — and the outputs of each engine reinforce or qualify the signals of the others.
▸ Fractal Pivot Detection
Identifies structural swing highs and lows using fractal pivot logic with a key innovation: the left-side structural lookback and the right-side confirmation delay are split into two independent inputs. This allows traders to maintain high structural selectivity (catching only significant swing points) while independently controlling how many bars of confirmation are required before a signal prints. Setting Right Bars to zero enables zero-delay mode where the label appears on the forming bar itself.
▸ Stochastic Momentum Index (SMI) Filter
A double-smoothed EMA of the price-to-midpoint relationship, scaled to a configurable range. When enabled as a filter, long signals only print when SMI is rising and short signals only print when SMI is falling. Signals opposing the current momentum direction are silently suppressed, reducing noise without adding visual clutter.
▸ HMA Trend Duration Forecast
Tracks the Hull Moving Average slope to determine trend state. Each completed trend’s duration is stored in a rolling sample. The historical average projects the probable length of the current trend. On the chart: a white arrow line shows the forecast window, a Trend ↑ Up Real or Trend ↓ Down Real label updates in real time with the current bar count, and a Prob: label shows the forecasted duration. HMA BUY and HMA SELL labels print at each trend change with optional price display.
▸ Risk Management System
Activates on each confirmed pivot signal and draws five horizontal levels: Entry, Stop Loss (configurable in points or percentage), and three Take Profit tiers calculated as Reward:Risk multiples. Features include:
•TP hit tracking — each level changes to dashed with a check-mark label when price reaches it.
•Trailing stop — moves to breakeven at a configurable threshold, then trails by a fixed offset.
•TP2+ reversal exit — after TP2 is hit, closes the trade if price reverses by a specified distance before TP3.
•P&L dashboard — real-time display of direction, entry, current P&L in the selected currency, R:R ratio, dollar risk/reward at each TP, bars in trade, HMA trend direction, and probable trend length.
•Auto-reset — clears all trade objects when a trade completes (SL, TP3, or TP2+ reversal), readying for the next signal.
▸ Short Trend Dashboard
A 5-component real-time scoring engine that votes on the current bar’s directional bias:
•Momentum (25 pts) — price change vs. ATR-scaled threshold.
•Candle Structure (25 pts) — body-to-range ratio and wick rejection analysis.
•Micro Trend (25 pts) — fast/slow EMA crossover with ATR-normalized gap scoring.
•Acceleration (25 pts) — bar-to-bar momentum change detecting speed gain or loss.
•Volume B/S (10 pts) — estimated buy vs. sell pressure from close position within bar range.
The composite score (0–100) produces a letter grade (A+, A, B, C) and a directional label (BULLISH, BEARISH, LEAN BULL/BEAR, or NEUTRAL). The TEMP Heat Gauge (0–100) blends seven sub-indicators (ROC, RSI, Stochastic, Volume Pressure, EMA Position, Candle, Acceleration) into a single temperature reading (HOT / WARM / NEUTRAL / COOL / COLD). Scalper Mode activates ultra-fast EMA and momentum presets optimized for 1–5 minute charts with Instant Flip detection for single-bar reversals.
▸ Why These Five Engines Together
Each engine answers a different question. The pivot engine identifies where structure turns. The SMI filter confirms whether momentum supports the signal. The HMA forecast provides how long the trend is likely to last. The risk management system defines how much is at stake. The Short Trend Dashboard gives a right now directional confidence score. Together they create a workflow: detect the turn, confirm direction, understand trend context, manage the trade, and monitor conviction — all from a single indicator.
HOW TO USE
▸ Getting Started
1.Add the indicator to your chart. Default settings (Left 5 / Right 1) provide a balanced starting point with strong structural selectivity and minimal delay.
2.BUY labels appear below swing lows. SELL labels appear above swing highs. In Confirmed + Preview mode, semi-transparent labels flicker during bar formation and lock solid at bar close.
3.Use the HMA colored line and trend forecast labels to understand the broader trend context. HMA BUY and HMA SELL labels mark each trend change.
4.Enable Risk Management to see SL/TP lines and the P&L dashboard on each confirmed signal.
5.Monitor the Short Trend Dashboard for real-time confirmation. CONSENSUS +4/5 or +5/5 indicates strong alignment across all components.
▸ Tuning the Pivot Detection
•Left 5 / Right 5: Maximum accuracy. Pivot must be highest/lowest of 11 bars. 5-bar confirmation delay. Best for identifying only major swing points.
•Left 5 / Right 1: Strong selectivity, minimal delay. Preview label flickers on the confirmation bar. Good balance for scalping and active trading.
•Left 5 / Right 0: Zero-delay mode. Label appears on the pivot bar during formation. Fastest possible signal. Useful for scalping when combined with the SMI filter.
•Left 8–10 / Right 0: Zero delay with larger left lookback to compensate for missing right-side confirmation.
▸ Configuring Risk Management
•Enable the Risk Management Overlay toggle. Set Stop Loss in points (e.g., MNQ: 3–5 pts) or as a percentage of entry price.
•Set TP1, TP2, TP3 as Reward:Risk multiples (defaults: 2:1, 3:1, 4:1). Adjust to your trading style.
•Set Point Value for your instrument: MNQ = 2, MES = 5, MYM = 0.5, MGC = 10, MCL = 10.
•The P&L dashboard updates every bar showing dollar P&L, R:R ratio, and TP hit status.
•Enable trailing stop for trades that run: set breakeven threshold, trail start, and trail offset distances.
▸ Reading the Short Trend Dashboard
•Direction + Score: BULLISH/BEARISH/LEAN with a score of 0–100. Grade A+ or A = high conviction.
•TEMP Heat Gauge: Above 70 = HOT (overbought). Below 30 = COLD (oversold). 45–55 = NEUTRAL.
•CONSENSUS: Total vote out of 5 components. +4/5 or +5/5 = strong directional alignment.
•Scalper Mode: Ultra-fast presets for 1–5 min charts. Instant Flip marks single-bar reversals with ** notation.
▸ Label Display Options
•Stack: Label sits directly on the high/low with offset ticks. Text stacks vertically with optional timestamp.
•Pointer: Label offset to the side with a pointer coming off the corner pointing at the exact high/low of the bar.
•Timestamp: Five formats: HH:mm, HH:mm:ss, h:mm a, MMM dd HH:mm, MMM dd. Uses the chart’s time zone.
▸ Suggested Starting Settings
•Scalping (1–5 min): Left 5, Right 1, HMA Length 9–14, Scalper Mode ON, SL 3–5 pts
•Day Trading (5–15 min): Left 5, Right 2–3, HMA Length 14–20, Scalper Mode OFF, SL 5–10 pts
•Swing Trading (1H–4H): Left 5, Right 5, HMA Length 20–50, Scalper Mode OFF, SL 10–25 pts
•Zero-Lag Mode: Left 7–10, Right 0, SMI Filter ON, HMA Length 14, Scalper Mode ON
DISCLAIMER
This indicator is a technical analysis tool designed to assist with identifying potential swing reversal points, trend direction, and trade risk parameters. It is not a standalone trading system and does not constitute financial advice. No indicator can predict future price movement. Past performance of any signal methodology does not guarantee future results. Always use proper risk management and consider multiple sources of analysis. The author assumes no responsibility for trading losses. Use at your own risk. 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

As Good As It Gets Pivot ArrowsAs Good As It Gets Pivot Arrows
Description
- As Good As It Gets Pivot Arrows is a clean, high-precision pivot detection indicator that plots bright green upward triangles for confirmed pivot lows (buy signals) and red downward triangles for confirmed pivot highs (sell signals), and comes with customizable pivot length. Additionally, it optionally displays white dots for double-top/double-bottom pivots within a user-defined percentage tolerance.
Key Features
- Exact replication of TOS pivot high/low triangles (12-arrow style)
- Customizable pivot length (default 7)
- Option to ignore the last unconfirmed bar
- Toggle triangles and/or pivot dots independently
- Double-top/bottom detection with adjustable % tolerance (0.1% default)
- Clean visual signals with no repainting on confirmed pivots
What Makes It Unique
- This script delivers the pivot arrow behavior (including brighter lime-green buy triangles) that many traders love, with added flexibility: individual toggles for triangles/dots, double-top/bottom detection, and full customization. Unlike generic pivot indicators, it has precise confirmation logic while remaining fast and non-repainting on closed bars.
How to Use and Trade With It
- Adjust "Pivot Length" to suit your timeframe (7–14 common)
- Enable/disable triangles or dots as preferred
- Fine-tune "% Tolerance" for double-top/bottom sensitivity
Trading Signals
- Green upward triangle below bar: Confirmed pivot low → potential LONG entry or support
- Red downward triangle above bar: Confirmed pivot high → potential SHORT entry or - resistance
- White dots: Double-top (above) or double-bottom (below) within tolerance → higher-probability reversal zones
Best Practice
- Use triangles for primary swing entries/exits
- Combine with volume, trend filters, or support/resistance for confirmation
- Works on any timeframe; shorter lengths for intraday scalping, longer for positional trading Indicator

Zero Lag Trend Signals (MTF) [AlgoAlpha]Zero Lag Trend Signals 🚀📈
Ready to take your trend-following strategy to the next level? Say hello to Zero Lag Trend Signals , a precision-engineered Pine Script™ indicator designed to eliminate lag and provide rapid trend insights across multiple timeframes. 💡 This tool blends zero-lag EMA (ZLEMA) logic with volatility bands, trend-shift markers, and dynamic alerts. The result? Timely signals with minimal noise for clearer decision-making, whether you're trading intraday or on longer horizons. 🔄
🟢 Zero-Lag Trend Detection : Uses a zero-lag EMA (ZLEMA) to smooth price data while minimizing delay.
⚡ Multi-Timeframe Signals : Displays trends across up to 5 timeframes (from 5 minutes to daily) on a sleek table.
📊 Volatility-Based Bands : Adaptive upper and lower bands, helping you identify trend reversals with reduced false signals.
🔔 Custom Alerts : Get notified of key trend changes instantly with built-in alert conditions.
🎨 Color-Coded Visualization : Bullish and bearish signals pop with clear color coding, ensuring easy chart reading.
⚙️ Fully Configurable : Modify EMA length, band multiplier, colors, and timeframe settings to suit your strategy.
How to Use 📚
⭐ Add the Indicator : Add the indicator to favorites by pressing the star icon. Set your preferred EMA length and band multiplier. Choose your desired timeframes for multi-frame trend monitoring.
💻 Watch the Table & Chart : The top-right table dynamically updates with bullish or bearish signals across multiple timeframes. Colored arrows on the chart indicate potential entry points when the price crosses the ZLEMA with confirmation from volatility bands.
🔔 Enable Alerts : Configure alerts for real-time notifications when trends shift—no need to monitor charts constantly.
How It Works 🧠
The script calculates the zero-lag EMA (ZLEMA) by compensating for data lag, giving traders more responsive moving averages. It checks for volatility shifts using the Average True Range (ATR), multiplied to create upper and lower deviation bands. If the price crosses above or below these bands, it marks the start of new trends. Additionally, the indicator aggregates trend data from up to five configurable timeframes and displays them in a neat summary table. This helps you confirm trends across different intervals—ideal for multi-timeframe analysis. The visual signals include upward and downward arrows on the chart, denoting potential entries or exits when trends align across timeframes. Traders can use these cues to make well-timed trades and avoid lag-related pitfalls. Indicator

Nasan Moving AverageNasan Moving Average belong to the group of moving average which provides a high degree of smoothness with very low lag.
The calculation process involves several steps to analyze the typical price of a financial asset over specific periods. It starts by computing a simple moving average and standard deviation of the typical price. Then, it standardizes (differencing TP - Average Typical price over previous n periods) the price and applies an inverse hyperbolic sine transformation to the standardized value. The transformed values are summed cumulatively, and various weighted moving averages are calculated to adjust and smooth the data. The final output is a smoothed signal with reduced lag.
Input Parameters:
len: Differencing length (default 21, Use a minimum of 5 and for lower time frames less than 15 min use values between 300 -3000)
len1: Correction Factor Length 1 (default 21, this determines the length of the MA you want , eg. 10 MA, 50 MA, 100 MA, )
len2: Correction Factor Length 2 (default 9, this works best if it is ~ </=1/2 of len1 )
len3: Smoothing Length (default 5, I would not change this and only use if I want to introduce lag where you want to use it for cross over strategies).
Differencing and Standardization:
The code calculates the standardized price a by differencing the typical price and normalizing it using the mean and standard deviation. This step standardizes the price changes.
Transformation:
The transformation using logarithms and square roots (b) aim to stabilize the variance and make the distribution more normal-like, improving the robustness of the cumulative sum c.
Cumulative Sum:
The cumulative sum c of the transformed series helps in integrating the series over time, capturing the overall trend and movement.
Correction Factors:
Correction factors c1 and c4 adjust the cumulative sum based on weighted averages, to correct any biases or to align it with the typical price.
Smoothing:
The final result c6 is smoothed using a weighted moving average, reducing noise and making it easier to interpret trends.
Indicator

Nonlinear Regression, Zero-lag Moving Average [Loxx]Nonlinear Regression and Zero-lag Moving Average
Technical indicators are widely used in financial markets to analyze price data and make informed trading decisions. This indicator presents an implementation of two popular indicators: Nonlinear Regression and Zero-lag Moving Average (ZLMA). Let's explore the functioning of these indicators and discuss their significance in technical analysis.
Nonlinear Regression
The Nonlinear Regression indicator aims to fit a nonlinear curve to a given set of data points. It calculates the best-fit curve by minimizing the sum of squared errors between the actual data points and the predicted values on the curve. The curve is determined by solving a system of equations derived from the data points.
We define a function "nonLinearRegression" that takes two parameters: "src" (the input data series) and "per" (the period over which the regression is calculated). It calculates the coefficients of the nonlinear curve using the least squares method and returns the predicted value for the current period. The nonlinear regression curve provides insights into the overall trend and potential reversals in the price data.
Zero-lag Moving Average (ZLMA)
Moving averages are widely used to smoothen price data and identify trend directions. However, traditional moving averages introduce a lag due to the inclusion of past data. The Zero-lag Moving Average (ZLMA) overcomes this lag by dynamically adjusting the weights of past values, resulting in a more responsive moving average.
We create a function named "zlma" that calculates the ZLMA. It takes two parameters: "src" (the input data series) and "per" (the period over which the ZLMA is calculated). The ZLMA is computed by first calculating a weighted moving average (LWMA) using a linearly decreasing weight scheme. The LWMA is then used to calculate the ZLMA by applying the same weight scheme again. The ZLMA provides a smoother representation of the price data while reducing lag.
Combining Nonlinear Regression and ZLMA
The ZLMA is applied to the input data series using the function "zlma(src, zlmaper)". The ZLMA values are then passed as input to the "nonLinearRegression" function, along with the specified period for nonlinear regression. The output of the nonlinear regression is stored in the variable "out".
To enhance the visual representation of the indicator, colors are assigned based on the relationship between the nonlinear regression value and a signal value (sig) calculated from the previous period's nonlinear regression value. If the current "out" value is greater than the previous "sig" value, the color is set to green; otherwise, it is set to red.
The indicator also includes optional features such as coloring the bars based on the indicator's values and displaying signals for potential long and short positions. The signals are generated based on the crossover and crossunder of the "out" and "sig" values.
Wrapping Up
This indicator combines two important concepts: Nonlinear Regression and Zero-lag Moving Average indicators, which are valuable tools for technical analysis in financial markets. These indicators help traders identify trends, potential reversals, and generate trading signals. By combining the nonlinear regression curve with the zero-lag moving average, this indicator provides a comprehensive view of the price dynamics. Traders can customize the indicator's settings and use it in conjunction with other analysis techniques to make well-informed trading decisions. Indicator

RedK DIY ZLMA: Customizable Zero-Lag MA (Educational / Utility)This script is more of an educational / utility piece rather than a fully-fledged indicator - It provides an easy way to customize and produce a zero-lag Moving average that can then be used in various scenarios
What is DIY_ZLMA?
------------------------
The DIY ZLMA is for fans and enthusiasts of researching Moving Averages (like me) - the script enables the user to play around with one of the common approaches used to reduce lag in moving averages - which was explained in this old post below
Suggested uses of the DIY_ZLMA
---------------------------------------
* The Zero-lag approach here applies 3 moving average passes to a source data series - I'll refer to these 3 passes as Base MA Pass , De-lagging Pass, and Smoothing Pass - these "passes" can be customized from the indicator settings in terms of MA Length and type. The first pass allows the choice of a "source", and the second pass allows additional fine tuning by playing around with the magnification factor. The 3rd pass (smoothing) is optional and can be skipped altogether when needed. (as noted in the script, HMA and TEMA, which are very common low-lag MA's use slightly different approach in the calculation than the one used here .. so we can't get an equivalent of either of these MA's with the customization of DIY_ZLMA parameters)
* After the user experiments with the various settings for the 3 passes, and finds a "preferred combination", the script not only plots the resulting My_ZLMA - it also produces the "1-line Pine script formula" that the user can then use in any other script, maybe to smoothen some data series, or to combine with other types of moving averages to create multi-MA cross-over trading signals... and so on.
* The DIY_ZLMA can also be added to another indicator as a signal line using the Indicator-on-Indicator feature of PulseWire (review this post for step-by-step -->
)
* the script also showcases couple of recent (and very neat) Pine features: the use of User-defined Types (UDT) and User-defined Methods - which are awesome and a lot of fun to work with :)
Since this is more of a utility piece, I added as many comments as possible to the script to explain the way it works - so it's more valuable if someone finds it by searching the "Add Indicator" feature in PulseWire charts
Please feel free to play around with this new toy :) and share comments and feedback below if you find this useful. I truly hope you do. Indicator

Indicator

Indicator

Hybrid, Zero lag, Adaptive cycle MACD [Loxx]TASC's March 2008 edition Traders' Tips includes an article by John Ehlers titled "Measuring Cycle Periods," and describes the use of bandpass filters to estimate the length, in bars, of the currently dominant price cycle.
What are Dominant Cycles and Why should we use them?
Even the most casual chart reader will be able to spot times when the market is cycling and other times when longer-term trends are in play. Cycling markets are ideal for swing trading however attempting to “trade the swing” in a trending market can be a recipe for disaster. Similarly, applying trend trading techniques during a cycling market can equally wreak havoc in your account. Cycle or trend modes can readily be identified in hindsight. But it would be useful to have an objective scientific approach to guide you as to the current market mode.
There are a number of tools already available to differentiate between cycle and trend modes. For example, measuring the trend slope over the cycle period to the amplitude of the cyclic swing is one possibility.
We begin by thinking of cycle mode in terms of frequency or its inverse, periodicity. Since the markets are fractal; daily, weekly, and intraday charts are pretty much indistinguishable when time scales are removed. Thus it is useful to think of the cycle period in terms of its bar count. For example, a 20 bar cycle using daily data corresponds to a cycle period of approximately one month.
When viewed as a waveform, slow-varying price trends constitute the waveform's low frequency components and day-to-day fluctuations (noise) constitute the high frequency components. The objective in cycle mode is to filter out the unwanted components--both low frequency trends and the high frequency noise--and retain only the range of frequencies over the desired swing period. A filter for doing this is called a bandpass filter and the range of frequencies passed is the filter's bandwidth .
Indicator Features
-Zero lag or Regular MACD/signal calculation
- Fixed or Band-pass Dominant Cycle for MACD and Signal MA period inputs
-10 different moving average options for both MACD and Signal MA calculations
-Separate Band-pass Dominant Cycle calculations for both MACD and Signal MA calculations
- Slow-to-Fast Band-pass Dominant Cycle input to tweak the ratio of MACD MA input periods as they relate to each other
Indicator

Indicator

Indicator

Indicator

Strategy

[blackcat] L2 Ehlers Zero-lag EMACircumstance Remarks: Because of my carelessness, the script of the same name that I posted before was banned and hidden because the description contained content that violated the PulseWire House Rule. After communicating with the MOD, I corrected the description and obtained permission to publish it again. I hereby declare. Sorry for the inconvenience!
Level: 2
Background
John F. Ehlers introuced Zero-lag EMA Indicator in Nov, 2010.
Function
In “Zero Lag (Well, Almost)” article, authors John Ehlers and Ric Way presented their zero-lag exponential moving average indicator and strategy. They have adapted their zero-lag EMA by extending the functionality in an additional chart indicator named “Zero-Lag EMA”. Labels were added so that the user can be alerted when a crossing of the averages occurs.
The authors created an error-correcting filter for an exponential moving average ( EMA ) that seeks to minimize the lag effect of increasing periods. Increasing the gain parameter from zero changes the filter from an EMA with lag to effectively zero lag (albeit with zero smoothing also). The crossover of these lines can be used to form a trading strategy, with the addition of some threshold value for the difference between the Price and error-correcting line.
Key Signal
ZLEMA ---> Zero-lag EMA fast line
Trigger ---> Zero-lag EMA slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 76th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy. Indicator

[blackcat] L2 Ehlers Zero-lag SmootherLevel: 2
Background
John F. Ehlers introuced Zero-Lag Data Smoothers in Jul, 2002.
Function
John Ehlers introduced "Zero-Lag Data Smoothers", the infinite impulse response (IIR) filter and finite impulse response (FIR) filter.
In his article this issue on zero-lag smoothing, John Ehlers notes that his favorite filter is the symmetrically weighted six-bar finite impulse response (FIR) filter. This is also known as a triangular moving average, and can be conveniently implemented as a double-smoothed simple moving average. Per Ehlers, since this filter has six elements, its lag is 2.5 bars. Via further processing, this lag can be reduced to zero, but this produces too much overshoot. As a compromise, Ehlers suggests reducing the lag to one bar. To enable a user to adjust the lag easily, I provide the pine v4 code for an Adjustable Lag Filter indicator below. The first input, Price, should typically be set to OHLC, hl2, hl3, ohlc4 etc. The second input, LagReduction, should be set to a value in the zero-to-2.5 range. Setting it to zero will result in no adjustment, and the output will match that of the raw triangular average. Setting it to 2.5 will reduce the lag to zero. Setting it to 1.5 will reduce the lag to one bar.
Key Signal
Filter--> Zero-Lag Data Smoother fast line
Trigger--> Zero-Lag Data Smoother slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 67th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy. Indicator

[blackcat] L3 Ehlers ZeroLag Intraday Trading SystemLevel: 3
Background
John F. Ehlers introuced ZeroLag Intraday Trading System in his "Rocket Science for Traders" chapter 16.
Function
blackcat L3 EhlersZeroLag Intraday Trading System is used to find proper long and short entries. Dr. Ehlers developed a completely automatic ZeroLag Intraday Trading System. The concepts of the Instantaneous Trendline and the ZeroLag EMA are very powerful. To demonstrate just how profound these concepts are, Dr. Ehlers designed an intraday trading system. An intraday trade is defined as any active trade that is traded and then closed at the end of the day.
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
SmoothPeriod --> Period with complex averaging
DCPeriod ---> Dominant Cycle Period
Trendline ---> IT fast line
ZeroLag ---> Zero Lag Filter
long ---> long entry signal
short ---> short entry signal
Pros and Cons
100% John F. Ehlers definition translation of original work, even variable names are the same. This help readers who would like to use pine to read his book. If you had read his works, then you will be quite familiar with my code style.
NOTE: This version of Trading System has better preformance than "Automatic SineTrend Trading System".
Remarks
The 12th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy. Indicator

Indicator
