StealthTrail SuperTrend [WillyAlgoTrader]📡 StealthTrail SuperTrend is an overlay indicator that takes the classic SuperTrend concept and adds five layers of noise reduction: an adaptive multiplier that scales bands to current volatility, a flip cushion that requires price to push beyond the band by a configurable ATR distance before confirming a trend change, a cooldown timer that enforces a minimum gap between flips, an RSI momentum filter that blocks trend changes without directional confirmation, and a composite trend strength score (0–100) that quantifies how committed the current trend is. The result is a SuperTrend that stays in trends longer, flips less often in chop, and gives you a real-time confidence reading on every trend leg.
🧩 WHY THESE COMPONENTS WORK TOGETHER
The standard SuperTrend has one well-known problem: whipsaws. In ranging or choppy markets, price repeatedly crosses the band boundary, triggering rapid bullish→bearish→bullish flips that produce losing signals. The root causes are:
1. Fixed multiplier — the band width doesn't adapt when volatility contracts or expands, so the same multiplier is too tight in high-vol and too wide in low-vol
2. Instant flip — a single close beyond the band triggers a trend change, even if it's a minor wick-driven overshoot
3. No recovery time — the indicator can flip back on the very next bar, creating same-bar or next-bar whipsaws
4. No momentum context — the flip happens regardless of whether momentum actually supports the new direction
StealthTrail addresses each root cause with a dedicated mechanism:
Adaptive multiplier → solves #1 : bands automatically widen when ATR is above its average (high volatility) and tighten when below (low volatility), keeping the band distance proportional to current market conditions.
Flip cushion → solves #2 : price must close beyond the band by an additional cushion (configurable fraction of ATR) before the flip is accepted, filtering out marginal crossovers.
Cooldown timer → solves #3 : after a flip, the indicator ignores further flip attempts for N bars (default 3), preventing rapid back-and-forth in chop.
Momentum filter → solves #4 : a bullish flip requires RSI above a threshold, a bearish flip requires RSI below the symmetric threshold, confirming that momentum actually supports the direction change.
Trend strength scoring → provides context : combines price distance from band + RSI alignment into a 0–100 score, so you know whether the current trend is strong, fading, or about to flip.
These five mechanisms work as a pipeline: the adaptive multiplier sets the right band width → the cushion prevents marginal crossovers → the cooldown prevents rapid reversals → the momentum filter confirms directional support → and the strength score tells you how committed the trend is. Removing any one layer reintroduces the specific whipsaw pattern it was designed to prevent.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Adaptive volatility multiplier.
Instead of using a fixed ATR multiplier (classic SuperTrend), StealthTrail scales the multiplier dynamically:
adaptiveMult = baseMultiplier × (currentATR / SMA(ATR, adaptationPeriod))
Where currentATR = ta.atr(atrLength), and SMA(ATR) is the volatility baseline over the adaptation smoothing period (default 55 bars). The ratio currentATR / averageATR measures whether volatility is currently above (ratio > 1.0) or below (ratio < 1.0) its recent norm.
The adaptive multiplier is clamped between configurable min (default 1.0) and max (default 5.0) to prevent extreme values. When volatility spikes (e.g., news event), the multiplier increases → bands widen → the trend doesn't flip on a volatility-driven spike. When volatility compresses (consolidation), the multiplier decreases → bands tighten → the indicator catches the breakout earlier.
This can be toggled off for classic fixed-multiplier behavior.
2️⃣ Flip cushion — requires extra ATR distance beyond the band.
A standard SuperTrend flips the moment close crosses the band. StealthTrail requires:
Bullish flip: close > upperBand + cushion × ATR
Bearish flip: close < lowerBand − cushion × ATR
The cushion (default 0.15× ATR) creates a dead zone around the band boundary. Price must push meaningfully beyond the band — not just touch it — before a flip is accepted. This single mechanism eliminates a large portion of marginal crossover whipsaws where price briefly clips the band before returning.
Setting the cushion to 0.0 restores classic SuperTrend behavior (flip exactly at the band).
3️⃣ Signal cooldown timer.
After every confirmed trend flip, a counter starts. No new flip can occur for N bars (default 3). This prevents the most destructive whipsaw pattern: a bearish flip immediately followed by a bullish flip on the next bar (or vice versa), which generates two consecutive losing signals.
The cooldown is tracked as barsSinceFlip, incremented each bar, and checked before any flip is processed. Only when barsSinceFlip ≥ cooldownInput can a new flip occur. This is independent of the cushion — both must pass.
4️⃣ RSI momentum filter.
On every raw trend flip (band crossed + cushion passed + cooldown passed), an additional RSI check is applied:
Bullish flip requires: RSI(rsiLength) ≥ rsiThreshold (default 45)
Bearish flip requires: RSI(rsiLength) ≤ (100 − rsiThreshold) = 55
This is deliberately asymmetric around the center by design (threshold 45, not 50): a bullish flip only needs RSI ≥ 45 (slightly below center), meaning it passes unless momentum is actively bearish. A bearish flip only needs RSI ≤ 55. This permissive threshold blocks the worst counter-momentum flips without being so strict that it delays legitimate trend changes.
When the filter blocks a flip, the trend direction does not change and the band continues ratcheting in the original direction. An optional "Show Filtered Flips" setting displays a muted dot where a flip was blocked — useful for understanding filter behavior.
5️⃣ Composite trend strength score (0–100).
On every bar, a strength score is calculated from two components:
Distance score (0–50): How far price is from the SuperTrend band, measured in ATR units:
distScore = min(|close − band| / ATR × 20, 50)
A large distance means price is well away from the band — the trend has room before a potential flip.
Momentum score (0–50): How well RSI aligns with the current trend direction:
For bullish: momScore = min(max(RSI − 50, 0), 50)
For bearish: momScore = min(max(50 − RSI, 0), 50)
RSI reading that confirms the trend direction contributes up to 50 points.
Total: strength = round(min(distScore + momScore, 100))
Classification: Strong ≥ 70, Medium ≥ 40, Weak < 40. Displayed in the dashboard and included in alert messages. This gives you a real-time confidence reading: a Strong reading means price is far from the band with confirming momentum — the trend is well-established. A Weak reading means price is near the band or momentum is fading — a flip may be imminent.
6️⃣ Filtered flip visualization.
When "Show Filtered Flips" is enabled, a muted gray dot appears on the band at every point where a raw flip occurred but was blocked by a filter (momentum or volume). This is a transparency feature: instead of silently suppressing signals, the indicator shows you exactly where it intervened and what it filtered out. You can evaluate whether the filter saved you from a bad signal or delayed a good one.
7️⃣ Gradient fill between price and band.
The space between close and the SuperTrend band is filled with a directional gradient: bullish trends fade from green (near band) to transparent (near price), bearish trends fade from red to transparent. The gradient uses fill() with top/bottom color mapping — the visual intensity naturally increases as the band is further from price, creating an intuitive "strength of trend" visual without needing to read the dashboard.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — ATR calculation: ta.atr(atrLength) with a high-low fallback for early bars where ATR is unavailable.
Step 2 — Adaptive multiplier: If adaptive mode is on: multiplier = baseMultiplier × (ATR / SMA(ATR, adaptSmoothing)), clamped to . If off: multiplier = baseMultiplier (fixed).
Step 3 — Band calculation: upperBand = hl2 + multiplier × ATR. lowerBand = hl2 − multiplier × ATR. Bands are calculated from hl2 (midpoint) for symmetry.
Step 4 — Band ratcheting: In an uptrend, the lower band can only rise — it is set to max(current_lowerBand, previous_band). In a downtrend, the upper band can only fall — min(current_upperBand, previous_band). This ratcheting prevents the band from retreating during a trend, which would prematurely trigger a flip.
Step 5 — Flip detection: In an uptrend: if close < band − cushion × ATR AND barsSinceFlip ≥ cooldown → raw bearish flip. In a downtrend: if close > band + cushion × ATR AND barsSinceFlip ≥ cooldown → raw bullish flip. On flip, the band resets to the opposite band value and barsSinceFlip resets to 0.
Step 6 — Filter gate: If RSI momentum filter is on: bullish flip requires RSI ≥ threshold, bearish requires RSI ≤ (100 − threshold). If volume filter is on: volume must exceed SMA(volume, 20) × multiplier. Both must pass for the flip to become a confirmed signal. If either fails, the flip is recorded as "filtered" (visualizable) but the trend direction reverts — no signal is emitted.
Step 7 — Signal emission: Confirmed flip + barstate.isconfirmed + warmup check → Buy (▲) or Sell (▼) label appears. Strength score is calculated and updated.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — the adaptive SuperTrend band appears immediately
2. Green band = bullish trend, red band = bearish trend
3. ▲ label below bar = confirmed buy (trend flipped bullish through all filters)
4. ▼ label above bar = confirmed sell (trend flipped bearish)
5. Check dashboard for strength score — Strong trends are more reliable
👁️ Reading the chart:
— 🟢 Green step-line = SuperTrend band in bullish mode (following lower band)
— 🔴 Red step-line = SuperTrend band in bearish mode (following upper band)
— 🟢 Large green dot on band = confirmed bullish flip
— 🔴 Large red dot on band = confirmed bearish flip
— ⚫ Gray dot on band (optional) = raw flip that was blocked by a filter
— 🟩🟥 Gradient fill = visual trend strength (denser = further from band = stronger trend)
— Background tint (optional) = overall trend direction shading
📊 Dashboard fields:
— Trend: current direction (Bullish / Bearish)
— Signal: last confirmed signal with bars elapsed
— Strength: 0–100 score with classification (Strong / Medium / Weak)
— Multiplier: current adaptive multiplier value (e.g., 2.83×)
— RSI: current RSI reading
— Timeframe and version
🔧 Tuning guide:
— Too many whipsaws: increase Flip Cushion (0.2–0.3), increase Cooldown (4–6), enable Momentum Filter
— Signals too late: decrease Flip Cushion (0.05–0.10), decrease Cooldown (1–2), lower Base Multiplier
— Bands too wide in low-vol: decrease Min Adaptive Mult (0.8), decrease Adaptation Smoothing (30–40)
— Bands too tight in high-vol: increase Max Adaptive Mult (5.0–6.0), increase Base Multiplier
— Ranging/choppy market: enable Momentum Filter, increase Cooldown, increase Cushion — all three work together to suppress chop signals
— Strong trending market: decrease Cushion (0.05), decrease Cooldown (1), disable Momentum Filter — let the indicator react faster to trend continuation
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— ATR Length (default 13): volatility measurement period
— Base Multiplier (default 2.5): base ATR multiplier for band width
— Adaptive Multiplier (default On): scale bands by current/average ATR ratio
— Adaptation Smoothing (default 55): SMA lookback for ATR baseline
🔍 Filters:
— Flip Cushion (default 0.15× ATR): extra distance beyond band required for flip
— Signal Cooldown (default 3 bars): minimum gap between flips
— Momentum Filter (default On): RSI confirmation for trend changes
— RSI Length (default 13) / RSI Threshold (default 45): momentum filter parameters
— Volume Filter (default Off): above-average volume confirmation
🔧 Advanced:
— Min Adaptive Mult (default 1.0): floor for adaptive scaling
— Max Adaptive Mult (default 5.0): ceiling for adaptive scaling
🎨 Visual:
— Band line, gradient fill, filtered flip dots, trend background (all toggleable)
— Auto / Dark / Light theme
🔔 Alerts
— 🟢 BUY — ticker, price, band level, timeframe, strength score
— 🔴 SELL — same fields
Both support plain text and JSON webhook format. Bar-close confirmed, filter-gated, cooldown-enforced.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed. Band ratcheting is deterministic — the band value on a closed bar never changes retroactively. A warmup period (max of ATR length, adaptation smoothing, and 50 bars) prevents signals during insufficient data.
— 📐 This is not a standard SuperTrend. The adaptive multiplier, flip cushion, cooldown, and momentum filter fundamentally change the signal generation logic. A classic SuperTrend flip would occur significantly earlier (or later, depending on volatility) than a StealthTrail flip — they are not interchangeable.
— ⚖️ The flip cushion and cooldown work independently . Both must pass for a flip to occur. In chop, the cooldown may block a flip even after the cushion is satisfied, or the cushion may prevent a flip even after the cooldown expires. This dual-gate design is intentional.
— 📊 Trend strength is a real-time reading , not a prediction. A strength of 85 means price is far from the band with confirming momentum right now — it does not predict how long the trend will continue.
— 🔄 "Filtered Flips" (gray dots) show where a trend change would have occurred in a classic SuperTrend but was blocked by the momentum or volume filter. This transparency helps you understand the filter's impact and tune the threshold accordingly.
— 📈 Volume filter auto-disables on instruments without volume data (many forex pairs). On these instruments, only the momentum filter, cushion, and cooldown provide noise reduction.
— 🛠️ This is a trend-following signal tool , not an automated trading bot. It identifies trend direction, scores trend strength, and generates filtered signals — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. The adaptive multiplier self-calibrates to any instrument's volatility profile. Indicator

