Volume Profile Supertrend [HexaTrades]Volume Profile Supertrend re-imagines the classic Supertrend. Instead of trailing bands built from pure volatility (ATR), it builds them around the levels where real volume has traded the Point of Control and Value Area.
The philosophy is simple: a normal Supertrend follows volatility; this one follows where the market accepts value. Price tends to gravitate to, and trend away from, the zones where the most business gets done. By anchoring the trend engine to value migration, the indicator aims to stay on the right side of the move while filtering out a portion of low-quality volatility noise.
Everything is computed internally in Pine; no built-in Volume Profile tool is used, so it works on any symbol and timeframe that has volume.
💡How it works
1. Rolling Volume Profile:
It looks back over the last Profile Lookback bars, finds the high–low range, and divides it into Number of Rows price buckets. Every historical bar's volume is distributed across the buckets its range spans, producing a fresh volume distribution on every candle.
2. POC, VAH & VAL:
POC (Point of Control) : the price bucket with the highest traded volume (the "fairest price").
Value Area: the script expands outward from the POC until it captures the chosen Value Area % (default 70%) of total volume.
VAH / VAL: the upper and lower edges of that Value Area.
3. Smoothing & Supertrend bands:
POC, VAH, and VAL are smoothed with EMAs to remove jitter. Two trailing bands are then built, exactly like a Supertrend:
Lower band = smoothed VAL − (ATR × buffer) → support used while bullish.
Upper band = smoothed VAH + (ATR × buffer) → resistance used while bearish.
The bands only trail in the trend-following direction, so they lock in as the price advances.
4. Trend flip:
The trend is bullish while price holds above the lower band, and flips bearish when price closes below it (and vice-versa). The flip is evaluated against the previous bar's confirmed bands, so closed candles never change.
💡How to read it
🔶Bullish:A green line sits below the price. The market is accepting a higher value; treat pullbacks toward the line as the trend "breathing." A flip to red is your warning.
🔶Bearish: A red line sits above the price. Value is migrating lower; rallies into the line are where sellers tend to re-engage. A flip to green signals a potential turn.
🔶Choppy Markets: When price is inside the value area and trend strength is low, the market may be sideways.
In these conditions, signals can be weaker. It may be better to wait for a clear value breakout or stronger trend strength.
🔺Signals
- BUY label prints when the trend flips from bearish to bullish.
- SELL label prints when the trend flips from bullish to bearish.
- A flip dot marks the exact bar of the change on the trend line.
- Trend Strength Filter: Set Minimum Trend Strength above 0 to filter out weak trend flips and display only higher-conviction signals. (Available in the indicator settings.)
┼ Dashboard
-Trend: Current direction Bullish or Bearish.
-Strength: 0–100% conviction score blending distance from POC, POC slope, and whether price has broken outside the Value Area.
-Price Position: Above / Inside / Below Value Area.
-Last Signal: The most recent BUY or SELL that fired.
Alerts
The indicator includes alerts for important events:
-Buy Signal / Sell Signal
-Bullish Trend / Bearish Trend (flip)
-Price Above Value Area / Price Below Value Area
-Price Crossing POC EMA
Suggested Settings
For Intraday Trading
Use lower lookback and medium rows for faster signals.
Example:
-Profile Lookback: 50–100
-Rows: 30–50
-EMA Smoothing: 8–14
-ATR Buffer: 0.5–1.0
For Swing trading
Use higher lookback and smoother settings for cleaner signals.
Example:
-Profile Lookback: 100–250
-Rows: 40–70
-EMA Smoothing: 10–21
-ATR Buffer: 0.8–1.5
For Cleaner Signals
-Increase EMA Smoothing Length
-AIncrease TR Buffer
-Increase Minimum Trend Strength
Volume Profile Supertrend combines the proven structure of a Supertrend with the market's true area of value derived from a rolling Volume Profile. Instead of relying solely on price volatility, it follows the migration of value through the Point of Control (POC) and Value Area (VAH/VAL) to identify higher-quality trend changes.
Whether you're a day trader or swing trader, this indicator helps you visualize trend direction, identify dynamic support and resistance, filter weak reversals, and stay aligned with the prevailing market structure. Use it as a standalone trend-following tool or alongside your existing trading strategy for additional confirmation.
We would love to hear your suggestions. If you have ideas for new features, indicators, analytics, or improvements, please share your feedback. Your input helps guide future updates and improve the indicator for all traders.
This indicator is for educational and analytical purposes only. It is not financial advice. Trading involves risk. Always use proper risk management and combine this indicator with your own analysis before taking any trade.
Indicator