Adaptive Momentum Classifier [WillyAlgoTrader]📡 Adaptive Momentum Classifier is an overlay indicator that evaluates four independent market dimensions — momentum, trend, volatility position, and money flow — ranks each one against its own historical distribution using percentile scoring, and combines them into a single composite score (0–100%) that drives signal generation. Signals fire only when the composite score crosses a threshold with minimum feature agreement across axes, passes through five independent filters, and is confirmed on bar close.
The core idea: instead of using one indicator to generate signals, this tool treats four market dimensions as independent measurement axes, normalizes each to a uniform 0–1 scale via percentile ranking, weights and combines them into a consensus score, and then requires both the score threshold AND a minimum number of agreeing axes before allowing a signal. This multi-axis + agreement gate architecture filters out situations where a single strong reading (e.g., RSI spike) would trigger a false signal while the other dimensions disagree.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Traditional signal generators face a fundamental problem: a single indicator measures one market dimension. RSI measures momentum speed but is blind to trend direction. MACD measures trend but ignores where price sits within its volatility envelope. Volume-based indicators measure flow but know nothing about price momentum. Using any one of these alone produces signals that ignore critical market context.
Simply combining indicators with AND/OR logic (e.g., "buy when RSI > 50 AND MACD > 0") doesn't solve the deeper problem: the indicators are on different scales, have different distributions, and their raw values aren't comparable. RSI = 55 and MACD histogram = 0.002 both "lean bullish" but you can't meaningfully average them.
This indicator solves both problems:
Step 1 — Orthogonal axis design: Each axis measures a genuinely different market dimension. Momentum (how fast), Trend (which direction), Volatility Position (where within the range), Flow (where is money going). They are deliberately chosen to be as independent as possible.
Step 2 — Percentile normalization: Each axis's raw value is ranked against its own recent history. "Is this RSI-ROC blend reading higher than 75% of the last 89 readings?" This converts every axis to a uniform 0–1 scale where 0.5 = median. Now all four axes are directly comparable and combinable.
Step 3 — Weighted consensus: The four normalized scores are combined with weights (Trend 1.2×, Momentum 1.0×, Flow 1.0×, Volatility 0.8×) into a single composite score. The weighting reflects that trend conviction is slightly more predictive than raw momentum.
Step 4 — Agreement gate: Even with a high composite score, the signal is blocked unless at least half the axes independently agree (each reading > 0.6 for bullish or < 0.4 for bearish). This prevents one extreme axis from dominating the composite and producing a false consensus.
Step 5 — Filter stack: Five independent filters (trend alignment, volatility regime, volume, score acceleration, HTF bias) provide additional context gates. The signal only fires when all enabled filters pass simultaneously.
No single component is useful alone. Percentile ranking without multiple axes just normalizes one indicator. Multiple axes without percentile ranking can't be meaningfully combined. A combined score without the agreement gate can be dominated by one outlier. And all of this without filters would still fire in unsuitable market conditions. The full pipeline is required.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Four-axis percentile scoring engine.
Each axis is built from two sub-components blended together, then converted to a 0–1 percentile rank against the scoring lookback window (default 89 bars). The percentile function counts what fraction of historical values are below the current value — producing a uniform distribution with no dead zones (unlike z-score normalization which compresses values near the mean).
Axis 1 — Momentum (weight 1.0):
Sub-components: RSI(13) centered at 50, and ROC(9). Each is percentile-ranked independently, then blended 60% RSI + 40% ROC. RSI provides stable momentum reading, ROC provides faster reaction to price acceleration. The blend captures both speed (ROC) and sustained momentum (RSI) in a single axis.
Axis 2 — Trend (weight 1.2):
Sub-components: MACD histogram (12/26/9), and EMA slope normalized by ATR. EMA slope = (EMA − EMA ) / (ATR × 5), making it scale-independent across instruments. Each percentile-ranked, blended 60% MACD + 40% slope. MACD histogram captures momentum of the trend itself (acceleration), while EMA slope captures sustained directional movement. This axis receives the highest weight (1.2) because directional conviction is the strongest single predictor of continuation.
Axis 3 — Volatility Position (weight 0.8):
Sub-components: Bollinger %B (21-period, showing where price sits within the band envelope, 0 = lower band, 1 = upper band), and ATR expansion ratio (current ATR / SMA of ATR over lookback). Combined as: (BB%B − 0.5) × min(ATR_ratio, 2.5), then percentile-ranked. This creates a directional volatility signal: price at upper band during volatility expansion scores high (strong bullish breakout), price at upper band during contraction scores lower (potential mean-reversion). The ATR ratio is capped at 2.5 to prevent extreme volatility spikes from distorting the axis. Lower weight (0.8) reflects that volatility position is a confirming factor, not a primary driver.
Axis 4 — Flow (weight 1.0, auto-disabled without volume):
Sub-components: MFI(13) centered at 50, and OBV slope (smoothed OBV EMA(21), slope = (OBV_EMA − OBV_EMA ) / |OBV_EMA|). Each percentile-ranked, blended 50/50. MFI combines price and volume into a single money flow reading, OBV slope shows whether accumulation is accelerating or decelerating. On instruments without volume data (forex), this axis returns 0.5 (neutral) and its weight drops to 0, so the composite score is calculated from three axes only.
2️⃣ Composite score with symmetric thresholds.
The four axes are combined: composite = (1.0 × momentum + 1.2 × trend + 0.8 × volatility_position + 1.0 × flow) / total_weight. Result is 0–1 where 0 = maximum bearish consensus, 0.5 = neutral, 1 = maximum bullish consensus. A buy signal fires when the composite crosses above the threshold (default 0.618). A sell signal fires when it crosses below (1 − threshold = 0.382). This creates symmetric entry conditions: the same strength of consensus is required for both directions.
3️⃣ Feature agreement gate.
Independent of the composite score, each axis is evaluated for directional agreement: > 0.6 = bullish vote, < 0.4 = bearish vote, 0.4–0.6 = abstain. The agreement ratio = max(bull_votes, bear_votes) / active_axes. Signals require agreement ≥ 0.5 (at least half the axes independently confirming the same direction). This prevents false signals from composite score averaging: if momentum = 0.95 but trend = 0.3 and volatility = 0.4, the composite might cross the threshold but only 1/4 axes agree — signal is blocked.
4️⃣ Score acceleration filter.
The rate of change of the composite score: acceleration = score − score . Signals require |acceleration| ≥ Min Score Acceleration (default 0.02). This filters out slow-drift crossovers where the score gradually creeps past the threshold without any decisive move — these typically represent noise, not genuine momentum shifts. Only fast, decisive threshold crosses produce signals.
5️⃣ Five-filter stack.
Each filter is independently toggleable:
— Trend Alignment (default On): price must be above EMA(50) for longs, below for shorts — prevents counter-trend entries
— Volatility Regime (default On): ATR ratio must be between 0.4 and 3.0 — suppresses signals during dead markets (ATR < 40% of average) and crash conditions (ATR > 300% of average)
— Volume Confirmation (default On): volume must exceed 80% of its 20-period SMA — confirms market participation. Auto-disabled on instruments without volume data
— Score Acceleration (default 0.02): described above. Set to 0 to disable
— Higher TF Bias (default disabled): when a timeframe is selected, price must be above/below EMA(21) on the higher timeframe for longs/shorts. Uses + lookahead_on for non-repainting HTF data
6️⃣ Direction lock — no consecutive same-direction signals.
After a buy signal fires, the next signal can only be a sell (and vice versa). This prevents signal clustering where multiple buy signals fire in sequence during a strong trend — you get one entry per direction until the trend reverses.
7️⃣ Four sensitivity presets.
Each preset overrides two parameters simultaneously:
— Conservative : threshold 0.80, lookback 150 — requires very strong consensus over a long history, fewer but higher-conviction signals
— Default : uses your manual settings (threshold 0.618, lookback 89)
— Aggressive : threshold 0.60, lookback 60 — lower bar for signals, shorter history, faster adaptation
— Scalping : threshold 0.55, lookback 40 — minimum consensus required, very short history, designed for 1–5M charts
The lookback affects all four axes simultaneously (percentile ranking window), so the entire scoring engine adapts as a unit.
8️⃣ Dynamic trend band.
A visual EMA ± 0.5× ATR band colored by the composite score: green (score > 55%), red (< 45%), yellow (neutral). This provides an at-a-glance trend context without needing to read the dashboard. The band width adapts to volatility automatically.
9️⃣ Signal strength classification.
Each signal is classified based on the composite score at the moment of firing: Strong (score ≥ 85%), Medium (≥ 75%), Weak (< 75%). Displayed in the dashboard and available in alert messages. This helps you size positions or filter setups based on conviction level.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Raw feature calculation: RSI(13), ROC(9), MACD(12/26/9) histogram, EMA slope (normalized by ATR), BB%B(21), ATR ratio, MFI(13), OBV slope — eight raw values computed from price and volume.
Step 2 — Percentile ranking: Each raw value is ranked against its own history over the scoring lookback (default 89 bars). The pctRank function iterates through the lookback window and counts what fraction of past values are below the current value. Result: 0.0 (lower than all history) to 1.0 (higher than all history). This normalization is performed for each of the eight sub-components independently.
Step 3 — Axis blending: Each pair of sub-components is blended into one axis score: momentum = 0.6 × pctRSI + 0.4 × pctROC, trend = 0.6 × pctMACD + 0.4 × pctSlope, volatility = pctVolPosition (single combined raw), flow = 0.5 × pctMFI + 0.5 × pctOBV.
Step 4 — Weighted composite: composite = (1.0 × momentum + 1.2 × trend + 0.8 × volatility + 1.0 × flow) / total_weight. On instruments without volume: flow weight = 0, total_weight = 3.0 instead of 4.0.
Step 5 — Threshold crossing: Buy triggers when composite crosses above the threshold (default 0.618) from below. Sell triggers when composite crosses below (1 − 0.618 = 0.382) from above. Both require barstate.isconfirmed.
Step 6 — Agreement check: Each axis is independently classified as bullish (> 0.6), bearish (< 0.4), or neutral. At least 50% of active axes must agree with the signal direction.
Step 7 — Filter stack: All five enabled filters must pass. Any failure blocks the signal.
Step 8 — Direction lock: Signal must be opposite to the last confirmed signal.
Step 9 — Emission: Buy (▲) or Sell (▼) label placed on the confirmed bar.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator to your chart
2. Select a sensitivity preset matching your style (or use Default)
3. The trend band immediately shows the current momentum bias (green/red/yellow)
4. Wait for a ▲ (buy) or ▼ (sell) label — check the dashboard for score and strength
5. Use the agreement ratio (e.g., 3/4) to confirm multi-axis consensus
👁️ Reading the chart:
— 🟢 Green trend band = bullish momentum (score > 55%)
— 🟡 Yellow trend band = neutral / transition zone
— 🔴 Red trend band = bearish momentum (score < 45%)
— 🟢 ▲ label below bar = confirmed buy signal
— 🔴 ▼ label above bar = confirmed sell signal
— Band width = current volatility (wider = more volatile)
📊 Dashboard fields:
— Trend: current composite direction (Bullish / Bearish / Neutral)
— Last Signal: most recent signal with bars elapsed
— Strength: signal quality (Strong / Medium / Weak)
— Score: current composite as percentage
— Agreement: how many axes confirm (e.g., 3/4)
— Volatility: ATR regime (High / Normal / Low)
— TF and version
🔧 Tuning guide:
— Too many signals: increase threshold (0.70–0.85), enable more filters, use Conservative preset
— Too few signals: decrease threshold (0.55–0.60), reduce lookback (50–70), use Aggressive preset
— Signals too late: shorten RSI/ROC/MACD lengths, reduce lookback
— Too many false signals in ranging markets: enable ADX-aware Volatility Regime filter, increase Min Score Acceleration to 0.03–0.05
— Scalping 1–5M: use Scalping preset (threshold 0.55, lookback 40), lower filter aggressiveness
— Swing 4H–1D: use Conservative preset (threshold 0.80, lookback 150), enable HTF bias filter
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Sensitivity Preset (default Default): Conservative / Default / Aggressive / Scalping
— Scoring Lookback (default 89): percentile ranking window — higher = more stable, lower = faster adaptation
— Signal Threshold (default 0.618): minimum composite score for buy signals (sell = 1 − threshold)
📊 Feature Engine:
— RSI Length (default 13) / ROC Length (default 9): momentum axis sub-components
— MACD Fast/Slow/Signal (default 12/26/9): trend axis MACD
— Bollinger Length (default 21): volatility position axis
— MFI Length (default 13) / OBV Smooth (default 21): flow axis
🔍 Filters:
— Trend Alignment (default On): EMA(34) trend direction gate
— Volatility Regime (default On): ATR ratio 0.4–3.0 range gate
— Volume Confirmation (default On): volume > 80% of 20-SMA
— Min Score Acceleration (default 0.02): minimum speed of score change
— Higher TF Bias (default Off): optional HTF EMA(21) alignment
🎨 Visual:
— Trend band (EMA ± 0.5× ATR, scored coloring)
— Background tint / Dynamic bar coloring (optional)
— Auto / Dark / Light theme
🔔 Alerts
— 🟢 BUY — ticker, price, timeframe, composite score
— 🔴 SELL — same fields
Both support plain text and JSON webhook format. Bar-close confirmed, direction-locked (no consecutive same-direction alerts).
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed. HTF bias uses + lookahead_on. A warmup period (max of lookback, MACD slow period, and trend EMA length, minimum 50 bars) prevents signals during insufficient data.
— 📐 The composite score is not a probability . A score of 80% means four market dimensions, percentile-ranked against recent history, strongly agree on bullish conditions. It measures consensus quality, not prediction accuracy.
— ⚖️ Percentile ranking is relative to the lookback window . A score of 0.9 means "higher than 90% of the last N bars" — it does not mean the same thing on different instruments or timeframes. Each chart creates its own distribution.
— 📊 The Flow axis (MFI + OBV) auto-disables on instruments without volume data (many forex pairs). The composite then runs on three axes with adjusted total weight. Signal quality is slightly lower without flow data but the other three axes remain fully functional.
— 🔒 Direction lock means you get one signal per trend leg . After a buy, only a sell can fire next. This prevents clustering but means you won't get "add to position" signals — the tool provides one entry per direction.
— 🔄 The agreement gate requires ≥ 50% of axes to independently confirm. On 4-axis instruments, this means ≥ 2. On 3-axis (no volume), ≥ 2. This is a deliberately moderate threshold — raising it to 75%+ would make signals extremely rare.
— 🛠️ This is a signal and analysis tool , not an automated trading bot. It classifies momentum consensus and generates signals — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume-dependent features auto-adapt to available data. Indicator

Indicator

Indicator

EMA and Dow Theory Strategies V3Overview
EMA and Dow Theory Strategies V3 is a major refinement of V2, focused on three goals: reducing overfitting, filtering out range-bound markets, and simplifying the parameter set from 13 inputs down to just 5.
The core logic remains the same — combining Dow Theory swing structure with EMA trend direction — but V3 replaces the dual-EMA crossover system and OTHERS.D correlation filter with a single EMA slope judgment and an ADX-based range filter. The result is a cleaner, more robust strategy that performs more consistently across different assets and timeframes.
What Changed from V2
Removed:
Fast EMA / Slow EMA crossover → replaced by single EMA slope direction
Index Fast EMA / Index Slow EMA (OTHERS.D correlation) → removed entirely
RSI filter (overbought/oversold) → removed (was not functioning effectively)
Scale adjustment parameter → removed
Added:
ADX filter (period fixed at 14) → skips entries during sideways/ranging markets
Single EMA slope judgment → trend direction determined by whether EMA is rising or falling
Result: Parameters reduced from 13 → 5
Parameters & Recommended Ranges
EMA Period | Default: 50 | Range: 30–100
Shorter for high-volatility assets, longer for stable ones.
ATR Multiplier | Default: 4.0 | Range: 2.5–6.0
Controls TP distance. Higher = wider targets.
Stop Loss (%) | Default: -6.0 | Range: -4 to -10
Wider for volatile assets, tighter for BTC/ETH.
ADX Threshold | Default: 18.0 | Range: 15–28
Higher = stricter range filter, fewer but higher-quality trades.
Swing Detection Period | Default: 4 | Range: 2–14
Smaller = more sensitive to swing highs/lows.
Recommended Settings by Asset Type
Meme coins (DOGE, SHIB, etc.)
EMA: 44–55 / ATR: 3.5–5.0 / SL: -6 to -8% / ADX: 18–22 / Swing: 3–5
Major assets (BTC, ETH)
EMA: 55–80 / ATR: 2.5–4.0 / SL: -4 to -6% / ADX: 20–25 / Swing: 5–10
Mid-cap alts (SOL, SUI, etc.)
EMA: 35–55 / ATR: 4.0–5.5 / SL: -5 to -7% / ADX: 18–23 / Swing: 4–7
Small-cap alts
EMA: 30–50 / ATR: 4.5–6.0 / SL: -7 to -10% / ADX: 18–22 / Swing: 3–5
Recommended Settings by Timeframe
1–5 min: ADX threshold 15–20 (ADX tends to be lower on short timeframes)
15 min – 1 hour: ADX threshold 18–23
2–4 hour: ADX threshold 20–25
Entry Conditions
Long: EMA slope rising AND Dow Theory trend up AND ADX > threshold
Short: EMA slope falling AND Dow Theory trend down AND ADX > threshold
Exit Conditions
TP1: +ATR×1 → close 30%
TP2: +ATR×2 → close 30%
TP3: +ATR×3 → close 30%
Stop Loss: fixed % from entry price → full close
Trend reversal: Dow Theory swing flip → full close
Visual Features
EMA line: green when rising, red when falling
Gray background: ADX below threshold (range-bound zone — no entries)
Gradient zones: distance from price to swing high/low
4H reference: higher timeframe swing levels displayed
This strategy is designed for trend-following on crypto assets, primarily on the 1H–4H timeframe. Always backtest on your target asset before live trading. Past performance does not guarantee future results.
🇯🇵 日本語
EMA and Dow Theory Strategies V3
概要
EMA and Dow Theory Strategies V3 は、V2を大幅に改良したバージョンです。主な改善点は3つ——過学習リスクの低減、横ばい相場のフィルタリング、そしてパラメーター数を13個から5個へのスリム化です。
コアロジックはV2から引き継いでいます。ダウ理論のスイング構造とEMAのトレンド方向を組み合わせてエントリーを判断します。ただしV3では、デュアルEMAクロスとOTHERS.D相関フィルターを廃止し、1本のEMA傾きとADXによるレンジフィルターに置き換えました。結果として、より汎用性が高く、異なる銘柄・時間足でも安定して機能する設計になっています。
V2からの主な変更点
削除したもの:
Fast EMA / Slow EMA クロス → EMA1本の傾き判断に統合
Index Fast EMA / Index Slow EMA(OTHERS.D相関)→ 完全削除
RSIフィルター(過熱・売られすぎ判定)→ 削除(実質機能していなかったため)
スケール調整パラメーター → 削除
追加したもの:
ADXフィルター(期間14固定)→ 横ばい相場でのエントリーをスキップ
EMA傾き判断 → EMAが上向きか下向きかでトレンド方向を判定
結果:パラメーター数を 13個 → 5個 に削減
パラメーターと推奨設定範囲
EMA期間 | デフォルト: 50 | 推奨範囲: 30〜100
ボラが高い銘柄は短め、安定銘柄は長め。
ATR倍率 | デフォルト: 4.0 | 推奨範囲: 2.5〜6.0
TP距離の基準。大きいほど利確ラインが遠くなる。
損切り(%) | デフォルト: -6.0 | 推奨範囲: -4〜-10
ボラが高い銘柄は広め、BTC/ETHはタイトでOK。
ADXしきい値 | デフォルト: 18.0 | 推奨範囲: 15〜28
高いほどレンジ除外が厳しく、トレード数が減り精度が上がる。
スイング検出期間 | デフォルト: 4 | 推奨範囲: 2〜14
小さいほどスイング高値・安値への感度が高くなる。
銘柄タイプ別おすすめ設定
ミーム系(DOGE・SHIBなど)
EMA: 44〜55 / ATR倍率: 3.5〜5.0 / 損切り: -6〜-8% / ADX: 18〜22 / スイング: 3〜5
主要銘柄(BTC・ETH)
EMA: 55〜80 / ATR倍率: 2.5〜4.0 / 損切り: -4〜-6% / ADX: 20〜25 / スイング: 5〜10
中堅アルト(SOL・SUIなど)
EMA: 35〜55 / ATR倍率: 4.0〜5.5 / 損切り: -5〜-7% / ADX: 18〜23 / スイング: 4〜7
小型アルト
EMA: 30〜50 / ATR倍率: 4.5〜6.0 / 損切り: -7〜-10% / ADX: 18〜22 / スイング: 3〜5
時間足別おすすめ設定
1〜5分足:ADXしきい値 15〜20(短期足はADXが低めになる傾向)
15分〜1時間足:ADXしきい値 18〜23
2〜4時間足:ADXしきい値 20〜25
エントリー条件
ロング:EMAが上向き AND ダウ理論トレンドが上昇 AND ADX > しきい値
ショート:EMAが下向き AND ダウ理論トレンドが下降 AND ADX > しきい値
イグジット条件
TP1:エントリーから +ATR×1 → 30%決済
TP2:エントリーから +ATR×2 → 30%決済
TP3:エントリーから +ATR×3 → 30%決済
損切り:設定%を超えたら全決済
トレンド反転:ダウ理論のスイングが逆転したら決済
チャートの見方
EMAライン:上向きのとき緑、下向きのとき赤に色が変わります
グレー背景:ADXがしきい値を下回っている横ばいゾーン(このゾーンではエントリーしません)
グラデーションゾーン:現在値からスイング高値・安値までの距離を視覚化
上位足表示:4時間足のスイングレベルを参考表示
このストラテジーは主に1時間〜4時間足の暗号資産トレンドフォローを想定して設計されています。実運用の前に必ずご自身の対象銘柄・時間足でバックテストを行ってください。過去の結果は将来の利益を保証するものではありません。 Strategy

Indicator

Indicator