StealthTrail SuperTrend ML Pro [WillyAlgoTrader]🤖 StealthTrail SuperTrend ML Pro is an overlay indicator that builds on the adaptive SuperTrend core from StealthTrail and adds three layers of intelligence: an instrument profiling engine that classifies the market into Trending, Ranging, or Volatile regimes and auto-tunes all SuperTrend parameters accordingly; a 13-feature machine learning scoring system that evaluates every candidate signal on momentum, trend, volatility, structure, volume, HTF alignment, divergence, session quality, and regime context — producing a 0–100 confidence score; and a self-learning mechanism that tracks signal outcomes over time and dynamically adjusts the confidence gate to optimize signal quality. The result is a SuperTrend that configures itself, scores its own signals, and learns from its results.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A standard SuperTrend has fixed parameters that work well in one market regime and fail in another. Manually tuning ATR length, multiplier, and filters for each instrument and timeframe is time-consuming and becomes outdated when conditions change.
This indicator solves the problem through a three-layer intelligence stack:
Layer 1 — Regime classification → Auto-tuning: The instrument profiler continuously measures efficiency ratio (trend strength), autocorrelation (serial dependence), volatility clustering, and normalized volatility — classifying the market into TRENDING, RANGING, or VOLATILE. Each regime produces different optimal SuperTrend parameters. The auto-tuner interpolates ATR length, multiplier, cushion, cooldown, and RSI threshold using regime-weighted blending — so the SuperTrend self-configures for current conditions.
Layer 2 — ML signal scoring: Even with auto-tuned parameters, not every SuperTrend flip is a good trade. The 13-feature ML engine evaluates each flip against momentum, volume, trend efficiency, volatility shock, band distance, MACD, price structure, regime confidence, MTF alignment, ADX strength, RSI divergence, volume profile zone, and session quality. Each feature is normalized to 0–100, weighted, passed through a sigmoid function, and combined into a single confidence score. Signals below the confidence gate are rejected — they pass the classic SuperTrend logic but fail the multi-dimensional quality check.
Layer 3 — Self-learning gate: The ML confidence gate itself adapts over time. The system tracks each signal's outcome (win/loss evaluated after N bars using the ATR at entry for fair comparison). When the win rate exceeds 70%, the gate lowers (allowing more signals). When it drops below 50%, the gate raises (becoming stricter). A decay factor prevents old signals from dominating. This creates a feedback loop: the indicator learns which confidence level produces profitable signals on this specific instrument and timeframe.
Without auto-tuning, the SuperTrend uses static parameters. Without ML scoring, good and bad flips are treated equally. Without self-learning, the confidence gate is a fixed guess. Each layer eliminates a specific category of bad signals that the previous layer can't catch.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Instrument profiling and regime classification.
The profiler computes four metrics over a configurable lookback (default 100 bars):
— 📐 Efficiency Ratio : ER = |close − close | / sum(|close − close |, N). Measures net directional movement vs total path. ER → 1.0 = pure trend, ER → 0.0 = pure chop.
— 🔄 Autocorrelation : correlation between return and return over a sliding window. High positive autocorrelation = trending persistence. Near-zero = random. Negative = mean-reverting.
— 📏 Volatility Clustering : ratio of short-term ATR (20 bars) to long-term ATR (lookback). Values > 1.0 indicate a volatility spike (breakout or crash). Values < 1.0 indicate compression.
— 📈 Normalized Volatility : ATR / close × 100. Measures absolute volatility as percentage of price — allows cross-instrument comparison.
These are smoothed with EMA and combined into three regime scores:
— trendScore = ER × regimeSensitivity
— rangeScore = (1 − ER) × (1 − |autocorrelation|) × regimeSensitivity
— volatScore = clamp(volClustering − 1, 0, 2) × regimeSensitivity
The highest score determines the regime: TRENDING, RANGING, or VOLATILE. Regime confidence = highest_score / total_scores × 100%.
2️⃣ Regime-weighted auto-tuning (6 parameters).
Each SuperTrend parameter is computed as a weighted blend of regime-optimal values:
effectiveParam = wT × trendOptimal + wR × rangeOptimal + wV × volatileOptimal
Where wT, wR, wV are the normalized regime weights. The parameters and their regime-optimal ranges:
— ATR Length: Trending=10, Ranging=16, Volatile=21 (further scaled by normalized volatility)
— Base Multiplier: Trending=2.0, Ranging=3.2, Volatile=3.8 (scaled by normalized vol)
— Flip Cushion: Trending=0.05, Ranging=0.25, Volatile=0.15
— Signal Cooldown: Trending=2, Ranging=5, Volatile=3
— RSI Threshold: Trending=40, Ranging=52, Volatile=45
— RSI Length: derived as ATR Length × 0.9
— Adaptive Smoothing: ATR Length × 4.0
This means in a trending regime, the SuperTrend uses shorter ATR, lower multiplier (tighter bands), minimal cushion, and permissive RSI — catching trends early. In a ranging regime: longer ATR, wider multiplier, large cushion, strict RSI — avoiding chop. In volatile conditions: intermediate settings with wider bands to accommodate spikes.
3️⃣ 13-feature ML scoring engine.
Each feature is normalized to 0–100, multiplied by its weight, summed, normalized by total weight, and passed through a sigmoid function to produce the final 0–100 confidence score.
Features and their weights:
— 💪 F1: Momentum (RSI alignment with trend) — w=0.15
— 📈 F2: Volume Surge (volume / SMA ratio) — w=0.08
— 📐 F3: Trend Efficiency (ER × 100) — w=0.15
— ⚡ F4: Volatility Shock (inverted vol clustering) — w=−0.08 (negative = penalizes vol spikes)
— 📏 F5: Band Distance (sigmoid of close-to-band ATR distance) — w=0.10
— 📊 F6: MACD (normalized histogram vs ATR) — w=0.08
— 🏗️ F7: Price Structure (HH/HL for bull, LL/LH for bear over 10 bars) — w=0.08
— 🧠 F8: Regime Confidence (% confidence in current regime) — w=0.04
— 🌐 F9: MTF Confluence (aligned with HTF = 100, not = 0) — w=0.12
— 💪 F10: ADX Strength (ADX × 2.5, capped at 100) — w=0.10
— 🔀 F11: RSI Divergence (aligned div = 100, counter div = 10) — w=0.08
— 📊 F12: Volume Profile Zone (proximity to highest-volume bar) — w=0.06
— 🕐 F13: Session Quality (hour-based scoring for optimal trading sessions) — w=0.04
The raw weighted sum is normalized, then passed through: mlScore = 100 / (1 + exp(−0.08 × (normalizedScore − 50))). This sigmoid compresses extreme values and centers the output around 50.
All 13 weights plus the bias term are user-configurable — you can adjust how much each factor contributes. Negative weights penalize a factor (e.g., W4 = −0.08 means high volatility shock reduces the score).
4️⃣ Self-learning confidence gate.
The system maintains 5 pending signal slots. Each stores the entry price, direction, bar index, and ATR at entry. After the evaluation horizon (default 15 bars), the outcome is assessed:
win = (close − entryPrice) × direction > 0.5 × entryATR (profitable by at least half an ATR, using the ATR at entry time — not current ATR — for fair comparison)
A decay factor (0.98) is applied to historical totals before adding new results, preventing stale data from dominating. When total tracked signals ≥ 8:
— Win rate > 70% → gate decreases by 1.5 (more permissive)
— Win rate < 50% → gate increases by 1.5 (more restrictive)
— Gate is clamped to
The dashboard shows the current gate value, whether it's auto-adjusted, and the tracked win rate with sample size.
5️⃣ Multi-timeframe confluence with auto-HTF selection.
The indicator automatically selects the appropriate higher timeframe based on your current TF: 1M→15M, 5M→30M, 15M→1H, 1H→4H, 4H→D, D→W. Or you can manually specify the HTF.
Three strictness levels:
— Loose: MTF misalignment adds negative ML score but doesn't block
— Moderate: MTF misalignment reduces signal quality
— Strict: MTF misalignment hard-blocks the signal entirely
HTF trend is determined by EMA(20) vs EMA(50) on the higher timeframe.
6️⃣ Adaptive SuperTrend core (from StealthTrail).
The band calculation uses pre-computed interpolated ATR values (ATR bank at 9 fixed periods with lerp interpolation) for smooth adaptation to any auto-tuned ATR length. Same mechanics as StealthTrail: adaptive multiplier (ATR / SMA ratio), band ratcheting, flip cushion, and cooldown — but now all parameters are regime-driven.
7️⃣ Three-mode trailing TP/SL system.
Three SL modes: ATR (entry ± mult × ATR), Band (SuperTrend band as SL), Fixed % (percentage from entry).
Three trailing modes:
— ATR : trail at fixed ATR distance from price — simple, consistent
— Band : use the SuperTrend band itself as trailing stop — structurally anchored
— ATR → Band (hybrid) : start with tight ATR trail, switch to band when it catches up — best of both
The trail only ratchets in the profit direction (never moves away from price). TP1/TP2/TP3 hit markers (✓) appear on the chart. On TP3 or SL hit, the trade closes and lines are removed.
8️⃣ RSI divergence detection.
Scans for bullish divergence (price lower low, RSI higher low, RSI < 40) and bearish divergence (price higher high, RSI lower high, RSI > 60). Divergences aligned with the signal direction boost the ML score (F11 = 100). Counter-divergences penalize it (F11 = 10). Optional visualization as dots on the chart.
9️⃣ Volume profile zone proximity.
Tracks the highest-volume bar in the last 50 bars. Proximity to this bar's price level is scored: within 1.5× ATR = 100 (near institutional activity), further = proportionally lower. Signals near high-volume zones tend to have more follow-through.
🔟 Session quality scoring.
For intraday timeframes, each hour receives a quality score based on typical institutional activity: London/NY overlap (13–17 UTC) = 100, European session (8–12) = 80, US afternoon (18–20) = 70, Asian session (0–7) = 30. An optional kill zone filter suppresses all signals during specified hours.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Instrument profiling: ER, autocorrelation, vol clustering, normalized vol → EMA-smoothed → regime classification (TRENDING / RANGING / VOLATILE) with confidence %.
Step 2 — Auto-tuning: Regime weights blend optimal parameters for ATR length, multiplier, cushion, cooldown, RSI threshold/length.
Step 3 — SuperTrend calculation: Interpolated ATR from pre-computed bank → adaptive multiplier (ATR/SMA ratio) → upper/lower bands → ratcheting → flip detection with cushion + cooldown.
Step 4 — Classic filters: Momentum (RSI), volume, session, MTF hard-block (if strict).
Step 5 — ML feature extraction: 13 features normalized to 0–100 from current market state.
Step 6 — ML scoring: Weighted sum → weight normalization → sigmoid → 0–100 confidence score.
Step 7 — Signal decision: Classic filters pass AND (ML disabled OR mlScore ≥ gate) → confirmed signal.
Step 8 — Self-learning: Signal stored in pending slot → evaluated after horizon bars → win rate updated → gate adjusted.
Step 9 — TP/SL placement: SL from band/ATR/fixed% → TPs as ATR multiples → trailing stop ratchets per mode.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — Auto-Tune is ON by default, parameters self-configure
2. The SuperTrend band and Long/Short labels appear
3. Dashboard shows: trend, strength, regime, ML score, gate, win rate, TP/SL status
4. Enable ML Filter for quality scoring (off by default — enable after reviewing signal quality)
5. Self-Learning auto-adjusts the gate over time
👁️ Reading the chart:
— 🟢 Green band + "Long" label = confirmed bullish signal
— 🔴 Red band + "Short" label = confirmed bearish signal
— ⚫ Gray dot = classic filter blocked the flip
— 🟡 Yellow triangle = ML rejected the signal (score below gate)
— 🟢 Green dot below bar = bullish RSI divergence
— 🔴 Red dot above bar = bearish RSI divergence
— 📈 Regime badge = current market classification (📈 TRENDING / 📊 RANGING / ⚡ VOLATILE)
— 🟢 Green dashed = TP1/TP2/TP3, 🔴 Red dashed = SL, 🔵 Blue dotted = entry
— "TP1 ✓" / "SL ✗" labels = outcome markers
📊 Dashboard sections:
— Main: trend, signal, strength, ADX, HTF alignment
— 🤖 ML Engine: ML score, confidence gate (fixed or auto), win rate with sample size
— 🎯 Position: status (LONG/SHORT/FLAT), entry, SL (with trail mode icon), TP levels (✓ for hit), R:R ratio
— 🧠 Regime: classification + confidence %
🔧 Tuning guide:
— Start simple: Auto-Tune ON, ML OFF — let the regime engine handle parameters
— Add ML: Enable ML Filter after 50+ signals to see which score level produces winners
— Enable Self-Learning: after 100+ bars of ML being active — let the gate auto-calibrate
— Adjust weights: if you know your market (e.g., volume is unreliable on forex → set W2 to 0)
— Strict MTF: for higher-timeframe alignment — reduces signals, increases quality
— Trail Mode: Band for trend-following, ATR for scalping, ATR→Band for hybrid
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Auto-Tune (default On): regime-driven parameter self-configuration
— ATR Length / Base Multiplier : manual overrides when auto-tune is off
🧠 Adaptive Engine:
— Profiling Lookback (default 100): bars for regime classification
— Regime Sensitivity (default 1.0): scaling factor for regime scores
📐 Multi-Timeframe:
— MTF Confluence (default On): Auto/Manual HTF selection
— Strictness (default Moderate): Loose / Moderate / Strict
🤖 ML Signal Filter:
— Enable ML (default Off): activate 13-feature scoring
— Confidence Gate (default 21): minimum ML score to pass
— Self-Learning (default On): auto-adjust gate from tracked outcomes
— Evaluation Horizon (default 15 bars): outcome assessment window
— 13 individual weights + bias : fully configurable feature importance
🔍 Filters:
— Flip Cushion, Cooldown, RSI Momentum, Volume, Session Kill Zone
🎯 TP/SL:
— SL Mode (default Band): ATR / Band / Fixed %
— Trail Mode (default Band): ATR / Band / ATR → Band
— TP Levels (1–3): ATR multipliers (default 1.5 / 2.5 / 4.0)
🔔 Alerts
— 🟢 LONG / 🔴 SHORT — ticker, price, TF, band, ML score, ADX, HTF, SL, TP1, regime
— 🎯 TP1 / TP2 / TP3 HIT — trade progress
— 🛑 SL HIT — stopped out
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed. The confirmed trend direction is stored separately from the real-time calculation — signals only fire on closed bars. HTF data uses lookahead_off. A warmup period (max of profiling lookback and 55 bars) prevents signals during insufficient data.
— 🤖 The ML scoring is not machine learning in the neural network sense . It's a weighted linear model with sigmoid activation — a logistic regression analog. The 13 features are hand-crafted from market microstructure, and the weights are configurable by the user. There is no gradient descent, backpropagation, or training phase. The "self-learning" adjusts only the confidence gate threshold, not the feature weights.
— 📐 Auto-tuning produces different parameters on every bar as the regime shifts. The ATR length and multiplier change continuously — this is by design. If you prefer fixed parameters, disable Auto-Tune.
— ⚖️ The self-learning gate requires at least 8 tracked signals before it begins adjusting. With the decay factor (0.98), the effective sample is weighted toward recent signals. The gate moves slowly (±1.5 per adjustment) and is clamped to .
— 📊 Win rate evaluation uses ATR at entry time , not current ATR. A signal is a "win" if price moves > 0.5× entry ATR in the signal direction within the evaluation horizon. This prevents volatile periods from inflating win counts.
— 🔄 The pre-computed ATR bank (9 fixed periods with lerp interpolation) is a performance optimization that allows smooth ATR adaptation to any auto-tuned length without calling ta.atr() dynamically — which Pine Script doesn't support with variable-length arguments.
— 📏 Volume Profile Zone tracks the single highest-volume bar in the last 50 bars, not a full volume profile. It decays after 50 bars with no new volume peak.
— 🕐 Session scoring uses UTC-based hours. On daily or higher timeframes, session quality defaults to 50 (neutral) as intraday session distinctions don't apply.
— 🛠️ This is a signal scoring and analysis tool , not an automated trading bot. It classifies regimes, scores signals, tracks outcomes, and manages TP/SL — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume features auto-adapt to instruments without volume data. Indicator

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