Auto S/R Channels [WillyAlgoTrader]Auto Support & Resistance Channels is an overlay indicator that algorithmically discovers the highest-quality ascending and descending price channels by evaluating pivot-point combinations, scoring each candidate by how well price is contained within it, and monitoring the active channels for breakouts and boundary reactions in real time.
Channel drawing is one of the most subjective tasks in technical analysis — two traders rarely agree on where the lines should go. This indicator removes that ambiguity: it systematically tests dozens of pivot-pair combinations, builds a trendline + parallel for each, computes a containment ratio (what percentage of bars fit inside), and displays only the best-fitting result. The channel then becomes a live framework — the script detects breakouts when price closes through a boundary, identifies wick-based reactions (bounces) at support and resistance, fires categorized alerts, and automatically replaces stale channels when new pivots produce a superior fit.
🔍 WHAT MAKES IT ORIGINAL
1. Containment-ratio scoring across 40+ candidates. For each direction (ascending and descending), the algorithm evaluates up to 40 pivot-pair combinations (8 most recent pivots × 5 preceding pivots). For each pair it constructs the full channel — base trendline through the two anchors, parallel through the most extreme opposing pivot — then scans up to 300 bars, counting how many bars have their entire range (low to high) inside the channel with a tolerance of 5% ATR. The ratio of contained bars to total bars is the quality score. Only the candidate that scores highest above the minimum threshold (default 55%) is drawn. A new channel replaces the current one only when it scores at least 70% of the existing score AND its base pivots are actually different — preventing cosmetic redraws when the same pivots simply refine their quality metric.
2. Dual-direction parallel search. Both ascending and descending channel searches run on every new pivot (whether it's a high or a low). This ensures neither direction goes stale — a bug common in channel tools that only re-evaluate one direction per pivot type. Both channels can coexist on the chart, naturally capturing wedges, converging structures, and transitional markets.
3. Three-event signal classification.
— Breakout : close beyond the boundary with crossover verification (previous bar was inside or within 1.5× ATR)
— React : wick touches a boundary (within 12% ATR) but close + open remain inside — a bounce/rejection
— Aggregate : events from both channels combine into Buy / Sell / Wait (e.g., react at ascending support = Buy; breakout below descending support = Sell)
Each event type has its own alert toggle, so you can subscribe only to the signals you care about.
4. Five anti-phantom-signal guards.
— Max extrapolation : no detection beyond maxChannelBars past the second base pivot
— Crossover check : previous close must have been within 1.5× ATR of the boundary — no phantom signals when a new channel is drawn behind price that already moved away
— Smart flag reset : on channel rebuild, breakout flags reset only if price is currently inside the new channel (direction-agnostic boundary test)
— Change-gate : labels and flags are only cleared when the channel's base pivots actually change — if the same two pivots refine their quality score, existing signals are preserved
— Full label cleanup : when a channel does change, all labels from the previous version are deleted — no stale artifacts
5. Per-component line styling. Base line, parallel line, and midline each have independent width and style (solid / dashed / dotted). Combined with configurable fill transparency, extension mode (none / right / both), and separate bull/bear colors, the visual output adapts to any chart style.
⚙️ HOW IT WORKS
Pivot detection:
Swing points are identified with ta.pivothigh() and ta.pivotlow() using the configured lookback length. Up to 40 recent pivots of each type are stored. Pivots lag by N bars — standard for all pivot-based tools.
Ascending channel construction:
Pairs of pivot lows where the second is higher than the first (rising slope) and separated by Min–Max Channel Bars define candidate base trendlines. For each pair, the script scans all stored pivot highs within the channel's time span and selects the one with the greatest positive offset from the base — this becomes the parallel (resistance boundary). The channel width equals the maximum perpendicular distance from base to the highest opposing pivot.
Descending channel construction:
Mirror logic: pairs of pivot highs with falling slope define the base. The lowest opposing pivot low sets the parallel (support boundary).
Quality scoring:
Each candidate is scored by iterating up to 300 bars: a bar is "contained" if low ≥ lower boundary − 5% ATR AND high ≤ upper boundary + 5% ATR. The containment ratio (contained / total) is the quality score. The best candidate above the threshold wins. A replacement requires ≥70% of the current score AND different base pivot bars — this balance allows channels to evolve with the market while preventing noise-driven flickering.
Breakout detection:
On every confirmed bar (barstate.isconfirmed), both channel boundaries are interpolated at the current bar index. For an ascending channel: bullish breakout fires when close > parallel AND close ≤ parallel + 1.5× ATR; bearish breakout when close < base AND close ≥ base − 1.5× ATR. Descending channels use mirrored logic with direction-agnostic boundary identification. Breakout flags prevent duplicate signals until price re-enters the channel.
React detection:
A support reaction triggers when the bar's low penetrates the support boundary within 12% ATR tolerance, but the close and open remain above it — a classic wick rejection. Resistance reaction uses the same logic at the upper boundary.
📖 HOW TO USE
Reading the chart:
— Green channel = ascending (bullish bias) — base from pivot lows, parallel through the highest high
— Red channel = descending (bearish bias) — base from pivot highs, parallel through the lowest low
— Midline = channel equilibrium (50%) — frequently acts as intra-channel support/resistance
— "Breakout ▲" / "Breakout ▼" = confirmed close beyond a channel boundary
— Dashboard shows: Trend / Signal (Buy/Sell/Wait) / Strength / Quality % / Active Channels
Trading approach:
— In an ascending channel: look for long entries at base reactions (support bounces), take profit or watch for rejection at the parallel (resistance). A bullish breakout above the parallel may indicate trend acceleration.
— In a descending channel: look for short entries at base reactions (resistance rejections), cover at the parallel (support). A bullish breakout above the base signals a potential trend reversal.
— The midline often acts as an intermediate decision level — watch for stalls and direction changes there.
— Higher Quality % = more bars historically contained = stronger structural validity.
— When both channels are active simultaneously, the market is likely forming a wedge or converging structure — the directional breakout from whichever channel breaks first typically signals the next move.
Timeframe guidance:
— Scalping (1–15min): Pivot Length 3–7, Min Channel Bars 10–20, Quality 0.45–0.55
— Intraday (1H–4H): Pivot Length 8–15, Min Channel Bars 20–50, Quality 0.55–0.65
— Swing (Daily+): Pivot Length 15–30, Min Channel Bars 30–100, Quality 0.6–0.8
⚙️ KEY SETTINGS REFERENCE
— Pivot Length (default 21): bars left/right for swing detection — higher = fewer, stronger pivots
— ATR Length (default 14): tolerance, crossover guard, and quality calculations
— Min Channel Bars (default 10): minimum distance between the two base pivots
— Max Channel Bars (default 400): maximum lookback for pivot pairs and extrapolation limit for signal detection
— Min Channel Quality (default 0.55): minimum containment ratio — higher = stricter, fewer channels
— Extend Channels (default Right): project lines beyond anchor pivots (Right / Both / None)
— Delete Previous (default On): clean up old drawings and labels when a new channel forms
— Show Breakout Label (default On): display Breakout ▲/▼ labels on the chart
— Show Midlines (default On): 50% equilibrium line inside each channel
— Show Channel Fill (default On): subtle fill between boundaries
— Fill Transparency (default 95): 80–99 — higher = more transparent
🔔 Alerts
Three independent, toggleable alert types:
— Breakout : price closes outside a channel boundary (all five guards active)
— Signal : aggregated Buy/Sell from combined channel events
— React : wick rejection at a channel boundary
All alerts support standard PulseWire text and optional JSON webhook format for 3Commas, Alertatron, or custom bot integrations.
⚠️ IMPORTANT NOTES
— Breakout and react signals require bar-close confirmation — they do not repaint after the bar closes.
— Channels will update when new pivots produce a higher-quality fit with different base points. This is by design — the indicator always shows the best available channel. All previous drawings and labels are cleaned up automatically on change.
— This is a structural analysis and event-detection tool . It maps the dominant price channel and monitors boundary interactions — it does not predict whether breakouts will follow through or reactions will hold.
— Past channel containment does not guarantee future price behavior within the same structure.
— Works across all asset classes and timeframes. No volume data required. Indicator

Adaptive Volatility Trend [WillyAlgoTrader]Adaptive Volatility Trend (AVT) is a trend-following overlay indicator that dynamically adjusts its sensitivity to market conditions using the Kaufman Efficiency Ratio and ATR-based volatility bands.
Unlike static moving averages or fixed-width channels, AVT continuously adapts: it accelerates in strong directional moves and slows down during choppy, range-bound price action — reducing whipsaws where most trend indicators fail.
🔍 WHAT MAKES IT ORIGINAL
The core innovation is a self-tuning mechanism built on three adaptive layers:
1. Kaufman Efficiency Ratio (ER) as an adaptive engine. The ER measures how "efficient" price movement is — the ratio of net directional change to total path traveled over N bars. An ER near 1.0 means price moved in a clean straight line (strong trend); near 0.0 means it went sideways with lots of noise. AVT uses the smoothed ER to dynamically blend between a fast constant (2-period EMA speed) and a slow constant (30-period EMA speed), producing an Adaptive Moving Average that responds quickly in trends and becomes sluggish in chop.
2. ER-scaled ATR bands. The volatility channel doesn't just use raw ATR × multiplier. It incorporates the Efficiency Ratio to narrow the bands during trending conditions (where ER is high) and widen them during ranging markets (where ER is low). This means the channel contracts when the trend is clean — keeping signals tight — and expands when price is noisy — filtering out false breakouts.
3. Composite Signal Scoring System (0–100). Every signal receives a quality score based on three weighted components:
— Trend strength (0–40 pts): derived from the Efficiency Ratio magnitude
— Momentum (0–30 pts): RSI distance from the neutral 50-level in the signal direction
— Volume confirmation (0–30 pts): current volume relative to its 20-period average
Only signals exceeding the user-defined minimum score threshold are displayed — letting you filter out low-conviction setups.
⚙️ HOW IT WORKS
Trend detection:
The indicator calculates an Adaptive Moving Average using the Kaufman method. The slope of this line determines trend direction: if the line rises by more than 5% of current ATR, the trend is classified as bullish; if it falls by the same threshold, bearish. A small dead zone (ATR × 0.05) prevents noise from flipping the trend.
Signal generation:
A BUY signal fires when:
— Trend flips from bearish/neutral to bullish (slope turns positive)
— Price is above the adaptive line
— RSI is not in overbought territory (if RSI filter is enabled)
— Volume exceeds its moving average × threshold (if volume filter is enabled; auto-disabled on forex)
— Composite score meets the minimum threshold
— Bar is confirmed (close-based, no repainting)
SELL signals use the mirror logic.
Anti-repaint compliance:
All signals require barstate.isconfirmed — they only trigger on the close of the bar and never change on historical data. A warmup period (minimum 50 bars or 2× Trend Length) prevents unreliable early signals.
Volume filter on forex:
The indicator automatically detects instruments with no volume data (common on forex pairs) and bypasses the volume filter for those symbols, so it works seamlessly across asset classes.
📖 HOW TO USE
Reading the chart:
— Green trend line + upward slope = bullish regime
— Red trend line + downward slope = bearish regime
— Yellow trend line = neutral / transitioning
— ▲ labels below bars = confirmed BUY signal
— ▼ labels above bars = confirmed SELL signal
— The shaded channel around the trend line shows volatility-adjusted support/resistance zones
Quick-start presets:
— Conservative (Length 30 / ATR 20 / Mult 2.5): fewer signals, higher reliability — suited for swing trading on 4H–Daily
— Default (Length 20 / ATR 14 / Mult 2.0): balanced for most timeframes
— Aggressive (Length 12 / ATR 10 / Mult 1.5): more signals — suited for 15min–1H
— Scalping (Length 8 / ATR 7 / Mult 1.2): fast response — optimized for 1–5min charts
Signal quality:
Use the Score value in the dashboard to gauge conviction:
— 70–100: strong trend + momentum + volume alignment
— 40–69: moderate setup, consider additional confluence
— Below threshold: signal filtered out (not shown)
Dashboard panel:
Displays current trend direction, last signal with its score, Efficiency Ratio %, RSI value, timeframe, and indicator version. Position is adjustable to any corner of the chart.
Alerts & automation:
Supports both standard PulseWire alert messages and JSON webhook format for integration with 3Commas, Alertatron, or custom bots. Alert messages include ticker, price, timeframe, and signal score.
⚙️ KEY SETTINGS REFERENCE
— Trend Length (default 21): lookback for adaptive MA — higher = smoother, lower = faster
— ATR Length (default 14): period for volatility bands — higher = wider bands
— Band Multiplier (default 2.0): ATR multiplier for channel width — higher = fewer false signals
— RSI Filter (on by default): blocks buy signals when RSI > 70, sell signals when RSI < 30
— Volume Filter (on by default): requires volume > SMA(20) × 1.2 — auto-disabled on forex
— Min Signal Score (default 40): minimum composite score for signal display
— Efficiency Smoothing (default 5): EMA smoothing of the Kaufman ER
⚠️ IMPORTANT NOTES
— This indicator does not use future data. No lookahead, no repainting.
— Past performance shown on any chart does not guarantee future results.
— AVT is a tool for identifying trend direction and generating signal candidates — it is not a complete trading system. Always use proper risk management and consider additional confluence before entering trades.
— The indicator works best in trending markets. In prolonged sideways conditions, even filtered signals may produce whipsaws — the Efficiency Ratio in the dashboard helps you assess whether the current market is trending enough for signal reliability. 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

Multi-Index VWAP DashboardTo post this on the PulseWire Community Scripts, you want a description that highlights its multi-instrument correlation and institutional session data. It’s not just a VWAP indicator; it’s a "Tape Reading" dashboard for index traders.
Here is a structured description you can copy and paste:
Description
Overview
The Multi-Index Institutional VWAP Dashboard is a high-performance Tape Reading tool designed for NQ, ES, and YM traders. It provides a real-time "at-a-glance" matrix of how the three major US Indices are performing relative to critical institutional benchmarks. Instead of cluttering your main chart with dozens of lines, this dashboard compiles the data into a clean, Bookmap-inspired UI.
Key Benchmarks Tracked
The dashboard monitors price action for NQ, ES, and YM against:
NY VWAP: Anchored specifically to the New York Open (09:30 AM ET).
PD NY VWAP: The closing value of the previous day's New York session VWAP—a major level for institutional mean reversion.
LOD/HOD Anchored VWAP: Dynamic VWAPs that re-anchor automatically to the current Day's High and Day's Low.
15m Opening Range (OR): Detects if price is trading Inside, Above (▲), or Below (▼) the first 15 minutes of the NY session.
Trend Matrix: A real-time momentum filter for each index to identify cross-market divergence.
Features
Bookmap Style Visuals: Uses custom bubble icons (◎) for a modern, heat-map aesthetic.
Timezone Optimized: Hard-coded for New York Session hours while respecting your local chart offset.
Customizable Layout: Full control over dashboard position (Top/Bottom/Corners) and text sizing to fit any monitor resolution.
Cross-Index Correlation: Easily spot "SMT Divergence" (e.g., when NQ is above its NY VWAP but ES is below it).
How to Use
Bullish Confirmation: Look for "All Green" bubbles across all three indices, specifically price holding above the NY VWAP and OR High.
Mean Reversion: Use the PD NY VWAP and HOD/LOD VWAP as targets or areas of interest for potential reversals.
Trend Divergence: If NQ is showing "Bullish" while YM is showing "Bearish," exercise caution as the indices are decoupled.
Settings Tips
Position: Move the dashboard to the "Bottom Right" if you have other indicators at the top.
Style: Toggle between "Solid," "Bubble," or "Ring" icons in the script settings to match your chart's theme. Indicator

Indicator

Indicator

Strategic Trend FilterStrategic Trend Filter (STF) | MisinkoMaster
Strategic Trend Filter is a structurally weighted trend confirmation overlay designed to identify high-quality directional environments while filtering out low-volatility noise and weak structural movement.
Rather than relying on traditional moving averages, STF constructs a dynamically weighted equilibrium level derived from multiple price components and structural factors. It then validates trend conditions only when price displacement is supported by sufficient volatility expansion.
The result is a disciplined trend filter that emphasizes structural strength over simple price crossing behavior.
Core Philosophy
Many trend tools respond primarily to price direction. STF goes further by incorporating:
• Structural correlation behavior
• Statistical dispersion
• Rate-of-change magnitude
• Price range positioning
• Volatility confirmation
This multi-factor structure allows the filter to respond only when price movement demonstrates internal coherence and sufficient expansion.
In short, STF is designed to confirm quality trends, not just directional movement.
Key Features
Multi-factor structural weighting model
Dynamic equilibrium filter instead of traditional moving average
Volatility-confirmed trend validation
Volume-aware filter stabilization
Median-based volatility confirmation
Automatic trend coloring
Optional on-chart long and short labels
Overlay design for direct price interaction
Reduced whipsaws in low-volatility environments
Suitable as a directional bias filter for strategies
How It Works (Conceptual)
The indicator builds a composite equilibrium level using several internal components:
Structural Correlation
Measures how individual price components relate to the composite price structure over the lookback window.
Statistical Dispersion
Standard deviation measurements help evaluate how far price is distributing around equilibrium.
Momentum Magnitude
Absolute rate-of-change calculations measure directional displacement strength.
These components are combined into weighted factors that influence how much each price dimension contributes to the final filter value.
The resulting filter represents a dynamic structural equilibrium rather than a simple average.
Additionally, a volatility confirmation layer compares current true range behavior against its median condition. Trend state changes are validated only when sufficient volatility is present.
Proprietary weighting relationships remain protected in the invite-only implementation.
Trend Logic Explained
Bullish State
Activated when price structure holds above the dynamic filter and volatility confirms expansion. This suggests sustained upward pressure supported by structural alignment.
Bearish State
Activated when price structure remains below the filter and volatility confirms expansion. This indicates organized downside movement rather than random fluctuation.
If volatility contracts or price fails to maintain structural positioning, the filter avoids unnecessary state changes.
Volume Stabilization Mechanism
When volume declines relative to the previous bar, the filter stabilizes temporarily. This reduces sensitivity during participation drops, helping avoid false transitions caused by thin liquidity conditions.
This feature improves robustness in lower-liquidity assets and during session transitions.
Visual Components
Dynamic Filter Line
Represents structural equilibrium and adjusts continuously to price behavior.
Color-Coded Environment
Filter and candles change color to reflect bullish or bearish state.
Shaded Region
A filled zone between price and filter visually highlights directional dominance.
Optional Long / Short Labels
When enabled, transition points are clearly marked on the chart.
Inputs Overview
Lookback Period
Controls the primary structural evaluation window. Higher values create smoother, more stable filters. Lower values increase responsiveness.
Confirmation Length
Defines the volatility median window used for expansion validation.
Allow Labels?
Enables or disables on-chart long and short markers.
Parameter Tuning Guidance
Shorter Lookback
→ Faster adaptation
→ More sensitive to structural shifts
→ Suitable for lower timeframes
Longer Lookback
→ More stable equilibrium
→ Better for swing or position trading
Shorter Confirmation Length
→ Faster volatility confirmation
→ More reactive signals
Longer Confirmation Length
→ Stricter volatility validation
→ Fewer but stronger transitions
Best Use Cases
Directional bias filter for breakout systems
Confirmation layer for momentum strategies
Trend qualification before position scaling
Volatility-aware trade filtering
Multi-timeframe bias alignment
Portfolio-level environment scanning
Strategy Integration Ideas
Use STF to:
• Trade only in the direction of confirmed trend state
• Avoid mean-reversion setups during strong structural expansion
• Filter out low-volatility consolidation phases
• Improve win rate by aligning entries with structural bias
STF performs best when paired with entry triggers such as pullbacks, continuation patterns, or momentum expansions.
Summary
Strategic Trend Filter is a structurally weighted, volatility-confirmed overlay designed to detect organized directional movement while filtering weak or noisy price action.
By combining correlation structure, dispersion metrics, momentum magnitude, and volatility validation, STF delivers a disciplined trend confirmation framework suitable for discretionary traders and systematic strategy developers alike. Indicator

Directional Logistic Oscillator | GainzAlgoOverview
The Directional Logistic Oscillator (DLO) is a momentum-based indicator designed to measure directional market strength and identify potential trend reversals or mean-reversion opportunities. It builds on the classic Directional Movement Index (DMI) by transforming its components (+DI, -DI, and ADX) into probabilistic signals using logistic functions, then combining them into a bounded oscillator that oscillates between approximately -1 and +1.
Unlike traditional oscillators like RSI or MACD, DLO emphasizes directional probability by estimating the likelihood of bullish or bearish dominance while factoring in overall trend strength (via ADX). This makes it particularly useful for:
Spotting overbought/oversold conditions in ranging markets.
Confirming trend shifts in trending markets.
Generating reversal signals based on oscillator cycles.
The oscillator is plotted as histogram bars (columns) for visual clarity, with color-coding to highlight strength and direction. Positive values indicate bullish momentum, negative values bearish, and crossings of key levels can signal trading opportunities.
How It Works
At its core, DLO processes DMI data through a logistic transformation to create "probabilities" of directional movement:
1. DMI Calculation : Uses the standard DMI with a user-defined length (default 14) to compute +DI (upward movement), -DI (downward movement), and ADX (trend strength).
2. Logistic Probability : Each DMI component is normalized against its long-term mean and passed through a logistic (sigmoid) function. This creates smooth probabilities between 0 and 1.
The logistic function is defined as:
logistic_prob(series, mean_lb, slope, smooth_len) =>
mean = ta.sma(series, mean_lb)
z = (series - mean) * slope
prob_raw = 1.0 / (1.0 + math.exp(-z))
ta.ema(prob_raw, smooth_len)
This step makes the indicator adaptive to market conditions, with the "slope" controlling how sharply it reacts to deviations from the mean.
3. Net Directional Strength : Bullish minus bearish probability, scaled by ADX probability and a user-defined multiplier, then bounded using a hyperbolic tangent (tanh) function to keep values between -1 and +1.
net_dir = prob_plus - prob_minus
strength_raw = net_dir * prob_adx * osc_scale
strength_bound = tanh(strength_raw)
Tanh ensures smooth, bounded output without clipping extremes unnaturally.
4. Smoothing and Signals: The raw strength is smoothed with EMA, then further processed into SMA and EMA lines for signal generation. Percentile-based thresholds (adaptive over a lookback period) detect extreme zones for mean-reversion signals.
The result is a visually intuitive oscillator: Green bars for bullish, red for bearish, with varying intensity based on momentum.
Inputs
DLO offers customizable settings grouped for ease of use. Defaults are tuned for balanced performance on daily charts.
DMI Settings
DI Length (default: 14): Controls DMI sensitivity. Shorter lengths react faster to price changes but add noise; longer lengths smooth signals for trends.
Mean Lookback (default: 360): The period for calculating the long-term average of DMI components. Higher values provide a more stable baseline, reducing false signals from short-term volatility. Lower values make the indicator more responsive but noisier
Difference between high and low mean lookback period, lower length can pick up on new trends faster but at the cost of increased noise.
Logistic Probability Settings
LR Slope (higher = steeper) (default: 0.18): Adjusts the steepness of the logistic curve. Lower values create gradual transitions (smoother oscillator); higher values make sharp shifts, emphasizing extremes.
Probability Smoothing (EMA) (default: 3): Short EMA to reduce noise in probabilities. Keep low (1-5) for responsiveness; higher for smoothness.
Oscillator Settings
Oscillator Scale (pre-tanh) (default: 2.5): Multiplies net strength before bounding. Higher values increase sensitivity and amplitude (larger swings); lower values compress the range for subtler signals.
Comparison of 4 different settings for Oscillator scale, showing that as the scale parameter increases, the oscillator output becomes more pronounced, exhibiting higher amplitude compression toward the bounds and spending more time saturated near the extreme values of +1 and −1.
Oscillator Smoothing Length (default: 7): Period for SMA/EMA smoothing of the final oscillator. Longer = smoother, fewer signals; shorter = more reactive.
Color & Display Settings
Buy Color / Sell Color: Customize colors for bullish/bearish visuals.
Plot Reversion Signals (default: true): Shows arrows for cycle reversals (local highs/lows).
Plot Mean-Reversion Signals (default: true): Arrows for crossings from extreme percentile zones.
Plot Oscillator MA (default: false): Overlays an SMA on the oscillator for additional confirmation.
Allow Intrabar Updating (default: true): Enables real-time updates within incomplete bars (may cause minor repainting).
Visuals
Oscillator Histogram: Columns colored green (bullish) or red (bearish), with lighter shades for weaker momentum. Crosses above/below zero signal momentum shifts.
Horizontal Lines: Zero (neutral), +0.5 (strong bullish), -0.5 (strong bearish).
Background Highlights: Subtle green/red shading when in strong zones.
Bar Colors: Mirrors oscillator direction on the price chart.
Color-coded trend regimes: green/teal highlight strong and weak uptrends, red/purple mark strong and weak downtrends, while the oscillator histogram confirms direction and strength through its polarity and amplitude.
Signals
Mean-Reversion (MR) Signals : Triangles (▲/▼) when the smoothed oscillator crosses up from low percentiles (oversold) or down from high percentiles (overbought). These are adaptive, using historical data for dynamic extremes.
Buy: Oscillator crosses above lower threshold (e.g., 10th/5th percentile).
Sell: Crosses below upper threshold (e.g., 90th/95th percentile).
Reversion Signals : Arrows (⬆/⬇) at local turning points in the oscillator cycle, indicating potential reversals.
Zero-Line Crosses : Basic bullish/bearish momentum changes.
Usage Tips
Trend Confirmation: Use in trending markets—persistent positive/negative values confirm up/down trends. Pair with moving averages for entries.
Mean-Reversion: In sideways markets, trade MR signals from extremes. Combine with support/resistance.
Divergences: Look for price making new highs/lows while DLO doesn't for reversal setup.
Alerts
MR Buy/Sell: Extreme zone crosses (percentile-based).
Reversion Up/Down: Cycle turning points.
Osc Bullish/Bearish Cross: Zero-line crosses.
Limitations
Like all oscillators, DLO can lag in strong trends or produce false signals in choppy markets, use with confirmation.
Percentile thresholds adapt over time but may vary by asset volatility.
Not a standalone system; always combine with risk management.
Indicator

Indicator

True Baseline Median SuperTrendTrue Baseline Median SuperTrend (TBM SuperTrend) | MisinkoMaster
True Baseline Median SuperTrend is a volatility-adaptive trend indicator designed to refine traditional SuperTrend logic by introducing a volatility-filtered baseline and median-based smoothing techniques.
Instead of relying on a fixed midpoint calculation, TBM SuperTrend dynamically constructs its baseline from structurally significant price observations, then applies layered median smoothing to reduce noise while preserving trend integrity.
The result is a cleaner, more stable trend-following tool that reacts to meaningful shifts in volatility and directional pressure without excessive whipsaws.
Core Philosophy
Most SuperTrend-style indicators anchor their bands to a simple price midpoint and apply an ATR-based offset. While effective, this approach can be overly sensitive during volatile consolidations.
TBM SuperTrend improves this structure by:
• Building a volatility-qualified baseline
• Filtering insignificant price movements
• Applying median smoothing instead of simple averaging
• Retaining ATR-based adaptive band distance
This creates a trend structure that prioritizes meaningful price expansion over random noise.
Key Features
Volatility-qualified baseline construction
Median-smoothed upper and lower bands
ATR-based adaptive volatility envelope
Dynamic trend state detection
Automatic candle coloring
Clear long and short transition labels
Reduced whipsaw behavior compared to standard SuperTrend
Works across intraday and higher timeframes
Designed for trend continuation and breakout frameworks
How It Works (Conceptual)
The indicator operates in three structural layers:
Volatility Measurement
Market volatility is assessed using an ATR-based structure.
Baseline Construction
Instead of averaging all recent prices, the script filters price samples based on volatility conditions. Only structurally relevant bars contribute to the baseline calculation. This ensures that the baseline reflects meaningful movement rather than passive drift.
Median Smoothing
Both the volatility-adjusted bands and the baseline structure undergo median smoothing. Median smoothing is less sensitive to outliers than standard averaging, which helps stabilize the trend line during erratic price spikes.
After the adaptive bands are constructed, price interaction with those bands determines directional bias:
• Price closing above the upper threshold confirms bullish trend state
• Price closing below the lower threshold confirms bearish trend state
Internal implementation details remain proprietary in the protected version.
Trend Logic Explained
Bullish State
When price maintains strength above the adaptive upper boundary, the indicator confirms a long bias. The trailing structure shifts beneath price, acting as dynamic support.
Bearish State
When price closes below the adaptive lower boundary, the indicator confirms a short bias. The trailing structure shifts above price, acting as dynamic resistance.
State transitions occur only when decisive boundary breaks happen, helping reduce false flips.
Visual Components
Trend Lines
Only the active directional band is displayed, reducing clutter and emphasizing current bias.
Shaded Volatility Zone
A filled region between price and the active band visually highlights trend dominance.
Long / Short Labels
Clear on-chart labels mark confirmed trend transitions.
Candle Coloring
Price candles automatically reflect current trend state for immediate visual recognition.
Inputs Overview
Source
Defines the price series used for baseline construction.
ATR Length
Controls the volatility lookback period.
True Baseline Length
Determines the window used for constructing the volatility-qualified baseline.
Factor
Adjusts the volatility multiplier that expands or contracts the adaptive bands.
Median Period
Controls the median smoothing strength applied to the bands.
Lower values increase responsiveness.
Higher values improve stability and reduce noise.
Why Median Smoothing Matters
Traditional smoothing methods (like EMA or SMA) can be distorted by sharp price spikes. Median-based smoothing reduces the impact of extreme values, making TBM SuperTrend particularly effective in:
• Crypto markets
• High-volatility equities
• News-driven instruments
• Lower timeframe trading
This improves structural consistency during sudden volatility expansions.
Best Use Cases
Trend-following systems
Breakout confirmation
Pullback entries within established trends
Trailing stop framework
Directional bias filtering
Volatility-adaptive strategy design
Parameter Tuning Guidance
Shorter ATR Length
→ Faster adaptation
→ More sensitivity
→ Suitable for intraday trading
Longer ATR Length
→ Smoother volatility structure
→ Better for swing trading
Higher Factor
→ Wider bands
→ Fewer signals
→ Stronger trend confirmation
Lower Factor
→ Tighter bands
→ Earlier entries
→ More reversals
Longer Median Period
→ Smoother band structure
→ Reduced whipsaws
Shorter Median Period
→ Faster reaction
→ More sensitivity to shifts
Practical Strategy Integration
Use TBM SuperTrend as:
• Primary directional filter
• Trailing stop mechanism
• Confirmation layer for breakout systems
• Bias alignment tool across multiple timeframes
It performs best when combined with momentum confirmation or volume expansion tools.
Summary
True Baseline Median SuperTrend enhances traditional SuperTrend logic by introducing volatility-qualified baseline construction and median smoothing for structural stability.
The result is a cleaner, more adaptive trend tool that prioritizes meaningful price movement while minimizing noise. It is well suited for traders seeking a disciplined, volatility-aware trend framework that remains robust across changing market conditions. Indicator

Indicator

Delta Ladder Order Flow [UAlgo]Delta Ladder Order Flow is an overlay order flow visualizer that builds a per bar delta ladder using lower timeframe candles as an intrabar proxy. For each recent bar, the script pulls the underlying lower timeframe open, high, low, close, and volume arrays, then distributes volume into discrete price buckets. Each bucket accumulates estimated buy volume and sell volume, producing a ladder that resembles a footprint style view.
The display focuses on three core outputs:
A delta heatmap ladder where each price level is colored by net delta dominance
A Point of Control highlight that marks the highest total volume level inside the bar
A stacked imbalance detector that scans diagonally across levels to identify aggressive one sided participation and optionally projects that stack forward
The system is designed with stability controls for real world chart conditions. It includes dynamic scaling to prevent excessive level counts on high range bars, object budgeting through bars to draw limits, and text filtering to reduce clutter.
🔹 Features
1) Intrabar Resolution via Lower Timeframe Data
The ladder is constructed using request.security_lower_tf. You select an Intrabar Resolution timeframe that must be lower than the chart timeframe. The script then receives arrays of LTF candles for each chart bar and uses them as a proxy for footprint style aggregation.
This approach provides a practical order flow approximation on PulseWire charts without requiring native tick level data.
2) Ladder Aggregation with Tick Size Multiplier
Price levels are aggregated using the symbol mintick multiplied by a user multiplier. Increasing the multiplier produces thicker ladder steps and fewer levels. Decreasing it produces finer granularity but increases the number of boxes drawn.
This control is critical for balancing detail versus performance across different symbols and volatility regimes.
3) Dynamic Scaling to Prevent High Range Bar Overload
A single volatile bar can contain too many price steps if the granularity is too fine. To prevent crashes, the script estimates how many steps would be required for the bar and increases the effective step size when the raw step count exceeds Max Levels per Bar.
This keeps rendering stable even during high volatility events while still maintaining a consistent ladder representation.
4) Buy, Sell, and Neutral Volume Attribution
Each LTF candle’s direction is inferred from its open and close:
Close above open is treated as buy side volume
Close below open is treated as sell side volume
Close equal open is treated as neutral and split evenly between buy and sell
Volume is then distributed across the price buckets covered by the LTF candle range so that wide candles spread their influence across multiple levels.
5) Delta Heatmap Ladder with Intensity Scaling
Each price bucket computes delta as buy volume minus sell volume and total volume as the sum of both. Ladder cells are colored positive or negative based on delta sign, and transparency is scaled by how dominant the delta is relative to the maximum total volume level inside that bar. This yields a compact heatmap where strong imbalances visually stand out.
A square root curve is applied to intensity to improve mid tone visibility without making everything fully opaque.
6) Point of Control Highlight
The ladder tracks the price level with the highest total volume and marks it as the Point of Control. When enabled, the POC row uses a dedicated border color and a stronger border width so the acceptance anchor is immediately visible.
7) Stacked Imbalance Detection and Projection
The script can detect stacked diagonal imbalances. It compares volume across adjacent price levels using a diagonal logic similar to footprint tools:
Bullish diagonal checks buy volume at a level versus sell volume at the level below
Bearish diagonal checks sell volume at a level versus buy volume at the level above
An imbalance requires the winning side to exceed the losing side by the configured Imbalance Ratio and also exceed a minimum volume threshold to filter low volume noise. When consecutive imbalanced levels reach the Stacked Levels count, the stack is marked and optionally extended forward as a zone.
Stack members also override normal heatmap coloring and are rendered more solid for emphasis.
8) Clean Visual Controls
Several options support readability:
Bars to Draw limits workload and object count
Show Delta Values can be toggled on or off
Min Delta to Show Text filters small prints
Ladder Width percent controls how wide the ladder is relative to the bar space
Text size can be adjusted for different chart zoom levels
Box outline can be hidden by default for a cleaner footprint aesthetic
🔹 Calculations
1) Intrabar data acquisition (lower timeframe arrays)
The script requests arrays of LTF OHLCV values for each chart bar using request.security_lower_tf.
ltf_open = request.security_lower_tf(syminfo.tickerid, tf_input, open)
ltf_close = request.security_lower_tf(syminfo.tickerid, tf_input, close)
ltf_high = request.security_lower_tf(syminfo.tickerid, tf_input, high)
ltf_low = request.security_lower_tf(syminfo.tickerid, tf_input, low)
ltf_vol = request.security_lower_tf(syminfo.tickerid, tf_input, volume)
These arrays contain the lower timeframe candles that make up each chart bar. Each chart bar index has its own embedded array.
2) Base tick step (bucket size control)
Bucket size starts from mintick multiplied by Tick Size Multiplier.
var float base_tick_step = syminfo.mintick * tick_size_mult
This is the baseline price increment used to build the ladder levels.
3) Last bar execution model (performance design)
The script only builds and draws ladders when barstate.islast is true. It then reconstructs the last N bars using an index offset.
if barstate.islast
int start_idx = math.max(0, bar_index - bars_to_draw + 1)
for i = start_idx to bar_index
int offset = bar_index - i
float arr_o = ltf_open
float arr_c = ltf_close
float arr_h = ltf_high
float arr_l = ltf_low
float arr_v = ltf_vol
This design dramatically reduces CPU and memory load compared to updating every bar.
4) Dynamic scaling per bar (anti crash protection)
For each bar, the script estimates how many price steps would be needed using the current bucket size. If that count exceeds Max Levels per Bar, it increases the step size only for that bar.
float bar_h = high
float bar_l = low
float bar_range = bar_h - bar_l
float raw_steps = bar_range / base_tick_step
int scaler = 1
if raw_steps > max_levels_per_bar
scaler := int(math.ceil(raw_steps / max_levels_per_bar))
float current_tick_step = base_tick_step * scaler
Result:
Calm bars use fine granularity
High range bars are automatically compressed into fewer buckets
5) LTF candle direction classification (buy, sell, neutral)
Each LTF candle is classified using its open and close. Neutral candles split volume evenly.
bool is_buy = c > o
bool is_sell = c < o
bool is_neutral = c == o
This is a heuristic proxy for aggressor side. It is not true bid ask data.
6) Align LTF candle range to bucket grid
The candle low and high are rounded to the current tick step so bucket prices align cleanly.
float low_aligned = math.round(l / current_tick_step) * current_tick_step
float high_aligned = math.round(h / current_tick_step) * current_tick_step
7) Step counting and volume per step
The script computes how many bucket levels the candle touches and divides volume equally across them.
int steps = int(math.round((high_aligned - low_aligned) / current_tick_step)) + 1
if steps > 500
steps := 500
float vol_per_step = v / steps
This means wide candles distribute volume across more ladder cells, while tight candles concentrate volume into fewer cells.
8) Writing volume into the ladder map (PriceLevel storage)
Each chart bar owns a DeltaLadder with a map of price to PriceLevel. Each PriceLevel stores buy and sell volume. Volume is added step by step.
type PriceLevel
float price
float buy_vol = 0.0
float sell_vol = 0.0
type DeltaLadder
int bar_idx
map levels
float min_price = 10000000.0
float max_price = 0.0
float max_vol_level = 0.0
float poc_price = na
float poc_vol = 0.0
The add method updates volumes and also tracks max volume and POC:
method add_volume(DeltaLadder this, float price, float vol, bool is_buy, bool is_neutral) =>
if not this.levels.contains(price)
this.levels.put(price, PriceLevel.new(price))
PriceLevel lvl = this.levels.get(price)
if is_neutral
lvl.buy_vol += vol * 0.5
lvl.sell_vol += vol * 0.5
else if is_buy
lvl.buy_vol += vol
else
lvl.sell_vol += vol
float t = lvl.total()
if t > this.max_vol_level
this.max_vol_level := t
if t > this.poc_vol
this.poc_vol := t
this.poc_price := price
The main loop calls this method for each bucket level touched by each LTF candle:
for p = 0 to steps - 1
float level_price = low_aligned + (p * current_tick_step)
ladder.add_volume(level_price, vol_per_step, is_buy, is_neutral)
9) Delta and total volume formulas
Delta and total are defined as methods on PriceLevel.
method delta(PriceLevel this) =>
this.buy_vol - this.sell_vol
method total(PriceLevel this) =>
this.buy_vol + this.sell_vol
These values drive both coloring and POC selection.
10) Stacked imbalance detection (diagonal footprint logic)
Prices are sorted so neighbor comparisons are correct. A stack_map stores whether each price belongs to a bullish or bearish stacked run.
float prices = ladder.levels.keys()
array.sort(prices)
map stack_map = map.new()
Diagonal comparisons:
Bullish diagonal compares BuyVol at level i with SellVol at level below i minus 1
Bearish diagonal compares SellVol at level i with BuyVol at level above i plus 1
Bullish check includes a zero handling rule:
if i > 0
float p_below = array.get(prices, i-1)
PriceLevel lvl_below = ladder.levels.get(p_below)
if lvl_below.sell_vol == 0
if lvl.buy_vol > imb_min_vol
direction := 1
else
if lvl.buy_vol > lvl_below.sell_vol * imb_ratio and lvl.buy_vol > imb_min_vol
direction := 1
Bearish check includes symmetric logic:
if i < array.size(prices) - 1
float p_above = array.get(prices, i+1)
PriceLevel lvl_above = ladder.levels.get(p_above)
if lvl_above.buy_vol == 0
if lvl.sell_vol > imb_min_vol
direction := -1
else
if lvl.sell_vol > lvl_above.buy_vol * imb_ratio and lvl.sell_vol > imb_min_vol
direction := -1
Runs are tracked and only accepted if the number of consecutive levels meets the stacked requirement:
if math.abs(i - run_start_idx) >= stack_count
for k = run_start_idx to i - 1
stack_map.put(array.get(prices, k), run_dir)
The script also draws a projected zone for the detected stack band:
box.new(right_time, p_top + current_tick_step/2, right_time + 1000 * 60 * 60 * 24, p_bot - current_tick_step/2,
xloc=xloc.bar_time, border_width=0, bgcolor=color.new(c_stack, 85), extend=extend.right)
11) Heatmap intensity and transparency mapping
For each price level, intensity is computed as abs(delta) relative to the maximum total volume level in the bar, then curved and mapped into transparency.
float intensity = ladder.max_vol_level > 0 ? math.abs(delta) / ladder.max_vol_level : 0
intensity := math.min(intensity, 1.0)
float curved_intensity = math.sqrt(intensity)
float transp = 97 - (curved_intensity * 57)
Stacked members force stronger visibility:
if stack_map.contains(p)
intensity := 1.0
transp := 30
12) POC marking in the drawing pass
POC is detected during volume accumulation, then used in rendering to upgrade the border style for that cell.
bool is_poc = show_poc and (p == ladder.poc_price)
color border_c = is_poc ? col_poc : col_outline
int border_w = is_poc ? 2 : 1
13) Delta text rendering filter
Text labels are optional and can be filtered by a minimum absolute delta threshold.
if show_text and math.abs(delta) >= text_threshold
string txt = str.tostring(delta, format.volume)
label.new(int((left_time + right_time)/2), p, txt,
xloc=xloc.bar_time, style=label.style_none,
textcolor=txt_col, size=text_size)
Indicator

Accumulation Zone Profiles [UAlgo]Accumulation Zone Profiles is an overlay indicator that detects low volatility accumulation phases and automatically builds a fixed range volume profile for each confirmed zone. The script uses a statistical volatility model based on log returns, identifies periods where volatility compresses into an unusually quiet regime, then verifies that price action remains sufficiently sideways before confirming the zone.
When a zone is confirmed, the indicator draws two complementary views:
A highlighted accumulation range on the chart
A fixed range volume profile drawn to the right of the zone, including Point of Control and Value Area levels
The intent is to turn consolidation into a structured map. Instead of treating ranges as vague rectangles, the script assigns a volume distribution to the range so you can see where the market accepted price, where it rejected price, and which levels are most likely to matter during expansion.
🔹 Features
1) Statistical Accumulation Detection Using Log Volatility
The detection engine starts from log returns r = ln(C / C ) and builds an EWMA based volatility estimate. Volatility is converted into log space and evaluated with a rolling distribution model. A z score determines whether the current volatility is unusually low relative to its own history.
Zones begin when the z score falls below a configurable entry threshold and they end after volatility recovers above an exit threshold for a configurable number of confirmation bars.
2) Sideways Quality Filter With Trend Score
Not every low volatility period is true accumulation. The script measures drift using a trend score defined as:
absolute sum of returns divided by sum of absolute returns
Lower values indicate more rotation and less directional drift. A maximum trend score filter ensures zones remain meaningfully sideways before a profile is created.
3) Non Repainting Option Using Confirmed Bars
When enabled, the system only updates on confirmed bars. This reduces repainting behavior and makes zone start and zone end decisions more stable for live trading workflows.
4) Fixed Range Volume Profile Per Zone
For each confirmed accumulation zone, the script builds a histogram of volume across a user selected number of price rows. Each bar’s volume is distributed into bins according to how much of that candle range overlaps each bin. This produces a true fixed range profile for the zone.
The profile is drawn to the right of the zone so it does not cover price action.
5) Point of Control and Value Area Levels
The highest volume row is treated as the Point of Control. Value Area High and Value Area Low are computed by expanding outward from POC until a target percent of total volume is captured. This creates a practical acceptance framework inside the zone.
Optional plotting allows:
Highlighting the POC row
Drawing VAH and VAL lines
Drawing zone boundary guides
Showing an information label that summarizes zone statistics
6) Tick Alignment For Clean Levels
If enabled, the zone range, bin step size, and derived levels are aligned to the instrument tick size. This produces cleaner price levels and reduces floating point noise in labels and lines.
7) Object Budget Management
Volume profiles use many boxes. The script computes an effective rows value based on the number of profiles you choose to keep, then limits total box usage so you are less likely to hit platform object limits. Older profiles are deleted automatically when new ones are created.
8) Alerts
Two alerts are available:
Accumulation Zone Started
Accumulation Zone Confirmed and Profile Created
This supports automation such as watchlist monitoring and breakout preparation.
🔹 Calculations
1) Log Return and EWMA Variance
The script defines log return as ln(C / C ) and uses an EWMA of squared returns as a variance proxy.
Alpha for EWMA:
f_alpha(int len) =>
2.0 / (len + 1.0)
Log return:
lr = math.log(close / close )
lr := na(close ) or close == 0.0 ? 0.0 : lr
EWMA variance and volatility:
alphaFast = f_alpha(fastLen)
var float ewmaVarR = na
ewmaVarR := na(ewmaVarR ) ? lr * lr : alphaFast * (lr * lr) + (1.0 - alphaFast) * ewmaVarR
vol = math.sqrt(math.max(ewmaVarR, 0.0))
2) Log Volatility Distribution and z Score
Volatility is transformed into log space to stabilize distribution behavior. The script maintains EWMA estimates of mean and second moment, then computes standard deviation and z score.
eps = 1e-10
logVol = math.log(vol + eps)
alphaDist = f_alpha(distLen)
var float m1 = na
var float m2 = na
m1 := na(m1 ) ? logVol : alphaDist * logVol + (1.0 - alphaDist) * m1
m2 := na(m2 ) ? logVol * logVol : alphaDist * (logVol * logVol) + (1.0 - alphaDist) * m2
sigma = math.sqrt(math.max(m2 - m1 * m1, eps))
z = (logVol - m1) / sigma
Interpretation:
Negative z means volatility is below its typical level
More negative z means stronger compression
3) Zone Start and Zone End Conditions
Entry and exit logic uses the z score relative to thresholds:
Start when z is less than or equal to minus Enter Threshold
End when z is greater than or equal to minus Exit Threshold for Exit Confirm Bars
lowNow = not na(z) and z <= -enterZ
highNow = not na(z) and z >= -exitZ
Exit confirmation counter:
zb.exitCount := highNow ? zb.exitCount + 1 : 0
bool exitByConfirm = zb.exitCount >= exitBars
A maximum zone duration also forces closure:
bool exitByMax = zb.barCount() >= maxZoneBars
If exit is triggered via confirmation bars, the script removes those last bars from the zone before profiling to avoid contaminating the accumulation range with the volatility recovery phase.
4) Sideways Drift Score Filter
During zone building, returns are accumulated:
sumR is the signed drift
sumAbsR is total movement magnitude
Trend score:
method driftScore(ZoneBuilder this) =>
math.abs(this.sumR) / math.max(this.sumAbsR, 1e-10)
A zone is accepted only if:
Bar count is at least Min Zone Bars
Drift score is less than or equal to Max Trend Score
5) Profile Range and Row Step
Once accepted, the profile range is built from the min low and max high of the zone. The range is optionally aligned to tick.
Step size equals range divided by rows, with optional tick alignment:
float stepRaw = (hi - lo) / rows
float step = stepRaw
if alignTick
step := math.max(syminfo.mintick, f_roundToTick(stepRaw))
6) Volume Histogram Construction
For each bar in the zone, volume is assigned into bins.
If the candle range is very small, volume goes to a single nearest bin.
Otherwise, volume is distributed proportionally by overlap between candle range and each bin range.
Core proportional distribution logic:
float overlap = math.max(0.0, math.min(bh, binHi) - math.max(bl, binLo))
if overlap > 0
float frac = overlap / br
array.set(binVol, b, array.get(binVol, b) + bv * frac)
This produces binVol, a per row volume distribution.
7) POC Calculation
POC is the index of the maximum bin volume. POC price is the center of that row.
if v > maxV
maxV := v
pocIdx := b
float poc = lo + (pocIdx + 0.5) * step
8) Value Area Computation
Value Area is derived by expanding outward from POC until the cumulative volume reaches Value Area percent of total volume.
Target volume:
float target = totV * (valueAreaPct / 100.0)
Expand left and right by choosing the side with higher next volume until the target is met. This creates a contiguous value area band.
VAL and VAH mapping to prices:
float valP = lo + left * step
float vahP = lo + (right + 1) * step
9) Rendering Logic
Zone highlight is drawn directly over the accumulation period using a box with configurable fill and border transparency.
The volume profile is drawn as a stack of boxes to the right of the zone. Each row width is proportional to row volume relative to max row volume. Transparency is mapped so high volume rows appear more prominent.
POC row can be highlighted using a dedicated color and transparency configuration.
VAH and VAL can be drawn as horizontal lines across the profile region, and optional boundary lines can mark the start and end of the detected zone.
10) Profile Retention and Cleanup
Profiles are stored in an array. When the number of stored profiles exceeds Keep Last Profiles, the oldest profile is deleted and all of its objects are removed. This keeps the chart responsive and prevents reaching the platform maximum object counts. Indicator