Supertrend by JKRSupertrend by JKR is a trend-following overlay that plots dynamic support/resistance bands around price and flips when the trend changes.
It builds a smoothed baseline using your selected moving average type (SMA, TMA, WMA, VWMA, TEMA, HMA, EMA, or VMA). Around this baseline, it computes a volatility/range offset (classic ATR mode or Dual-Thrust range mode) and creates two trailing bands:
UpTrend band (active during bullish conditions)
DownTrend band (active during bearish conditions)
When price closes beyond the active band, the indicator flips trend direction and switches to the opposite band. While the trend remains active, the band “trails” price and updates in a way that avoids stepping backwards, which helps keep the trend structure clean and stable.
Options
Trend-change arrows (optional)
Bar coloring or candle overlay (optional)
Designed to evaluate on bar close for stable signals
Tip: Increase the Multiplier to reduce flips and widen bands; reduce Period to make the trend more responsive. Indicator

MTF SuperTrends Nexus [DarkWaveAlgo]🧾 Description:
A nexus is a connection, link, or neuronal junction where signals and information are transmitted between different elements.
The MTF SuperTrends Nexus indicator serves as a nexus between MTF SuperTrends by facilitating the visualization of up to eight multi-timeframe SuperTrends, each with its own customizable timeframe, period, factor, and coloring customization. By combining these various SuperTrends, it helps you create a comprehensive view of MTF trend dynamics and cross-timeframe confluence according to the SuperTrend indicator.
It acts as a utility/control center that brings together multiple MTF SuperTrends and allows you to visualize the interactions between them with exceptional ease-of-use and customizability, helping to provide you with valuable insights into potential trend reversals, momentum shifts, and trading opportunities.
💡 Originality and Usefulness:
While there are other multi-timeframe SuperTrend indicators available, MTF SuperTrends Nexus' semi-transparent fills create a compounding opaqueness when SuperTrends from multiple timeframes coalesce - making visual assessment of cross-timeframe confluence extremely easy. We also believe it stands above the rest with its sheer quantity and quality of settings, features, and usability.
✔️ Re-Published to Avoid Misleading Values
This script has been re-published to ensure that it does not use `request.security()` calls using lookahead_on to access future data when referencing SuperTrend calculations from other timeframes. This decreases the likelihood that the indicator will provide deceiving values. This change has been made in accordance with the PineScript documentation: "Using barmerge.lookahead_on at timeframes higher than the chart's without offsetting the `expression` argument like in `close [ ]` will introduce future leak in scripts, as the function will then return the `close` price before it is actually known in the current context" and the Publishing Rule: "Do not use `request.security()` calls using lookahead to access future data". Historical and real-time values may differ when referencing timeframes other than the chart's.
💠 Features:
8 toggleable MTF SuperTrends with customizable timeframes, periods, and factors
Compounding filled areas for easy MTF SuperTrend confluence analysis
Aesthetic and flexible coloring and color theme styling options
End-of chart labels and options for ease-of-use and legibility
⚙️ Settings:
Use a Color Theme: When this setting is enabled, all manual 'Bullish and Bearish Colors' are overridden. All plots will use the colors from your selected Color Theme - excepting those plots set to use the 'Single Color' coloring method.
Color Theme: When 'Use a Color Theme' is enabled, this setting allows you to select the color theme you wish to use.
Fill SuperTrend Areas: When enabled, the area between any MTF SuperTrend and the price bars will be filled with semi-transparent coloring.
Hide SuperTrends on Timeframes Lower Than the Chart: When this setting is enabled, any MTF SuperTrend with a timeframe smaller than that of the chart the indicator is applied to will be hidden from view.
Enable: Show/hide a specific MTF SuperTrend.
Timeframe: Set the timeframe for a specific MTF SuperTrend.
Period: Set the lookback period for a specific MTF SuperTrend.
Factor: Set the multiplier factor used for a specific MTF SuperTrend's calculation.
Bullish Color: When 'Use a Color Theme' is disabled, this will set the 'bullish color' for this specific MTF SuperTrend.
Bearish Color: When 'Use a Color Theme' is disabled, this will set the 'bearish color' for this specific MTF SuperTrend.
Enable Label: When enabled, a label will show at the end of the chart displaying the timeframe, period, factor, and current price value of this specific MTF SuperTrend.
Size: Sets the font size of this specific MTF SuperTrend's label.
Label Offset (in Bars): Sets the distance from the latest bar, in bars, at which this specific MTF SuperTrend's label is displayed.
Show Label Line: When enabled, this specific MTF SuperTrend's label will be accommodated by a dashed line connecting it to its plot.
📈 Chart:
The chart shown in this original publication displays the 5 minute chart on BTCUSDT. Displayed on the chart are 6 MTF SuperTrends: the 5m 50-period/3-factor SuperTrend, 15m 50-period/3-factor SuperTrend, 30m 50-period/3-factor SuperTrend, 1h 50-period/3-factor SuperTrend, 4h 50-period/3-factor SuperTrend, and the 1D 25-period/1.5-factor SuperTrend - offering an exemplary view of how you can easily use these MTF SuperTrends to your advantage in analyzing SuperTrend relationships across multiple timeframes. Indicator

Indicator