Price-Volume-Volatility Cube [LuxAlgo]The Price-Volume-Volatility Cube indicator provides a 3D visualization of the relationship between price, volume, and volatility using a Cabinet Oblique projection. By mapping these three critical market dimensions onto a normalized 3D space, the tool allows traders to observe how market conditions evolve and cluster within a specific lookback window.
🔶 USAGE
The indicator renders a wireframe cube on the chart that represents the boundaries of the selected lookback period. Each data point within that period is plotted as a colored sphere inside the cube, creating a "cloud" that reveals the character of recent price action.
🔹 The 3D Axes
The cube uses three distinct axes to position data points:
Volume (X-Axis): Represents the relative volume of the bar. Points further to the right indicate higher relative volume.
Volatility (Y-Axis): Represents the True Range (TR) of the bar, projected as depth. Points appearing "deeper" in the cube indicate higher volatility.
Price (Z-Axis): Represents the closing price. Points higher up in the cube indicate prices closer to the period's high, while lower points represent prices near the period's low.
🔹 Interpreting the Data Path
The current bar is highlighted with projection lines that connect its position to the floor and the individual axes. This helps you identify if the current market state is an outlier (e.g., high price, high volume, low volatility) or if it is sitting within a common cluster.
The colors of the points transition from red (near the period low) to green (near the period high), providing an immediate visual cue for price location regardless of the cube's orientation.
🔶 DETAILS
The script utilizes a Cabinet Oblique projection to transform 3D coordinates into 2D screen space. This specific projection preserves the proportions of the X and Z axes while scaling the Y (depth) axis by half at a 45-degree angle to maintain visual clarity.
To maintain a consistent visual experience, the indicator automatically calculates the vertical height based on the Cube Base Width . This ensures the visualization maintains a perfect 1:1:1 aspect ratio, keeping the geometry as a true cube regardless of the user's horizontal scaling.
Additionally, the vertical position of the cube is automatically handled to ensure the visualization remains centered and visible within the indicator pane.
🔹 Normalization
To ensure the data fits perfectly within the cube, all values are normalized between 0 and 1 based on the minimum and maximum values found within the user-defined lookback period. This means the cube always represents the relative "range" of behavior over that specific window of time.
🔶 SETTINGS
🔹 Cube Settings
Lookback Period: Determines the number of bars used to calculate the min/max values for normalization and the number of points rendered inside the cube.
🔹 Visuals
Cube Base Width (Bars): Controls the horizontal scale of the cube in chart bars and automatically determines the height to maintain a 1:1:1 aspect ratio.
🔹 Position
Horizontal Offset (Bars): Moves the cube left or right relative to the last bar. Indicator

Multi-Horizon Volatility Waterfall [LuxAlgo]The Multi-Horizon Volatility Waterfall indicator is a quantitative tool that visualizes market volatility as a multi-layered spectrum across ten distinct time horizons. By normalizing Average True Range (ATR) using percentile ranking, the script identifies volatility clusters and regime shifts, providing a comprehensive "heat map" of market expansion and compression directly on the price chart and in a dedicated oscillator pane.
🔶 USAGE
The indicator provides a holistic view of volatility by stacking different lookback periods—from "Fast" (micro-bursts) to "Slow" (macro-shifts). This allows traders to observe how volatility "flows" through different timeframes, often signaling the inception of major trends before they are reflected in price action.
🔹 The Volatility Waterfall (Oscillator Pane)
The bottom pane features ten horizontal ribbons representing different volatility horizons.
Hot (Red): Indicates that current volatility is in the highest percentiles relative to its recent history for that specific horizon. Cold (Blue): Indicates a compression phase where volatility is historically low. Aggregate Line: A central line representing the average "heat" across all ten horizons, serving as a primary gauge for the overall market regime.
🔹 Main Chart Visuals
The script projects its findings onto the main price chart through three primary features:
Gradient Candles: When enabled, candles are colored based on the aggregate volatility heat, allowing for immediate identification of "hot" price action. Expansion Glow: A dynamic background highlight that "pulses" and fades based on the intensity of volatility expansion. The glow becomes more opaque as the market enters extreme expansion (Aggregate Heat > 70%). Pro Dashboard: A real-time data table providing the exact Aggregate Heat percentage, a Regime Classifier (Expansion, Neutral, or Compression), and the Fast/Slow Ratio.
🔶 HOW TO USE
The Multi-Horizon Volatility Waterfall can be used to identify high-probability trading environments based on the "state" of market volatility.
Identifying Squeeze Breakouts: Look for periods where all ten ribbons in the waterfall are "Cold" (Blue). This indicates a deep volatility compression across all time horizons. A sudden shift to "Hot" (Red) in the top (Fast) ribbons often precedes a powerful breakout. Trend Confirmation: In a trending market, volatility should ideally remain in the "Neutral" to "Hot" range. If price continues to move but the Waterfall turns "Cold" across the board, it may suggest the trend is losing participation and entering a distribution or consolidation phase. Volatility Clusters: When the Aggregate Heat exceeds 70%, the "Expansion Glow" appears on the main chart. This signifies a high-intensity market environment. Traders can use this to adjust risk management, as higher volatility typically requires wider stop-losses but offers greater reward potential. Mean Reversion: Extreme "Hot" readings across all ribbons (a full red waterfall) can sometimes signal an exhausted move. If price reaches a key resistance level while the Waterfall is at maximum heat, it may indicate a climax followed by a reversal or a period of sideways "cooling."
🔶 DETAILS
The core methodology of the Waterfall is based on Percentile Rank Normalization . Standard volatility measures like ATR are difficult to compare across different assets or timeframes because their absolute values vary. By converting ATR into a percentile rank (0-100%) over a long-term lookback (e.g., 200 bars), the indicator creates a standardized "Heat" metric.
Vertical Alignment: When all ten horizons turn red simultaneously, it indicates a "Volatility Cluster." This suggests that the expansion is occurring across all time horizons, often preceding a high-conviction breakout. Volatility Flow: Traders can watch for heat starting at the "Fast" (top) ribbons and moving down toward the "Slow" (bottom) ribbons. This "Waterfall" effect suggests that a short-term momentum burst is successfully transitioning into a sustained structural trend.
🔶 SETTINGS
🔹 Main Settings
Base Horizon Step: The multiplier used to define the 10 horizons. If set to 10, the horizons will range from 10 to 100 periods. Percentile Lookback: The historical window used to determine the percentile rank of the current volatility. Smoothing: Applies an EMA to the volatility heat to reduce noise and provide a cleaner visual flow.
🔹 Visualization
Cold/Hot Colors: Customizes the gradient colors for low and high volatility states. Color Candles by Volatility Heat: Toggles the gradient candle coloring on the main chart. Max Glow Intensity (%): Controls the maximum brightness of the background expansion glow to prevent it from overpowering the price action.
🔹 Dashboard
Show Dashboard: Toggles the visibility of the real-time data table. Position/Size: Adjusts the location and scale of the dashboard on the chart interface. Indicator

Mean Deviation Trend [BackQuant]Mean Deviation Trend
Overview
Mean Deviation Trend is a structure-based trend and regime indicator that measures directional pressure as the market’s sustained deviation from a moving “mean,” then uses that pressure to drive an adaptive band , dynamic coloring, and a level engine that marks deviation peak extremes after momentum fades.
Most trend tools start with direction, for example slope or MA cross, then try to estimate strength later. This script does the reverse:
It first quantifies how far price is displaced from a central mean in volatility-adjusted units .
It then smooths and accumulates that deviation to determine trend direction and conviction .
Finally it converts conviction into a band that tightens when pressure is strong and widens when pressure is weak.
The result is a single framework that blends:
A mean anchor (EMA).
A signed deviation engine normalized by ATR.
A conviction score based on sustained deviation.
An adaptive band that behaves like dynamic support/resistance.
A “deviation peak” level system that plants levels at extremes after the push fades.
Optional glow, fills, candle coloring, and flip markers.
Core concept: deviation from mean as trend fuel
A trend is not just “price up” or “price down.” A trend is a persistent imbalance where price spends time displaced from fair value and keeps re-asserting that displacement. This indicator treats the mean as a moving fair value proxy, and it measures how aggressively price is departing from it.
Key idea:
If price stays above the mean and that displacement is sustained, bullish pressure is dominant.
If price stays below the mean and that displacement is sustained, bearish pressure is dominant.
If price keeps snapping back and deviation cannot sustain, regime is weak and uncertainty is high.
This is why the script doesn’t rely on a single moment like a cross. It cares about persistence .
Mean anchor (the “center of gravity”)
The mean is defined as an EMA of close:
mean = EMA(close, meanLen)
Why EMA:
It responds faster than SMA to regime changes.
It provides a stable anchor without overreacting to single bars.
The mean line is not just a moving average here, it is the reference line that deviation is measured against. Everything downstream depends on the mean being a consistent “center.”
Volatility normalization (why ATR is essential here)
Raw distance from mean is meaningless across volatility regimes. A $200 deviation on BTC might be noise one week and huge another week. To fix this, the script normalizes deviation by ATR:
atr = ATR(14)
rawDev = (close - mean) / atr
Interpretation:
rawDev is “how many ATR units price is away from the mean.”
This makes deviation comparable across timeframes and volatility states.
This is critical because it turns the indicator into a dimensionless pressure metric rather than a price-distance tool.
Deviation smoothing (instantaneous pressure vs noisy pressure)
Instantaneous deviation can spike on one candle and mean nothing. So the script applies EMA smoothing to raw deviation:
devSmooth = EMA(rawDev, devLen)
What this does:
Reduces single-bar spikes.
Keeps the sign and general magnitude of displacement.
Creates a cleaner “pressure line” that responds but does not jitter.
This is the first stage of filtering: “Are we meaningfully deviating, or just wicking?”
Deviation accumulation (turning pressure into conviction)
This is the part that makes the indicator behave like a trend conviction model rather than a simple oscillator.
The script computes:
cumDev = SMA(devSmooth, devAccum)
Even though it’s coded as an SMA, conceptually it behaves like a rolling accumulation of the deviation signal:
If devSmooth stays positive for multiple bars, cumDev rises and stays positive.
If devSmooth stays negative for multiple bars, cumDev drops and stays negative.
If devSmooth flips sign repeatedly, cumDev compresses toward zero.
This is the key “persistence detector.” It converts short-term deviation into a medium-term conviction read.
Trend direction and flips
Trend direction is derived purely from the sign of cumulative deviation:
tDir = cumDev > 0 ? +1 : -1
flip = tDir != tDir
Interpretation:
Bull regime means the market’s sustained deviation is above the mean (pressure up).
Bear regime means sustained deviation is below the mean (pressure down).
A flip marks a regime transition where the sustained bias changes sign.
This is intentionally simple because all the complexity is in how cumDev is built.
Measuring conviction: devNorm (adaptive strength scale)
The script measures absolute conviction:
devAbs = abs(cumDev)
Then it normalizes it relative to a rolling peak:
devHigh = highest(devAbs, 80)
devNorm = devHigh > 0 ? min(devAbs / devHigh, 1) : 0
Meaning:
devNorm is a 0..1 strength scale.
0 means current conviction is tiny relative to recent extremes.
1 means conviction is at the strongest level seen in the last ~80 bars.
This is not a z-score, it’s a “relative-to-recent-peak” normalization. That matters because it makes the band behavior adapt to each instrument’s recent character, not a fixed threshold system.
Adaptive band logic (tight when confident, wide when uncertain)
The band is built to behave differently depending on conviction. When conviction is strong, the band should hug price and act like a close structural guide. When conviction is weak, the band should widen and stop pretending it is precise.
This is done by interpolating between two ATR multipliers:
bandTight = ATR multiplier when devNorm is high
bandWide = ATR multiplier when devNorm is low
bandMult = bandWide - devNorm * (bandWide - bandTight)
bandW = atr * bandMult
Interpretation:
devNorm near 1 → bandMult approaches bandTight → band width shrinks.
devNorm near 0 → bandMult approaches bandWide → band width expands.
So the band width is not arbitrary. It is a direct function of trend conviction.
Active band placement (trend-aware support/resistance)
The “active band” is placed on the opposite side of the mean depending on direction:
If bullish: activeBand = mean - bandW
If bearish: activeBand = mean + bandW
So in bullish regimes, the band behaves like a dynamic support zone beneath the mean. In bearish regimes, it behaves like dynamic resistance above the mean.
Then it is smoothed:
activeBand = EMA(activeBand, 3)
This prevents the band from stepping too harshly when ATR shifts.
Outer band (secondary structure reference)
A second band is created at half width on the opposite side:
bull: outerBand = mean + bandW * 0.5
bear: outerBand = mean - bandW * 0.5
Then smoothed again. This outer line is not the main “stop band,” it is more of an additional structure marker to show where the mean plus/minus partial deviation zone sits. It can help visually gauge whether price is extended relative to the mean structure while still in the same regime.
Color system (strength-aware gradient)
The trend color is not binary. It is strength-weighted:
If bullish, devNorm drives a gradient from a faint bull tint to full bull.
If bearish, devNorm drives a gradient from a faint bear tint to full bear.
This gives you an immediate read:
Bright strong color = conviction high.
Faded color = conviction low, regime fragile.
It also ties into the glow and fill so the whole visual language matches the same underlying “pressure” variable.
Deviation peak level engine (how the script plants levels)
This indicator includes a separate mechanism that marks important extremes after a strong deviation push fades. The idea is:
When trend pressure peaks and then collapses, the extreme price printed at peak deviation often becomes a reaction level later.
This is similar in spirit to:
exhaustion extremes,
climactic deviation points,
distribution/accumulation turning zones,
but the script formalizes it using the deviation engine.
1) Track the strongest deviation peak
The script stores a running peak:
peakDev: maximum devAbs seen since last reset
peakPrice: the extreme price at that peak (high for bull, low for bear)
peakDir: direction at peak
peakBar: bar index of peak
When devAbs prints a new high, it updates those values.
2) Define “fade” (momentum has cooled)
A fade event triggers when:
peakDev is meaningfully large (peakDev > 0.3)
current devAbs drops below a fraction of the peak: devAbs < peakDev * fadeThr
fadeThr is the key user control. Lower fadeThr requires a deeper drop from peak before planting a level.
What “fade” means in practice:
A strong push happened (deviation expanded).
That push is no longer active (deviation contracted).
So the extreme created during the push is now “locked in” as a candidate level.
3) Plant a level at the extreme
When faded:
A dashed horizontal line is created at peakPrice.
The line is projected forward (bar_index + 60).
It is stored in an array with direction and retest state.
It also respects maxLvls by deleting the oldest levels to avoid clutter.
4) Maintain levels and delete invalid ones
Each bar, levels are checked:
If price breaks far beyond the level (by about 2 ATR in the wrong direction), the level is deleted.
That “broken” rule is a pragmatic invalidation filter. If price rips through a former deviation extreme by a large margin, the level is no longer acting like a meaningful reaction zone.
5) Detect retests and mark them
A retest is detected when:
close is within ~0.25 ATR of the level,
and two bars ago price was not near it (distance > 0.5 ATR),
and the level hasn’t already been marked as retested.
When that happens:
A diamond marker is printed (◆) above or below depending on approach.
The level is flagged as retested so it won’t spam markers.
So levels are not just static drawings. They have state: naked vs retested, and they get culled if invalidated.
Glow system (volatility-scaled aesthetic, strength-scaled intensity)
Glow is not random decoration here. Its width scales with devNorm:
glowMult = 0.4 + devNorm * 1.2
glowW = atr * 0.08 * glowMult
So in strong trends:
Glow band expands.
The mean core visually “radiates” more.
In weak trends:
Glow shrinks and becomes less prominent.
The glow is built using multiple invisible plots above and below the mean, then layered fills with different transparencies. It creates a soft gradient aura around the mean that encodes strength.
Band fill and line break behavior
The active band is plotted with plot.style_linebr and forced to break on flips:
bandBrk = flip ? na : activeBand
This prevents the band from drawing a misleading connecting line across a regime change. It visually resets when direction flips, which matters because the band swaps sides of the mean when regime changes.
Fill is drawn between:
the active band line
and hl2 (mid-price reference)
So you get a shaded zone that reflects the current regime color and strength.
Candles and flip labels
Candles can be colored by the same strength-weighted regime color, which makes the entire chart consistent.
On flips:
Bull flip prints ▲ at the low.
Bear flip prints ▼ at the high.
These are regime markers, not “entry signals” by default. They simply identify when the cumulative deviation sign changed.
How to read this indicator in practice
1) Regime and conviction
Direction comes from cumDev sign.
Conviction comes from devNorm intensity.
Bright color + stable band on one side means strong sustained pressure.
Faded color + widening band means weak sustained pressure and higher uncertainty.
2) Using the active band as structure
In a bullish regime, activeBand is below mean and can behave like:
dynamic support,
risk boundary,
trend “line in the sand.”
In bearish regime, it flips above mean and acts like dynamic resistance.
Because the band widens when conviction is low, it naturally tells you “do not treat this as a tight stop zone when the trend is weak.”
3) Using deviation peak levels
Peak levels represent exhaustion extremes after a strong deviation impulse faded:
If price returns to a naked level, that area can act as a reaction zone.
Once retested, the script marks it and treats it as less “special.”
If price breaks it by a wide margin, the script removes it as invalid.
This level engine is best viewed as “structural memory of deviation events,” not generic support/resistance.
4) Extreme deviation alert
devNorm > 0.85 means the current sustained deviation is near the strongest seen recently. That’s useful for:
identifying trend climax states,
detecting when continuation is strong but risk of snapback rises,
flagging conditions where mean reversion pressure is building.
It does not guarantee reversal, it flags “stretch.”
Inputs and what they actually change
Mean Length (meanLen)
Controls the anchor responsiveness:
Lower = mean follows price more closely, deviation shrinks, more frequent flips.
Higher = mean is slower, deviation grows, trend regimes last longer.
Deviation Smoothing (devLen)
Controls how noisy the deviation signal is:
Lower = faster response, more jitter.
Higher = smoother pressure, slower flips.
Deviation Accumulation (devAccum)
Controls persistence requirement:
Lower = trend conviction reacts quickly but can whipsaw.
Higher = requires sustained deviation, fewer flips, more confirmation.
Band Tight / Band Wide
These define the band behavior range:
bandTight: how close the band gets when conviction is strong.
bandWide: how far it drifts when conviction is weak.
If you want the band to behave more like a stop guide, reduce bandWide. If you want it to act more like a regime boundary, increase bandWide.
Fade Threshold + Max Levels
These shape the level engine:
fadeThr lower = requires bigger cooling before planting levels (fewer, more meaningful).
fadeThr higher = plants levels earlier (more levels, more noise).
maxLvls controls clutter and historical depth.
Alerts (what they represent)
Dev Bull / Dev Bear: regime flips, cumulative deviation changed sign.
Dev Faded: a deviation peak cooled enough to plant a level.
Extreme Dev: sustained deviation is near local maximum, stretch condition.
Summary
Mean Deviation Trend models trend as sustained, volatility-normalized displacement from a mean rather than simple direction. It smooths and accumulates signed deviation to extract regime and conviction, then converts that conviction into an adaptive ATR band that tightens when pressure is strong and widens when pressure is weak. On top of that, it tracks deviation peak extremes and plants forward levels only after deviation fades, creating a structured map of “where trend impulses peaked” and how price reacts when those zones are revisited. Indicator
