Market Structure with ATR trailing stop [EDGE]Market Structure with ATR trailing stop — Multi-Timeframe Structure + ATR Trailing Stop.
A precision market-structure tool that goes beyond a simple pivot indicator by combining SMC-style swing detection, multi-timeframe CHoCH/BOS tracking, and a school-standard ATR trailing stop — all adapted automatically to the chart timeframe.
How it works:
The indicator scans pivot highs and lows using an SMC-calibrated Length (automatically picked for the current timeframe or set manually). Each broken pivot is classified as CHoCH (character change, phase start) or BOS (continuation) using your chosen breakout method — Wick, Body, or 2-Close confirmation. The same logic is mirrored across D1, H4, H1 and M5 in a summary table, so you always see whether the higher timeframes agree with the current one.
What it calculates:
- Swing pivots with HH / HL / LH / LL classification (optional labels)
- CHoCH / BOS counter — "UP (C)", "UP (C+1)", "DOWN (C+2)" — showing phase maturity per timeframe
- Trend direction on D1 / H4 / H1 / M5 in one summary table
- ATR trailing stop with EMA basis and one-directional ratcheting
- Live ATR% with a dynamic percentile-based "normal range" window
- Distance to trailing stop in %
Key features:
- Auto Length by timeframe (SMC standard: M5 = 7, H1 = 15, H4 = 20, D1 = 30 …)
- Three breakout modes: Wick (early), Body (default), 2-Close (conservative)
- Auto ATR multiplier and EMA basis per timeframe — sourced from Raschke, Carter, Chandelier Exit, Minervini, Wilder and Weinstein school standards
- Multi-timeframe trend dashboard with CHoCH/BOS phase counter
- Dynamic ATR% range (percentile lookback) — instant read on whether volatility is normal, muted or hot
- Configurable trailing-stop history window (2 or 10 last ranges)
- Optional HH / HL / LH / LL swing labels
- Fully customizable up/down colors
- Built-in alerts: trend flip up, trend flip down, stop touch up, stop touch down
- Disabled on timeframes below 5M with an on-chart notice — the indicator is calibrated for 5M and above
Who it's for:
Traders who want a single, opinionated structure tool that reads the market the same way institutional and SMC playbooks do — with automatic parameters that respect every timeframe, a clean multi-TF dashboard, and a trailing stop built from real trading-school standards rather than arbitrary defaults. Indicator

Supertrend Twincore [MachineSuiteAI]Supertrend Twincore
🟦 OVERVIEW
A fast Supertrend flips too often; a slow one flips too late. This script runs both at once and only signals when they agree — and then shows you, with win rates and sample sizes, how that agreement has actually performed on the chart you have loaded.
A signal only appears where the fast core (timing) and the slow core (structure) first align, and only if it passes a gate: clustered whipsaw flips always suppress, and every other filter blocks signals only where measurement shows it helps on this chart. Passed signals are graded A/B/C and draw an Entry / SL / TP1-3 ladder whose outcomes are tracked per grade. Suppressed candidates stay as grey ghost chips with the reason, and a five-row multi-timeframe strip shows the consensus state across timeframes from completed bars.
The idea throughout: the chart never claims more than the data supports, and anything the script believes is checkable in the panel.
🟦 WHAT IS A SUPERTREND?
Supertrend is a public-domain trailing-stop indicator: it offsets price by a multiple of the Average True Range and trails that stop behind the trend. Price above the stop means uptrend, below means downtrend; a close across it flips the state. This script computes its cores with the built-in ta.supertrend() — fast 2.0 × ATR(10) and slow 4.0 × ATR(20) by default.
Its known weakness is structural: in ranging markets the stop is repeatedly crossed and the indicator whipsaws. Filters are the usual answer; this script measures whether each one actually helps on the loaded symbol and timeframe, and the marks and the gate act only on that evidence.
🟦 WHY THIS SCRIPT IS ORIGINAL
The base calculation is a built-in, and the ingredients — win-rate panels, ADX gates, higher-timeframe confirmation, multi-timeframe dashboards, take-profit ladders, signal grades — are established ideas. What's different is the standard everything must meet: beyond one fixed whipsaw rule, nothing gets drawn, nothing blocks a signal, and nothing drives the engine unless the measurements on the loaded chart back it up.
- Graded ladder odds with the cost attached. Grades are fixed and published — A means structural confirmation plus volume, B one of the two, C neither; no opaque score. Every passed signal's ladder is tracked to resolution; the panel shows per grade: TP1-before-SL and SL-first rates, the median furthest level, the median heat (largest adverse move, in ATR units) and the median bars to TP1, each with its own sample size.
- An adaptive engine that has to beat the fixed one first. Both fast cores — fixed and adaptive — are measured as separate signal streams on the loaded chart, and the adaptive core only drives signals while it beats the fixed core by a set margin with enough samples. The A/B row shows the running comparison; on defaults it reports the adaptive layer as inert.
- Gates held to the same standard. The ✓ volume mark and ⚠ counter-trend warning only print where their split beats the base win rate by a configurable margin here. The ADX gate only blocks candidates where high-ADX candidates have beaten low-ADX candidates by that margin on this chart.
- Per-condition win-rate splits. The base candidate win rate, then the same measurement split by signal class, higher-timeframe agreement, volume confirmation, multi-timeframe alignment and volatility regime — six statistics, each with its own sample size, greyed below a minimum sample.
- Two kinds of signals, measured separately. A candidate exists only on the first bar the cores align and is classified as a structural confirmation (the slow core just flipped in) or a pullback rejoin (the fast core returned to a standing slow trend); a double flip on one bar is labeled same-bar. They are different trades, measured separately.
- Suppression you can audit. A gated-out candidate still prints — a hollow grey ghost chip with the specific reason — and still counts in every statistic, so the base rate is never inflated by counting only the survivors.
- Visual discipline. The band claims a direction only while both cores agree; its saturation drains as price nears the structural stop, so the exit warning arrives before the flip; NEUTRAL keeps a directional tint, so the last trend stays readable while standing aside. The price scale is held to the same rule — it carries the structural stop and the ladder's Entry, SL and TP1-3, each in its own colour, and nothing else; the band and the fast core draw on the chart but claim no axis label. Every visual property maps to something measured.
🟦 HOW IT WORKS
- Cores: two standard Supertrends — the fast core times entries, the slow core defines structure and is the ladder's trailing stop. Presets: Scalp 1.5×ATR(7)/3.0×ATR(14), Intraday 2.0×ATR(10)/4.0×ATR(20), Swing 3.0×ATR(14)/5.0×ATR(28), or Custom.
- Gate and state model: flip-cluster suppression (2+ fast flips in 10 bars, on by default), the measured ADX gate (default "Where it helps (measured)"), and an optional strict higher-timeframe gate (off by default). The band turns grey NEUTRAL on low ADX (default ADX(14) < 20) or flip clustering.
- Higher-timeframe filter: a third Supertrend one regime up (auto-mapped ≤15m→4H, ≤1H→1D, ≤4H→3D, ≤1D→1W, else 1M; or manual), read from the last completed HTF bar.
- Statistics: on confirmed bars, every candidate — passed and suppressed — resolves N bars later (default 10); a win means the close moved in its direction. Splits grey below the minimum sample (default 20). Chip marks need their split to beat the base rate by ≥3 points (configurable); the ADX gate needs the high-ADX split to beat the low-ADX split by the same margin; volume confirmation is volume above 1.5× its 20-bar average.
- Ladder: at a passed signal's close, Entry is the close, SL is the slow-core stop (or the fast core, or a fixed k×ATR cap), TP1/2/3 default to 1/2/3 × ATR. It trails, marks TP touches ✓, freezes ✕ on an SL break, dims when resolved or consensus is lost, and feeds the per-grade LADDER ODDS rows. A live ladder tracks the right edge of the chart; once its stop is hit it stops there, so it stays a bounded record of that trade — targets it never reached are not credited later just because price eventually passed them, and the frozen right edge makes clear the trade was already over. The stop's ray spans only the stretch where that level was actually in force, because a trailing stop is a staircase rather than one line: on a long it starts below the entry and can ratchet above it, locking in profit, and the amber slow core shows the whole path. Each level prints its exact price on the price scale, so the figure for an order ticket reads straight off the axis while the chart labels stay short. The colours carry the geometry: entry green, the targets in the trade's own direction and the stop in the opposite hue, so the level that ends a trade never reads like the levels that pay it — and the slow core keeps its amber, so the stop stays distinguishable from the line it trails.
- Adaptive engine: a per-volatility-regime fast core A/B-measured against the fixed one, as described above; default factors are inert.
- MTF strip: five rows of full consensus state (UP / DOWN / SPLIT / NEUTRAL, with bars-in-state), each read from that timeframe's last completed bar. Auto mode starts at the chart's own timeframe and climbs — 4H gives 4H/D/W/M/3M. Lower timeframes are omitted by default: their consensus flips many times during a single trade taken here, so it says little about an outcome measured over days. Manual mode accepts any five, defaulting to the classic 15m/1H/4H/D/W.
🟦 HOW TO USE IT
- Read the panel first: consensus state, cores, regime, HTF agreement, then the measured rows. An ↑ means that condition has earned its margin on this chart; its absence means it hasn't.
- Chips carry their evidence: grade letter, live per-grade TP1 odds at sufficient sample, ✓ where volume has helped, ⚠ where fighting the higher timeframe has hurt. Ghost chips mean the script stood aside — the reason is on the chip.
- NEUTRAL and SPLIT mean stand aside. The coach line says this in plain language, and notes that a retouch of the entry after TP1 does not invalidate a live ladder — only the SL does.
- Reversal-only signal mode reserves the headline presentation for slow-core reversals; Discipline display mode strips the chart to the band alone (note: TP/SL alerts only fire while the ladder is drawn).
- Defaults are tuned on liquid crypto from 15-minute to weekly charts; the multipliers and ADX threshold are worth reviewing on other asset classes.
🟦 SETTINGS
Grouped as in the inputs dialog: consensus core (presets or custom multipliers) · higher-timeframe filter · state model & signal gate (ADX, flip-cluster, optional HTF gate, ghost chips) · trade ladder (SL geometry, TP multiples) · grade engine (certified or dynamic wiring) · adaptive engine · MTF strip · visuals and display modes · volume multiple (default 1.5×) · signal stats engine (horizon, minimum sample, gating margin) · JSON webhook alerts.
🟦 ALERTS
Consensus long / short · confirmed reversal long / short · Grade A long / short · TP1 / TP2 / TP3 touched · SL break · NEUTRAL started / ended · volatility regime changed · adaptive engagement changed. Create the classic alert conditions with "Once Per Bar Close" — they evaluate on live bars, and an intrabar state can revert before it counts. Optional JSON alert() events via a single "Any alert() function call" alert: signal events carry grade, entry and levels; TP/SL events identify the touched level; all carry symbol, timeframe, regime and state. The JSON events are close-gated and fire for every passed candidate, including rejoins the Reversal-only display mode demotes.
🟦 REPAINT & DATA NOTES
- All bookkeeping runs on confirmed bars; chips, ladders and statistics commit at bar close. Inside a forming bar the panel's consensus, cores, agreement, volume and coach line update live and are therefore PROVISIONAL — they can revert before the bar shuts. Price can also sit beyond a ladder's stop for the rest of a bar without resolving it: in the core SL modes the stop breaks when that core flips, which needs a confirmed close. The coach line says so when it happens.
- Higher-timeframe and strip values come from each timeframe's last completed bar — no repaint; intrabar changes up there show after that bar closes. The design assumes the HTF sits above the chart's timeframe — with Manual selection, keep it there.
- Ladder TP touches — and the Fixed mode's hard-stop touches — are detected from confirmed bars' highs/lows, starting the bar after entry; a bar touching several levels credits TPs before the stop. In the core SL modes the stop is not touch-based: it resolves only when its core flips, which needs a confirmed close — so a wick through the stop does not end a ladder, and the touch-credited TP rates are structurally friendlier than a hard-stop backtest of the same levels. The Fixed k×ATR mode is the geometry closest to a real hard stop.
- Statistics cover the loaded history and reset when the chart reloads with different history; lower timeframes load fewer bars. Greyed rows just mean the sample is too small to trust.
- Only the most recent 250 chips and ghost chips stay on the chart, so a live ladder's own labels can never be pushed off by PulseWire's drawing limit; deep history keeps its band and cores but not its markers. Ladder odds count each ladder when it resolves, and in the rare case that more than 30 are open at once the oldest is counted at its current state rather than discarded — the sample is never silently trimmed.
- On a live bar the volume ratio is partial; judge it near the close. Volume features require a feed that supplies volume.
🟦 CREDITS
The Supertrend concept is public domain (popularized by Olivier Seban); ATR, ADX and the DMI are J. Welles Wilder's. The fixed cores use PulseWire's built-in ta.supertrend(); the adaptive core re-implements the same algorithm to accept a per-bar factor. The consensus model, candidate classes, statistics engine, gates, grades, measured ladder, ghost chips, strip and band rendering were written from scratch for this script.
🟦 LIMITATIONS
- Supertrend lags by construction, and requiring two cores to agree makes entries later still — fewer, later, more heavily filtered signals is the intended trade-off.
- The NEUTRAL state derives from lagging measures (ADX, flip counts), so the first signals of a new trend can still arrive grey or be suppressed.
- All statistics are direction-only measurements over a fixed horizon; ladder odds are level measurements (TPs credit on a wick touch, core-mode stops resolve only on a confirmed core flip) — no fees, slippage, sizing or equity math. They are not a strategy backtest, they differ per symbol and timeframe, and they do not predict future outcomes.
- Without volume data the volume filter and its split stay inactive, and certified Grade A (confirmation + volume) is out of reach — signals cap at Grade B on volume-less feeds. Sample sizes on higher timeframes are structurally small; expect greyed rows there.
- The same asset on two different venues can show opposite states. A Supertrend flip is a threshold event: when price sits within a fraction of a percent of the band, a normal inter-exchange spread of a few basis points decides whether it crosses, and once one venue flips its stop jumps to the other side of price, so two nearly identical charts diverge sharply. This is inherent to the calculation, not a data error — treat a signal as belonging to the feed it was measured on, and check the panel's sample sizes on the venue you actually trade.
🟦 DISCLAIMER
This is an educational analysis tool, not investment advice. Historical measurements, however carefully computed, do not predict future results. Trading involves substantial risk.
Indicator

Chandelier Exit Trend Navigator [MarkitTick]💡 A trend-following overlay that tracks directional shifts using a volatility-adaptive channel (Chandelier Exit methodology) and converts each flip into a fully structured trade plan — entry, stop-loss, and three R-multiple take-profit levels — displayed directly on the chart alongside a live status dashboard.
✨ Originality and Utility
While the Chandelier Exit concept itself (anchoring a trailing stop to the highest high or lowest low over a lookback, offset by a multiple of ATR) is a well-documented volatility-stop technique, this script extends that foundation into a complete navigation system rather than a simple trailing line.
Three layers separate this tool from a stock Chandelier Exit plot:
An optional adaptive pre-filter (Kalman Filter or a slope-adjusted moving average referred to here as LLAMA) that can be applied to the source series before the channel extremes are calculated, allowing the trend anchor itself to react differently to noise depending on which filter is selected.
A full trade-management layer built on top of the directional flip: automatic stop-loss placement, three independently configurable take-profit levels defined in R-multiples, and live linefill zones that visually separate risk from reward.
A condition-stacking filter system (higher-timeframe EMA bias and ADX strength) that must all align before a directional flip is treated as an actionable signal, reducing signals generated during weak or conflicting conditions.
The combination is not an arbitrary mashup — the adaptive filter conditions the input to the channel calculation, the HTF/ADX filters condition which flips are considered valid, and the trade-management layer converts a validated flip into a concrete, risk-defined plan. Each component feeds the next in a single directional pipeline.
🔬 Methodology and Concepts
● Chandelier Exit Core
The core channel is built from Average True Range (ATR), calculated over a user-defined lookback. Two boundaries are computed each bar:
A long-side stop, set below the highest value of the source over the lookback period, offset by a multiple of ATR.
A short-side stop, set above the lowest value of the source over the same lookback, offset by the same ATR multiple.
Users can choose whether the highest/lowest calculation uses close-based extremes or true high/low wicks, which changes how sensitive the channel is to intrabar spikes.
A persistent trailing line then locks in the tighter of the two boundaries as price develops: while the current directional state is bullish, the line only ratchets upward (never loosening on a pullback); while bearish, it only ratchets downward. A directional flip occurs when price closes beyond the opposite boundary from the prior bar, at which point the trailing line resets to anchor the new trend.
● Adaptive Source Filtering
Before the channel extremes are calculated, the source price can optionally be passed through one of two smoothing methods:
Kalman Filter — a recursive estimator that updates its estimate of the "true" price each bar based on a prediction-error and gain calculation, converging faster in stable conditions and adapting more cautiously during volatile ones.
LLAMA — a linear-regression-style approach that takes a simple moving average of the source and adjusts it by the recent slope (rate of change) over the same lookback, projecting the average forward in the direction the price has been drifting.
When neither is selected, the raw close is used directly, preserving the traditional Chandelier Exit behavior.
● Confirmation Filters
Two independent filters can be layered on top of the raw directional flip before it is treated as a signal:
A higher-timeframe EMA bias filter, which only allows long signals when price is trading above an EMA calculated on a higher timeframe, and only allows short signals when price is trading below it.
An ADX-based strength filter, which requires the Average Directional Index to be at or above a user-defined threshold before any signal — long or short — is permitted, filtering out flips that occur during weak, non-trending conditions.
Both filters default to off and can be combined or used independently.
● Trade Level Construction
When a filtered directional flip is confirmed on a closed bar, the script anchors a trade plan to the prior bar's close:
Risk per trade is defined as the prior bar's ATR multiplied by a user-set stop-loss multiplier.
The stop-loss is placed one risk-unit away from the entry, in the direction opposite the trade.
Three take-profit levels are placed at independently configurable R-multiples of that same risk distance (default 1R, 2R, and 3R), each extending in the direction of the trade.
This means every signal comes with a symmetric, volatility-scaled risk framework rather than a fixed point value, so trade levels automatically widen or tighten with current market volatility.
🎨 Visual Guide
Heatmap Candles — the chart's candle bodies and wicks are recolored to match the current directional state: teal/green while the trailing system is bullish, red while bearish, and gray when direction is undetermined (e.g. on the very first bar).
Entry Line (blue, dashed) — marks the anchor price of the most recent confirmed trade signal.
Stop-Loss Line (red, solid, thicker) — marks the calculated stop price for the active signal, labeled "✕ SL" with its price value.
Take-Profit Lines (green, dashed, three separate levels) — TP1, TP2, and TP3, each drawn with progressively fuller opacity so TP3 is the most visually solid, labeled "◆ TP1", "✦ TP2", and "◆ TP3" respectively with their price values.
Risk Zone Fill — a light red shaded region between the stop-loss and entry lines, visually sizing the risk portion of the trade.
Reward Zone Fill — a light teal shaded region between the entry and TP3 lines, visually sizing the potential reward portion of the trade.
Dashboard Table — a repositionable panel (default top-right) summarizing, in real time: Lock status, current Trend direction, HTF Bias reading, the numeric CE trailing-stop level, current ATR value, and the active Entry/SL prices. When enabled, it also displays the current ADX reading and which adaptive filter (if any) is active. A visual bar-and-percentage gauge shows the reward-to-risk ratio of the current trade relative to TP3, colored red/yellow/green depending on how favorable it is.
📌 Note : the best way to resolve visual overlap is to navigate to the Object Tree and drag the indicator above the main chart layer, or simply hide the native candles in your chart settings.
📖 How to Use
A directional flip in the heatmap candle color, together with a new Entry/SL/TP level set appearing on the chart, indicates a fresh signal in that direction.
The Stop-Loss line represents the level at which the trade thesis is considered invalidated under this system's logic.
TP1, TP2, and TP3 represent successive profit-taking references at increasing R-multiples; price reaching a level does not close or resize the plotted level automatically — it is a visual reference for scaling decisions.
The Risk and Reward zone fills give an immediate visual sense of the trade's risk framing without needing to read exact price values.
The Dashboard's R:R (TP3) gauge offers a quick read on how the reward potential compares to the initial risk for the most recent signal.
The Lock Signal input, when enabled, freezes the currently plotted levels in place and suppresses new signal generation — useful for reviewing a specific setup without the chart updating further trade plans in real time.
When the HTF or ADX filters are enabled but conditions aren't met, no new signal will fire even if the raw directional flip occurs — check the Dashboard's HTF Bias and ADX rows to understand why a flip may not have produced a signal.
⚙️ Inputs and Settings
ATR Len / ATR Mult — controls the lookback and volatility multiplier used to build the Chandelier channel; a longer length and/or larger multiplier produces a wider, slower-reacting trailing stop.
Use Close Extremes — toggles between close-based and high/low-based channel construction, changing sensitivity to intrabar wicks.
HTF Trend Filter / HTF TF / HTF EMA Len — enables and configures the higher-timeframe EMA bias filter that gates which direction of signal is permitted.
Use ADX Filter / ADX Threshold / ADX Length — enables and configures the trend-strength filter that must be satisfied for any signal to fire.
Adaptive Filter / Adaptive Filter Length — selects an optional smoothing method (Kalman Filter or LLAMA) applied to the source before channel calculation, and its lookback length.
Lock Signal — freezes the currently displayed trade levels and halts new signal generation.
SL ATR Mult — sets how many ATR units define one unit of risk for stop-loss placement.
TP1 R / TP2 R / TP3 R — sets the R-multiple distance for each take-profit level relative to the calculated risk.
Heatmap Candles / Show Trade Levels — toggle the directional candle coloring and the entry/SL/TP drawing layer independently.
Dash Pos — repositions the dashboard to any chart corner.
Color inputs — customize the bullish/bearish colors, stop-loss, entry, and take-profit line colors, and the dashboard's background, header, and text colors.
Alert action fields (Long/Short/Close Long/Close Short) — customize the text string sent in the "action" field of the JSON alert payload, useful for routing signals to automated systems expecting specific action keywords.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The trailing-stop core of this script belongs to a family of volatility-adjusted stop techniques that use Average True Range as a normalization factor for price movement, an approach popularized in trend-following and volatility-breakout literature as a way to size stops relative to an instrument's current, rather than fixed, volatility regime. Anchoring the stop to a rolling extreme (highest high or lowest low) rather than a fixed percentage or point distance reflects the broader class of "channel breakout" trend systems, in which a directional bias persists until price violates a level defined by recent extremes — a structure with roots in classical trend-following systems that predate modern indicator platforms.
The optional Kalman Filter smoothing draws on recursive Bayesian estimation theory, originally developed for tracking dynamic systems under measurement uncertainty. Applied to price, it treats each new close as a noisy observation of an underlying "true" value, blending the prior estimate with the new observation according to a gain term that adjusts based on estimated error — a formulation with parallels to adaptive filtering approaches used in signal processing and, more recently, in quantitative finance research on noise-reduction for price series.
The LLAMA-labeled alternative combines a simple moving average with a linear slope projection, conceptually related to local linear regression and momentum-adjusted smoothing techniques, where a lagging average is advanced along the estimated trend direction to partially compensate for the inherent lag of moving-average-based estimators.
The ADX-based strength filter draws on Welles Wilder's Directional Movement framework, which quantifies trend strength independently of trend direction; requiring a minimum ADX reading before accepting a signal reflects a common risk-management heuristic in trend-following systems — that directional signals generated during low ADX (ranging/choppy) conditions have historically shown less reliability than those generated during elevated trend strength, though this relationship is probabilistic rather than deterministic and varies across instruments and regimes.
The take-profit structure, expressed in R-multiples of the initial risk rather than fixed price or percentage targets, reflects standard position-sizing and risk-management theory in which trade outcomes are measured relative to the capital placed at risk, allowing performance to be evaluated on a risk-normalized basis rather than in absolute price terms.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicator

Impulse Box Breakout Engine - Origin Range Buy Sell SignalsIMPULSE BOX BREAKOUT ENGINE — a complete breakout trading system in one indicator: self-adjusting impulse boxes with entry arrow, stop, two fixed targets, a pink trailing-stop dot line and webhook automation. Rebuilt 1:1 from a professional German "Impulsbox" breakout engine (72-minute source webinar, analyzed frame by frame) and redesigned as a modern cockpit indicator.
█ WHAT IT DOES
The engine meters the market N bars back: the range the market traded in PLUS the length of every single bar inside it (compression check). When a STRONG impulse bar closes outside that range, the IMPULSE BOX appears over the consolidation:
• CYAN BOX = long breakout — big entry arrow inside the box
• GOLD BOX = short breakout — mirrored to the downside
• Initial stop = the far side of the box (bottom for longs, top for shorts)
• TARGET 1 + TARGET 2 (violet marks) are projected from the box height the moment the box appears — FIXED, never repainted, never moved afterwards
• PINK DOTS = the trailing stop. It starts at the box edge and follows price with ~30% of the move as breathing room. It only ratchets in your favor — never back
• At Target 1 the stop jumps to break-even or better. After Target 2 the system follows the source rule: "never leave the market voluntarily — let the stop take you out"
█ SELF-OPTIMIZING ENGINE
Markets are sideways ~80% of the time — rigid breakout parameters fail there. This engine adapts automatically:
• TREND regime (ADX based): short lookback, wider targets (+35% / +100% of box height)
• RANGE regime: longer lookback, stricter impulse filter, closer targets (+25% / +75%)
• AUTO-RECALIBRATION: after a false breakout the impulse threshold is raised temporarily — fewer but cleaner boxes. A winning box resets it
• The cockpit shows the current regime, calibration and effective parameters at all times
█ HONEST LIVE STATISTICS
The cockpit counts every box on your chart and shows the real Target-1 and Target-2 hit rates — no marketing numbers, live counted on your symbol and timeframe. On XAUUSD 15m the default engine printed 500+ boxes with a T1 hit rate above 90% at the time of publishing (past performance never guarantees future results).
█ DIRECTION BIAS FILTER
The #1 rule of the source system: trade boxes only in the direction of the higher-level move. The indicator automates this via EMA-200 + Supertrend bias. Choose: Off / Mark counter-bias boxes (dimmed + warning) / Filter them out completely. Supertrend companion arrows are included as extra confluence.
█ EVERY SIGNAL EXPLAINS ITSELF
Hover any BUY/SELL pill: how many bars of consolidation, how strong the impulse bar was (x average bar), which range edge broke, which regime the engine was in, whether the box agrees with the bias — plus entry, stop and both targets. No black box.
█ WEBHOOK AUTOMATION (BOTS / BRIDGES)
Create ONE alert with "Any alert() function call" and your webhook URL. The indicator fires ready-to-use JSON on BUY, SELL, T1_HIT, T2_HIT, TRAIL_EXIT and SL_HIT — including entry, stop, both targets, box levels, regime and live hit rates. Works with any webhook bridge, bot or auto-trader.
█ HOW TO USE
1) Add to chart — works on ALL symbols and ALL timeframes (crypto, gold, forex, indices, stocks)
2) Use standard candles or OHLC bars (Heikin-Ashi smoothing swallows breakouts — a key finding of the source webinar)
3) Wait for a box + arrow, entry at the breakout close, stop at the far box edge
4) Take partial profit at Target 1, let the rest run with the pink trailing dots
5) Automate via webhook JSON if you want
█ SETTINGS
Everything is configurable: manual mode with fixed lookback/impulse strength, target distances, trailing gap, exit-at-T2 mode, bias filter mode, Supertrend, chart theme, cockpit position and all alert toggles.
Educational tool only — not financial advice. Trading involves substantial risk. Always test on a demo account first and never risk money you cannot afford to lose.
WHY THESE PARTS BELONG TOGETHER
The impulse detection and the box are one mechanism, not two features. The impulse identifies the
candle sequence that moved the market; the box freezes the range that impulse came out of, because
that range is the level the market has to defend for the move to continue. Detecting impulses
without marking their origin gives you a signal with no invalidation, and drawing boxes without an
impulse gives you consolidation zones with no direction.
Indicator

Swing Trade Defender
You're in a trade. Defender watches it for the five ways swing trades fail — plus an ATR trailing stop — and shows one status: OK, CAUTION, or EXIT.
Finding the trade is the easy half. The hard half is admitting when it stops working — and doing it before a small loss becomes a big one. Swing Trade Defender watches your open trade bar by bar and does the admitting for you.
Set your direction (long or short) and, if you want, your entry price. It handles the rest — it works on its own, nothing else required.
Why five flags instead of one exit signal?
Every one of these signals fires false alarms by itself — an RSI dip, a single heavy-volume red bar, a wick through the 20 EMA.
Real trade failure rarely announces itself through one signal; it shows up as agreement between independent ones: trend, structure, momentum, participation, and volatility.
So Defender treats them as a vote. One or two flags is a warning to pay attention; three is a failed trade by definition — enough independent evidence that the odds have flipped. The one exception is the ATR trail, which triggers EXIT on its own, because a stop is a stop. The voting logic — not any individual component — is the tool.
The five failure flags — each worth 1 point
Trend break — price closes through the 20-EMA (the trend's home line) the wrong way.
Structure break — price takes out the prior swing low (for a long), the first crack in the pattern.
Momentum rollover — RSI falls back through 50 and keeps dropping.
Distribution — a down bar on 1.5× average volume or more: big sellers showing their hand.
Trail hit — price closes through the ATR trailing stop (a chandelier-style stop that ratchets up behind price, 2.5 × ATR-14 by default; ATR = average bar range).
All five flip automatically for shorts — there a close above the MA, a break of the prior swing high , rising RS I, and heavy buying (accumulation) are the danger signs.
How the status reads
OK — no flags. Let it work.
CAUTION (1–2 flags) — an orange triangle marks the bar. Hover it and a tooltip lists exactly which flags are up.
EXIT — 3 or more flags (you can set the threshold), or any trail hit on its own . A red ✕ marks the bar, with a box listing what failed.
Markers sit above the bar for longs and below it for shorts, so they never crowd the side your risk is on.
The status panel
One table shows the whole picture: status, flag count (x/5), each flag's own line (hold/break), the live ATR trail price, your entry, and open P/L when you've set an entry price.
Alerts
Two built-in alert conditions — "Exit signal" and "Caution" — so PulseWire can ping your phone instead of you watching the screen.
Settings — defaults work out of the box
Tuned for swing trades held days to weeks:
Trend MA length (20), swing lookback (8 bars), RSI length (14) and rollover level (50), volume spike multiple (1.5×).
ATR trail — length (14) and multiple (2.5).
Flags needed for EXIT (3 by default, 1–5).
Panel position/size, marker history on/off, optional background shading, dark/light theme, colors.
⚠ Educational risk-management tool. EXIT means the trade has failed by these rules — whether to act is always your decision. It does not place orders, and a flag is not a prediction. Not financial advice. Indicator

[Kpt-Ahab] Moving Average Simple AlgoPilotImportant Notice and Risk Warning
The published settings were selected exclusively based on historical data for the asset and timeframe shown.
The displayed result may be random or over-optimized and cannot automatically be transferred to other assets, timeframes, or future market conditions. Even with the presented settings, the strategy may cause significant losses at any time, including the complete loss of the allocated strategy capital.
This script is intended exclusively for analysis and testing purposes. It does not constitute investment advice or a trading recommendation.
Description
This script uses reused and adapted code components from ** Auto RiskManagement & Backtest System 2.1b** and the ** Moving Average Alarm Output **.
These components have been combined into a standalone strategy that integrates moving-average signals with position management, risk management, and backtesting functions.
How It Works
The strategy uses two freely configurable moving averages. **SMA, EMA, WMA, VWMA, or HMA** can be selected independently for the short and long moving averages.
A long signal is generated when the short moving average crosses above the long moving average. A short signal is generated when the short moving average crosses below the long moving average.
The moving averages are displayed directly on the chart. An additional colored area visualizes the position of the price relative to the long moving average. Its intensity changes according to the distance between the two moving averages.
Position and Risk Management
The script supports, among other features:
* Long and short positions
* Fixed or trailing stop-loss levels
* Multiple partial profit targets
* A final profit target
* Breakeven after the first profit target
* Optional additional entries
* Drawdown and losing-trade limits
* Internal or external trading signals
* Different position-sizing methods
Additional entries and simulated leverage may significantly increase the risk of loss.
Backtest Limitations
Strategy Tester results are based exclusively on historical market data. Real-world results may differ significantly due to commissions, spreads, slippage, liquidity, price gaps, and execution delays.
Past performance is not a reliable indication of future results.
Signals During an Open Position
The **Open Position Signals** setting determines how new signals are handled while a position is already open:
* **Wait-End-Deal:** All new moving-average signals are ignored until the current position has been closed by a profit target, stop-loss, or another protective function.
* **Wait-Reversal:** An opposing moving-average signal may close the currently open position.
With **Wait-Reversal**, a sell signal closes a long position, while a buy signal closes a short position. The opposing signal does not automatically open a new position during the same step.
Price-based additional entries remain independent of this setting and may still be executed when enabled.
Stop-Loss, Trailing Stop, Breakeven, and Liquidation Line
The strategy supports both a fixed stop-loss and a trailing stop. The selected percentage represents the direct price distance from the average entry price and is not automatically adjusted by the simulated leverage.
In **FIXED %** mode, the stop is calculated from the current average entry price. If the average entry price changes due to an additional entry, the stop is recalculated accordingly.
In **TRAILING** mode, the stop only moves in a direction that is favorable to the position. If the average entry price changes due to an additional entry, the existing trailing stop is adjusted accordingly.
The stop may optionally be moved to the average entry price after the first profit target has been reached. A stop mode must be enabled for this breakeven function to operate.
The displayed liquidation line is only an internal estimate based on the simulated position and account values. It may differ significantly from the actual liquidation calculation used by a broker or exchange.
Using External Indicators
An external numerical signal source may be used instead of the integrated moving-average signals.
The external indicator must provide a selectable plot series containing the following values:
* **+1:** Long or buy signal
* **−1:** Short or sell signal
All other values, including `na`, produce no new signal.
The external indicator must output the required numerical values through a selectable plot. This plot can then be selected under **External Source**.
How an external signal is processed while a position is already open also depends on the selected **Open Position Signals** setting.
Wichtiger Hinweis und Risikowarnung
Die veröffentlichten Einstellungen wurden ausschließlich anhand historischer Daten für das dargestellte Asset und den verwendeten Zeitrahmen gewählt.
Das Ergebnis kann zufällig oder überoptimiert sein und lässt sich nicht automatisch auf andere Assets, Zeitrahmen oder zukünftige Marktphasen übertragen. Auch mit den dargestellten Einstellungen kann die Strategie jederzeit erhebliche Verluste verursachen und das eingesetzte Strategiekapital vollständig verlieren.
Dieses Skript dient ausschließlich zu Analyse- und Testzwecken und stellt keine Anlageberatung oder Handelsempfehlung dar.
Beschreibung
Dieses Skript verwendet wiederverwendete und angepasste Codebestandteile aus ** Auto RiskManagement & Backtest System 2.1b** und dem ** Moving Average Alarm Output **.
Die Komponenten wurden zu einer eigenständigen Strategie verbunden, die Moving-Average-Signale mit Positions-, Risiko- und Backtestfunktionen kombiniert.
Funktionsweise
Die Strategie verwendet zwei frei konfigurierbare gleitende Durchschnitte. Für den kurzen und den langen Moving Average können jeweils **SMA, EMA, WMA, VWMA oder HMA** ausgewählt werden.
Ein Long-Signal entsteht, wenn der kurze Moving Average den langen Moving Average von unten nach oben kreuzt. Ein Short-Signal entsteht bei einer Kreuzung von oben nach unten.
Die Moving Averages werden direkt im Chart dargestellt. Eine zusätzliche farbliche Fläche visualisiert die Position des Kurses relativ zum langen Moving Average. Die Intensität der Darstellung verändert sich abhängig vom Abstand zwischen den beiden Moving Averages.
Positions- und Risikomanagement
Das Skript unterstützt unter anderem:
* Long- und Short-Positionen
* feste oder nachlaufende Stop-Loss-Marken
* mehrere Teilgewinnziele
* ein abschließendes Gewinnziel
* Breakeven nach dem ersten Gewinnziel
* optionale zusätzliche Einstiege
* Drawdown- und Verlustserienbegrenzungen
* interne oder externe Handelssignale
* unterschiedliche Methoden zur Bestimmung der Positionsgröße
Zusätzliche Einstiege und ein simulierter Hebel können das Verlustrisiko deutlich erhöhen.
Einschränkungen des Backtests
Die Ergebnisse des Strategietesters basieren ausschließlich auf historischen Kursdaten. Reale Ergebnisse können durch Gebühren, Spread, Slippage, Liquidität, Kurslücken und Ausführungsverzögerungen erheblich abweichen.
Vergangene Ergebnisse sind kein verlässlicher Hinweis auf zukünftige Ergebnisse.
Signale während einer offenen Position
Über **Open Position Signals** wird festgelegt, wie neue Signale während einer bereits geöffneten Position behandelt werden:
* **Wait-End-Deal:** Alle neuen Moving-Average-Signale werden ignoriert, bis die aktuelle Position durch ein Gewinnziel, einen Stop-Loss oder eine andere Schutzfunktion beendet wurde.
* **Wait-Reversal:** Ein entgegengesetztes Moving-Average-Signal kann die aktuell geöffnete Position schließen.
Bei **Wait-Reversal** schließt ein Verkaufssignal eine Long-Position und ein Kaufsignal eine Short-Position. Das entgegengesetzte Signal eröffnet dabei nicht automatisch im selben Schritt eine neue Position.
Preisbasierte zusätzliche Einstiege bleiben von dieser Auswahl unabhängig und können weiterhin ausgeführt werden, sofern sie aktiviert sind.
Stop-Loss, Trailing-Stop, Breakeven und Liquidationslinie
Die Strategie unterstützt einen festen Stop-Loss sowie einen nachlaufenden Trailing-Stop. Der eingestellte Prozentwert beschreibt den direkten Kursabstand zum durchschnittlichen Einstiegspreis und wird nicht automatisch durch den simulierten Hebel verändert.
Im Modus **FIXED %** wird der Stop anhand des aktuellen durchschnittlichen Einstiegspreises berechnet. Verändert sich dieser durch einen zusätzlichen Einstieg, wird auch der Stop neu berechnet.
Im Modus **TRAILING** wird der Stop nur in eine für die Position günstigere Richtung nachgezogen. Verändert sich der durchschnittliche Einstiegspreis durch einen zusätzlichen Einstieg, wird der bestehende Trailing-Stop entsprechend angepasst.
Optional kann der Stop nach dem Erreichen des ersten Gewinnziels auf den durchschnittlichen Einstiegspreis verschoben werden. Für diese Breakeven-Funktion muss ein Stop-Modus aktiviert sein.
Die angezeigte Liquidationslinie ist lediglich eine interne Schätzung auf Basis der simulierten Positions- und Kontowerte. Sie kann deutlich von der tatsächlichen Liquidationsberechnung eines Brokers oder einer Börse abweichen.
Verwendung externer Indikatoren
Anstelle der integrierten Moving-Average-Signale kann eine externe numerische Signalquelle verwendet werden.
Der externe Indikator muss eine auswählbare Plot-Serie mit den folgenden Werten bereitstellen:
* **+1:** Long- beziehungsweise Kaufsignal
* **−1:** Short- beziehungsweise Verkaufssignal
Bei allen anderen Werten oder bei `na` wird kein neues Signal ausgelöst.
Der externe Indikator muss die benötigten Zahlenwerte direkt über einen auswählbaren Plot ausgeben. Dieser Plot kann anschließend unter **External Source** ausgewählt werden.
Wie ein externes Signal während einer bereits geöffneten Position verarbeitet wird, hängt zusätzlich von der gewählten Einstellung unter **Open Position Signals** ab.
Strategy

SuperTrend (Based on Historical Volatility)The SuperTrend (Based on Historical Volatility) is an advanced trend-following and trailing stop-loss indicator designed to solve a common problem with traditional trend lines-
False flips during choppy, ranging markets.
By analyzing price efficiency, bar-to-bar price shifts, and volume conviction, this indicator dynamically adjusts its distance from the price to protect you from noise while keeping you in the true trend.
Standard SuperTrend vs. Historical Volatility SuperTrend
How a Normal SuperTrend Works:
A standard SuperTrend uses a simple formula: it takes the median price (High + Low) / 2 and offsets a line using the Average True Range (ATR) multiplied by a fixed, static number (like 2 or 3). It plots this line above or below the price. If the price simply closes across this line, the trend flips. Because the multiplier is static, it often gets chopped up and produces false signals when a market moves sideways.
How This Indicator Works:
This version does not use a static multiplier or standard ATR. Instead, it uses a Variance Engine to calculate a dynamic offset. When the market is trending cleanly, the band tightens to trail price closely. When the market is choppy and inefficient, the indicator automatically expands the multiplier to give the price more room to breathe. Furthermore, this SuperTrend will not flip its trend just because a single candle closed across the line; it requires high volume, a deep price push, or prolonged time beyond the line to confirm a true reversal.
How It Measures Volatility
To create this dynamic, breathing band, the script calculates volatility using three primary metrics:
Efficiency Ratio (Noise Measurement): It calculates the net price change over your chosen Lookback period and divides it by the total absolute distance the price traveled bar-by-bar. This tells the script if the market is trending directly or moving erratically.
Price Shift: It measures the absolute change in the average candle price (ohlc4) from one bar to the next.
Volume & Depth Profiling: It measures the current volatility percentage (High-to-Low depth) and compares current volume against the Moving Average of volume to identify true market conviction.
How to Use the Lookback Settings
The Lookback input is the most important setting for determining how this indicator behaves. Rule of thumb: A higher lookback means a more stable trend.
For Trailing Stop-Loss (Swing/Active Trading): Use a low Lookback period like 7 or 20. This keeps the line highly responsive. You must adjust this number slightly to find what fits perfectly for the specific stock or asset you are trading.
For Broad Trend Analysis: If you are trying to analyze the overarching macro trend of an asset, use a high Lookback period, such as 500 or more.
For Intraday Trading (1min, 5min, 15min charts): It is highly recommended to use extreme Lookback lengths of 1000 to 2000. Because intraday timeframes are incredibly noisy, a massive lookback allows the indicator to truly understand how the stock moves historically, filtering out micro-fluctuations and plotting a highly stable, accurate intraday trend direction.
Visual Features
The indicator includes aesthetic options to suit your chart style:
Fill Styles: Choose between a standard Ribbon, a fading Gradient Zone, a Safety Cloud, or turn fills off entirely.
Color Themes: Select between Classic Professional (Mint/Crimson), Dragon Ball Z (Orange/Purple), or Neon Light (Cyan/Magenta).
Indicator

SuperTrend+TrailingStop+ChandelierExit/Stop [OmniFlamo]
Overview
This indicator combines four well-known trailing-stop methodologies into a single, switchable tool: SuperTrend, Trailing Stop, Chandelier Exit, and Chandelier Stop. Instead of publishing four separate scripts, this lets traders compare and switch between stop-calculation styles on the same chart using one input.
How it works
An ATR value is calculated using a selectable smoothing method (RMA/SMA/EMA/WMA/VWMA/DEMA/VAR), then multiplied by a user-defined factor.
Depending on the selected mode, the ATR offset is applied to a different price reference (hl2, high/low, or close), producing an upper (short) stop and a lower (long) stop.
SuperTrend hl2 ± ATR
TrailingStop high/low ± ATR
ChandelierExit close ± ATR (usePeriod → N close max/min)
ChandelierStop low/high ± ATR (usePeriod →
classic Chandelier: lowest(low,N)+ATR/highest(high,N)−ATR
A ratchet mechanism only lets the long stop rise and the short stop fall while the trend persists, which is the same logic used in classic SuperTrend implementations — this prevents the stop from moving against the trade.
A direction flag flips from long to short (or vice versa) only when price closes beyond the opposite stop line, and the active stop line is plotted accordingly.
How to use it
Select the calculation mode (SuperTrend, TrailingStop, ChandelierExit, ChandelierStop) that matches your trading style.
Adjust ATR length and multiplier to control stop sensitivity — larger multipliers give wider stops and fewer whipsaws, smaller multipliers react faster but generate more signals.
Optional: enable "Show ATR Upper And Lower" to visualize the raw bands before the ratchet/direction logic is applied.
Alerts are provided for stop-line crossovers/crossunders and trend-direction changes, so this can be used for manual trade management or as a building block for automated alert workflows.
Notes & disclaimer
The stop line does not repaint once a bar closes; values shown on the currently forming bar are provisional until close.
This is a trend-following stop/exit tool, not a standalone entry signal generator — it works best combined with your own trend or momentum confirmation.
For sale/manual traders only — this publication does not constitute financial advice. Past performance of any stop-loss method does not guarantee future results. Always backtest and risk-manage independently before live use.
=====================================
概述
本指标将四种经典的移动止损/离场算法整合为一个可切换的工具:SuperTrend、Trailing Stop(跟踪止损)、Chandelier Exit(吊灯离场)与 Chandelier Stop(吊灯止损)。无需分别发布四个脚本,交易者可以在同一图表上通过一个输入项对比、切换不同的止损计算方式。
计算原理
使用可选的均线平滑方式(RMA/SMA/EMA/WMA/VWMA/DEMA/VAR)计算 ATR,并乘以用户自定义的倍数。
根据所选模式,ATR 偏移量会应用到不同的价格基准(hl2、最高/最低价或收盘价),从而得到上方(空头)止损线与下方(多头)止损线。
SuperTrend hl2 ± ATR
TrailingStop high/low ± ATR
ChandelierExit close ± ATR (usePeriod → N close max/min)
ChandelierStop low/high ± ATR (usePeriod →
classic Chandelier: lowest(low,N)+ATR/highest(high,N)−ATR
采用"棘轮"机制:趋势持续期间,多头止损只上移、空头止损只下移,这与经典 SuperTrend 的处理逻辑一致,避免止损线逆势移动。
仅当收盘价突破对侧止损线时,方向标志才会由多转空或由空转多,并绘制对应的当前止损线。
使用方法
根据自己的交易风格选择计算模式(SuperTrend、TrailingStop、ChandelierExit、ChandelierStop)。
调整 ATR 周期与倍数以控制止损的灵敏度——倍数越大,止损越宽、被震荡打止损的概率越低;倍数越小,反应越快但信号也越多。
可选开启"Show ATR Upper And Lower"以查看棘轮/方向逻辑处理前的原始通道。
内置止损线上穿/下穿及趋势方向变化的提醒(alert),可用于人工交易管理,也可作为自动化提醒流程的基础模块。
说明与免责声明
K线收盘后止损线不会重绘;当前未收盘K线上显示的数值为临时值,收盘后才会确定。
本指标是趋势跟踪型止损/离场工具,而非独立的入场信号生成器,建议配合自己的趋势或动量确认方法一同使用。
本发布内容不构成任何财务建议。任何止损方法的历史表现均不保证未来结果,实盘使用前请务必自行回测并做好风险管理。
Indicator

SuperTrend Engine [Quantum Algo]SuperTrend Engine
====================================================
🔶 OVERVIEW
SuperTrend Engine is a volatility-adaptive SuperTrend indicator built on one idea: every SuperTrend gives you signals — this one shows you the whipsaws it saved you from, tells you its real win rate on your chart, and admits when it is wrong.
The engine self-tunes its factor with a fully transparent formula, confirms flips through a Whipsaw Shield that absorbs fake-outs and marks every one it absorbed, stamps every buy and sell flip with its live, honestly-computed win rate on the current symbol, settles every marker into its real outcome ten bars later, and draws the trade geometry — entry, trailing stop, one-R and two-R references — the moment a flip confirms.
🔶 WHAT IS A SUPERTREND?
A SuperTrend is a trailing stop built from the Average True Range: a band placed a volatility-scaled distance from price that ratchets in the trend's favor and never retreats. While price holds above the band, the trend is up and the band trails below as a stop; a close through the band flips the state. It is one of the most followed trend-following tools in retail trading — and its famous weakness is the whipsaw: sideways markets flip it back and forth, and a fixed factor that survives chop is too slow in trends. This engine is built specifically against that weakness.
🔶 WHY THIS SCRIPT IS ORIGINAL
1. The Whipsaw Shield — visible absorbed fake-outs. A flip only confirms when the close clears the opposite band by a volatility margin. When the raw trail flips and reverses before clearing it, the engine holds its direction and prints a small ghost marker where the whipsaw died, with a running Whipsaws Shielded counter in the dashboard. Other tools try to reduce whipsaws quietly; to our knowledge, none renders the failures it absorbed. Here the evidence is on the chart.
2. Honest per-symbol flip statistics. Every flip is stamped with its live win rate on this exact symbol and timeframe — shrinkage-adjusted so thin history cannot show fake confidence, with a Wilson confidence bound and sample count in the hover tooltip. The indicator audits itself in public instead of asserting signals.
3. Markers that settle into their outcome. Each buy and sell marker resolves ten bars later: the trend color if the flip delivered, faded gray if it failed. Scroll any chart and read the engine's true track record directly off the markers — including the losses.
4. Transparent adaptation, not a black box. The factor self-tunes between your two bounds using Perry Kaufman's Efficiency Ratio — tight when price moves cleanly, wide in chop — and the dashboard shows the live factor and efficiency reading every bar. The adaptation can be verified with a calculator; nothing asks for trust.
5. A trade plan, not just a line. On every confirmed flip the engine draws the entry, the trailing stop, and one-R and two-R reference levels, and the dashboard tracks the open signal's running R-multiple live.
6. A breathing chart. The glow between price and trail intensifies with trend distance and fades as price returns to the stop, grade-A flips (volume, efficiency, and a decisive break together) print in the accent color, and the whole layer stays capped and clean.
🔶 HOW IT WORKS
Adaptive trail: Classic ratcheting SuperTrend bands are computed from the Average True Range, with the factor interpolated between the trend bound and the chop bound by the Efficiency Ratio — the ratio of net price movement to total path length over the lookback.
Whipsaw Shield: The raw band flip is treated as a candidate, not a signal. Only a close beyond the opposite band plus the margin confirms the flip; a raw flip that reverses first is counted, marked as a ghost, and absorbed.
Statistics: Each confirmed flip records what price did ten and thirty bars later, in the flip's direction, into capped first-in-first-out databases. Win rates are pulled toward fifty percent by pseudo-samples and carry Wilson lower bounds. Until the minimum sample is met, markers read "collecting history" instead of inventing a number.
Outcome settlement: Every marker stores its flip price and recolors by the realized ten-bar outcome, then joins the capped history.
Grading: Volume z-score, efficiency level, and break decisiveness combine into an A, B, C grade on every flip.
Non-repainting: Flips, shields, grades, statistics, and settlement are all evaluated on closed bars. Once printed, nothing moves.
🔶 HOW TO USE IT
1. Works on any market — cryptocurrency, forex, gold, indices, stocks, futures — and any timeframe. Trending instruments suit tighter trend bounds; choppy ones benefit from a wider chop bound and a larger shield margin.
2. Treat the flip as regime information and the trail as the stop: the line is the invalidation, and the one-R and two-R references scale targets to the risk the stop defines.
3. Read the ghost markers as the tool working: a cluster of × marks in a range is the chop a fixed-factor SuperTrend would have traded.
4. Judge fresh flips against the settled history and the statistics rows — a symbol whose markers keep settling gray is telling you trend-following struggles there, and that is information worth having before the next flip.
5. Use the grade for position confidence: an A-grade flip with volume, high efficiency, and a decisive break is a different event from a drift-through.
6. Watch the live factor and efficiency in the dashboard to see the adaptation reasoning in real time.
🔶 SETTINGS
- Adaptive trail: Average True Range length, factor in strong trend, factor in chop, Efficiency Ratio length.
- Whipsaw Shield: flip margin and ghost marker toggle.
- Statistics: sample cap, minimum samples to grade, shrinkage strength, Wilson z-score, markers to keep.
- Trade plan toggle and plans to keep.
- Visuals: all colors, glow fill, candle tinting.
- Themeable dashboard: position, four text sizes, title band, background, frame, grid, and three text colors.
🔶 ALERTS
- Buy Flip / Sell Flip — the adaptive trail flipped with the confirmation margin cleared.
- Whipsaw Shielded — a raw flip reversed before confirming; the engine held its direction.
- Grade A Flip — full quality confluence: volume, efficiency, and a decisive break.
🔶 FREQUENTLY ASKED QUESTIONS
Does the indicator repaint? No. Every flip, shield event, grade, statistic, and marker settlement is evaluated at bar close. Once printed, nothing moves.
How is this different from other adaptive or machine-learning SuperTrends? Adaptation itself is not the claim — several tools adapt the factor. The differences are transparency and honesty: the adaptation here is one verifiable formula shown live on the dashboard, the whipsaws it absorbs are rendered instead of hidden, every signal carries its real statistics with confidence bounds, and every marker settles into its true outcome.
What does a ghost × marker mean? The raw SuperTrend flipped there and reversed before clearing the confirmation margin. The engine held its direction and counted the whipsaw it absorbed.
Why does a marker turn gray? The flip failed: ten bars later, price had not moved in its direction. Gray markers are the audit trail working — an honest tool must be able to show its losses.
Why do the win rates hover near fifty percent on some symbols? Because that is the truth of trend-flip performance there. The shrinkage and confidence bounds are designed to display small honest numbers rather than large misleading ones.
🔶 CREDITS
The SuperTrend trailing stop was created by Olivier Seban; the Average True Range is by J. Welles Wilder Jr. (1978); the Efficiency Ratio is by Perry J. Kaufman; the Wilson score interval is by Edwin B. Wilson (1927). This script gratefully acknowledges all four. The Whipsaw Shield, the transparent adaptive-factor design, the per-symbol statistical engine, the outcome-settling markers, the trade plan layer, and all code in this script are original work — no third-party or open-source script code was reused.
🔶 LIMITATIONS
Trend-following flips underperform by nature in prolonged ranges; the shield reduces but cannot eliminate that cost, and shielded entries confirm slightly later than raw ones — the margin trades earliness for reliability. Statistics need history to mature and are honest about being thin early. Volume grading is less meaningful on symbols with unreliable volume reporting. No indicator replaces independent analysis.
🔶 DISCLAIMER
This script is provided strictly for educational and informational purposes. It is not financial advice, an investment recommendation, or a solicitation to buy or sell any financial instrument. Past behavior of any flip, statistic, or grade does not guarantee future results. Trading involves substantial risk. Always do your own research and manage risk independently. Indicator

Auto-ATR Volatility Spike & Trend Tracker [BigBeluga]Auto-ATR Volatility Spike & Trend Tracker is an institutional-grade algorithmic trend-following terminal engineered for PulseWire. It is specifically built to isolate high-momentum breakout anomalies (spikes) from ordinary noise and anchor a dynamic, risk-managed trailing stop-loss directly to the underlying structural expansion.
By merging volumetric price momentum with an adaptive Average True Range (ATR) detection framework, this indicator completely redefines how breakout traders enter and manage trends. Instead of reacting blindly to standard moving average crosses, the system utilizes an execution state machine that locks onto systemic market expansion, tracks trend health via dynamic midpoint lines, and protects capital with a trailing protection line.
🔵 CHANNELS & ARCHITECTURAL CORE ENGINE FEATURES
1. Dual-Mode Spike Detection System
Auto ATR Volatility Engine: Automatically adapts to varying market conditions. By cross-referencing incoming candle structures against an ATR Length multiplier baseline, the indicator filters out flat consolidation periods and flags abnormal, high-liquidity volume expansions that signify true institutional participant footprints.
Fixed Percentage Breakout Mode: For traders operating in highly structured assets with predictable daily limits, this module locks onto absolute price change thresholds ( Fixed Spike Threshold % ), isolating momentum moves that pierce predefined parameters.
Wick-to-Body Range Toggle: Allows you to switch calculations to run from either the raw candle body (Open to Close) or the full extreme range ( Calculate From Wicks (High/Low) ). This isolates clean structural closes while adjusting to high-volatility liquidity sweeps.
2. Predictive Mid-Level Benchmarks & Spacing Visuals
Dynamic Mid Level Dash Lines: When a valid trend spike is verified, the engine immediately draws a horizontal midpoint line extending from the center of the candle ( Display Mid Level Dash Line ). This centerline serves as an immediate structural macro floor or ceiling; as long as price retains this boundary, the primary breakout impulse remains historically intact.
Measurement Arrow Guides & Measurement Labels: Automatically draws measurement arrow guides along with real-time text percentage indicators directly over the breakout candle ( Display Size % Labels & Arrow Lines ). This gives you instant clarity on the volatility profile without needing to use manual drawing tools.
3. Algorithmic State Machine & Trailing Protection
Volatility-Adjusted Trailing Stops: Once a breakout trend is established, the indicator deploys a step-calculated trailing line based on your Trailing ATR Multiplier . This line is engineered to trail tightly beneath bullish expansions or above bearish flushes, keeping you safely in the macro trend while mitigating downside variance.
Trend Interlock Protection: The underlying state machine features built-in trigger restrictions that lock execution while a trend is dominant. This prevents counter-trend false entries or premature reversals, keeping your focus strictly on the dominant structural path.
Theme Overwrite Candlesticks: Completely recolors the active layout chart workspace bars using vivid, customized hex-theme presets ( Bullish/Bearish Theme Colors ) the exact moment an abnormal spike is validated.
4. Persistent Macro Statistics Dashboard Matrix
Top-Right Analytics HUD Table: Instantly maps out a high-performance database grid showing critical data points from the most recent historical market expansions.
Real-Time Metrics Monitoring: Explicitly stores and displays the precise directional Spike Type , Size (%) , and exact entry execution Price for both bullish and bearish cycles, providing a reliable quantitative snapshot of the asset's structural strength.
🔵 SYSTEMATIC EXECUTION STRATEGIES & RISK INTERPRETATION
Midpoint Re-test Accumulation Plays: When a powerful up-spike forces a market breakout, do not chase the initial overextended move. Instead, wait for a constructive pullback toward the extended dynamic dashed midline. If price builds a base and prints a clean rejection candle at this level, it signals a premium, low-risk continuation entry aligned with institutional order flow.
Trailing ATR Invalidation Exits: The trailing stop-loss line acts as your absolute trend line invalidation boundary. In a powerful bullish expansion, the indicator will continuously trail and lock in accrued profit beneath the recent low points. A clean daily close crossing beneath this line confirms an official trend termination, signaling an immediate exit to protect your capital.
Breakout Sizing Divergences: Cross-reference the live metrics dashboard data to spot exhausting trends. If an asset is pressing higher but newly generated bullish spikes show smaller percentage sizes compared to the historical records on your HUD table, it exposes fading momentum—frequently warning of an impending reversal or structural distribution phase.
🔵 INTERFACE CONFIGURATION AND PARAMETERS
Detection Mode Controls: Choose between Auto ATR or Fixed % settings and specify lookback periods to customize the indicator to match any asset class, volatility cycle, or execution chart timeframe.
Visibility Filters Overrides: Independently toggle midlines, trailing stops, background cloud color fills, or measurement labels to maintain a clean, distraction-free charting interface.
Theme Personalization Modifiers: Fully adjust color properties for upward spikes, downward spikes, buy/sell arrows, and trailing lines to blend seamlessly into your dark or light workspace layout themes.
Transform your charting workspace from speculative guessing into an automated, volatility-tracked breakout environment with the Auto-ATR Volatility Spike & Trend Tracker terminal. Indicator

Kalman Trailing Stop (KTS)█ OVERVIEW
The Kalman Trailing Stop (KTS) is an advanced, math-driven trend-following system designed to keep you in winning trades longer while dynamically filtering out market noise.
Instead of relying on static moving averages or basic ATR multipliers, KTS utilizes a 2D Kalman Filter combined with Statistical Digital Signal Processing (DSP) and Williams Market Structure. It adapts to volatility and volume in real-time, effectively distinguishing between genuine trend shifts and temporary liquidity sweeps.
█ CORE MECHANICS
1. 2D Kalman Adaptive Trailing Stop
At the heart of the indicator is a robust 2D Kalman filter that tracks both price level and velocity.
Volume-Weighted Variance: The trailing stop becomes highly responsive during high-volume pushes (high trust) and flattens out during low-volume consolidation (low trust), preventing premature stop-outs.
Sigmoid Smoothing & Structural Anchoring: Instead of jagged, abrupt jumps, the stop uses sigmoid transitions to smoothly glide to new structural floors/ceilings derived from recent Intermediate-Term Highs and Lows (ITH/ITL).
Slope Confirmation: The trailing stop will only flip its directional bias if the underlying Kalman baseline slope confirms the reversal, neutralizing fake-outs.
2. Statistical Plunger Logic (Liquidity Sweeps)
Markets frequently sweep liquidity beyond technical levels before reversing. The "Plunger" logic mathematically identifies these traps.
Dynamic Sweep Multiplier: By tracking the kurtosis (fat-tail distribution) of price returns, the script dynamically expands its sweep threshold during periods of wild volatility.
Wick Filtering: It detects deep wicks that pierce the Kalman bands and close strongly back within the bar's range, highlighting statistically validated exhaustion points.
3. Algorithmic Pyramiding & Volatility Warnings
Scale-In Detection: KTS monitors volume footprints to identify safe zones to add to your position. It looks for a sequence of volume "dry-up" during a pullback, followed by a volume-backed breakout past recent market structure.
Livermore Ejector Concept: The indicator flags abnormal, massive range expansions that occur against the prevailing trend, acting as an early warning system for sudden momentum shifts.
4. Built-in Risk & Performance Engine
Dynamic Position Sizing: Automatically calculates raw position and pyramid sizes based on your account equity, risk percentage, and maximum leverage.
Live Performance Dashboard: A built-in HUD tracks both the Global and Recent Profit Factor (PF) of the main trend signals, alongside the real-time distance to your trailing stop.
█ VISUAL GUIDE
Colored Gradient Band: The main Kalman Trailing Stop. Green indicates an active long trend; Red indicates an active short trend.
Large Diamonds (♦️): Main Trend Entries. Triggered when price breaks the Kalman Stop with slope confirmation.
Small Triangles (🔼/🔽): Bullish and Bearish Plunger signals. These indicate deep liquidity sweeps and wick rejections at statistical extremes.
Small Crosses (➕): Algorithmic Pyramid signals. Opportunities to scale into the current trend based on volume dry-ups and structural breakouts.
Yellow X-Crosses (❌): Abnormal Reaction Warnings. Signals a massive volatility spike moving against your active position.
█ SETTINGS
Kalman Trailing Stop Settings
Kalman Responsiveness: Adjusts how quickly the system reacts to price changes (1-100).
Trailing Stop Distance (SD): Sets the baseline width of the trailing stop from the Kalman-smoothed price, measured in standard deviations of the True Range. A higher value (e.g., 3.0) gives the trade more breathing room, while a lower value tightens the stop.
Disclaimer
This script is designed for educational and informational purposes only. Trading involves significant risk. The built-in performance table is an un-optimized raw calculation and should not be used as a guarantee of future system profitability. Indicator

[GYTS-CE] Kinetic Trend Envelope (adaptive trailing stop)Kinetic Trend Envelope (Community Edition)
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- INTRODUCTION --------- 🌸
💮 What is the Kinetic Trend Envelope?
The Kinetic Trend Envelope (KTE) is an adaptive directional trailing stop in the lineage of SuperTrend, rebuilt around the premise that volatility is kinetic energy . It measures per-bar motion with five academically grounded volatility estimators, then widens the envelope as energy rises and contracts it as motion settles.
In an uptrend, the lower band ratchets higher and never retreats; in a downtrend, the upper band ratchets lower. The direction changes when the active stop is breached, after which the opposite side becomes the new trailing stop.
💮 Why Use This Indicator?
Conventional trailing stops typically combine a price anchor with one symmetric ATR-derived width. The KTE extends that model with:
Asymmetric volatility profiling — Bullish- and bearish-candle volatility shape the upper and lower bands independently.
Three direction-switch methods — High/low, close, or a smoothed estimator controls flip sensitivity without moving the band anchor.
Five volatility estimators — ATR plus Parkinson, Garman-Klass, Rogers-Satchell, and Yang-Zhang covers different treatments of gaps, drift, and intrabar range.
The outputs are calibrated to a common width basis, so Volatility Factor remains interpretable across estimators and price scales. Fine adjustment may still be useful, but switching estimators should not require re-tuning by orders of magnitude.
↑ The KTE on a trending instrument. The thick line is the active trailing stop; the thin line shows the opposing side of the envelope. Both expand and contract with market energy.
↑ KTE beside PulseWire's built-in SuperTrend, both using ATR with a 10-bar lookback. KTE's asymmetric profile changes how each side responds to directional volatility while the monotonic active band avoids premature loosening.
🌸 --------- HOW IT WORKS --------- 🌸
💮 Core Concept
The bands share a smoothed price estimator as their anchor, but use separate volatility profiles:
Upper band = estimator + (factor × bullish-candle volatility)
Lower band = estimator − (factor × bearish-candle volatility)
In a bullish state, the lower band is active and can only rise. In a bearish state, the upper band is active and can only fall. This monotonic constraint prevents a live trailing stop from loosening within the trend.
The selected direction-switch method changes only the breach test. It does not change the smoothed estimator anchoring the envelope, so a wick-sensitive trigger cannot drag the bands around with the wick.
💮 The Five Volatility Estimators
Each estimator reads a different part of the OHLC bar:
ATR (Wilder, 1978) — Familiar baseline that handles gaps through true range.
Parkinson (1980) — Uses high-low range; efficient under continuous, low-drift conditions.
Garman-Klass (1980) — Adds open-close information; favours continuous sessions without material gaps.
Rogers-Satchell (1991) — Drift-independent and well suited to trending, continuously traded instruments.
Yang-Zhang (2000) — Combines overnight gaps, open-close movement, and Rogers-Satchell; the gap-aware default.
Statistical efficiency does not guarantee a visibly tighter stop. At slow Adaptation Speed settings, long averaging makes the estimators look similar; at fast settings, their different treatments of gaps, drift, and range become more visible. Choose according to the instrument's behaviour rather than expecting one estimator always to produce the narrowest band.
↑ ATR and Yang-Zhang at Adaptation Speed 2. The long profile memory (low speed) smooths away most of the difference, so the two envelopes nearly overlap.
↑ ATR and Yang-Zhang at Adaptation Speed 8. The short profile memory (high speed) exposes their different volatility readings, producing visibly distinct envelope widths.
💮 Asymmetric Volatility Profiling and Adaptation Speed
The KTE stores volatility from bullish and bearish candles separately. Bullish samples determine the upper width; bearish samples determine the lower width. This allows the two sides to respond differently when upward and downward motion carry different energy.
Adaptation Speed controls the memory of this profile, not the speed of the price estimator and not the distance of the stop by itself. Its 1–10 scale maps logarithmically to an internal window:
Speed 3 — approximately 878 bars: stable and slow to re-weight
Default 3.5 — approximately 570 bars: general-purpose smoothing
Speed 8 — approximately 11 bars: highly responsive to recent volatility
Speed 10 — approximately 2 bars: extremely reactive and noisy
Faster does not necessarily mean closer to price. During a volatility burst, a fast profile recognises the expansion sooner and may widen the band sharply. Because the active stop cannot loosen, it can then remain flat until the estimator catches up. A slow profile dilutes the same burst across much more history, so its narrower band may appear to follow price faster.
This is why two instances matched during a calm period can separate during a shock, especially when they also use different Volatility Factor values. Compare Adaptation Speed with the same factor first; matching lines in one regime does not make two configurations equivalent elsewhere.
The profiles are also direction-conditioned: bullish samples are replaced by later bullish candles and bearish samples by later bearish candles. A recent high-volatility sample can therefore persist through a run of opposite-colour candles, producing deliberate step-like plateaux in the relevant band.
↑ Asymmetric profiling in action: the upper and lower widths respond independently to bullish- and bearish-candle volatility.
💮 Direction Switch Methods
The breach source sets the balance between responsiveness and false flips:
On high/low — Uses the current bar's wick and can switch on the breach bar. Fastest and most sensitive to noise.
On close — Uses the previous confirmed close; the switch appears on the following bar.
On estimator — Uses the previous smoothed estimator; the most conservative default, also switching on the following bar.
↑ The three switch methods share the same band geometry but change direction at different times.
🌸 --------- KEY FEATURES --------- 🌸
💮 Eight Estimator Filters
The configurable price anchor includes:
Ultimate Smoother, 2- or 3-pole — Low-noise, near-zero-lag passband response; the 2-pole version is the default.
Super Smoother, 2- or 3-pole — Ehlers low-pass filters for progressively stronger smoothing.
BiQuad — Second-order low-pass filter with an adjustable Q-factor.
ADXvma — Adapts to trend strength and tends to flatten in ranges.
MAMA — Cycle-adaptive MESA moving average.
A2RMA — Adaptive recursive moving average with adjustable gamma.
They are provided by the open-source FiltersToolkit library.
💮 Visual Layering
The display separates function from context:
Active band — Thick directional trailing-stop line
Opposing band — Thin reference for the inactive side
Channel fill — Visual separation between the estimator and each band
Estimator — Optional smoothed anchor
Palette, light/dark mode, widths, and transparencies can be adjusted independently.
🌸 --------- USAGE GUIDE --------- 🌸
💮 Getting Started
Start with the defaults, observe several calm and volatile regimes, and change one dimension at a time:
Tune Volatility Factor for the preferred stop distance.
Tune Adaptation Speed for how quickly width should respond to regime changes.
Choose the direction-switch method for the preferred confirmation level.
Change the volatility estimator only when its assumptions better fit the instrument.
💮 Choosing a Volatility Estimator
Gapped equities — Yang-Zhang accounts for overnight movement.
Trending 24/7 markets — Rogers-Satchell is drift-independent without a separate gap component.
Continuous, range-led markets — Parkinson or Garman-Klass offers efficient range-based measurement under their assumptions.
Familiar baseline — ATR provides conventional true-range behaviour.
On continuous instruments, Rogers-Satchell and Yang-Zhang may look very similar because there are few gaps to distinguish them. Use the Volatility Toolkit to compare their raw behaviour on the intended instrument.
↑ Three estimators compared on one instrument, each reading a different combination of OHLC information.
💮 Tuning Width and Responsiveness
These controls solve different problems:
Volatility Factor — Sets the distance per unit of measured volatility.
Adaptation Speed — Sets the memory of the bullish/bearish profile; faster can widen the stop sooner during shocks.
Volatility Lookback — Sets how quickly the underlying per-bar volatility estimate changes.
Estimator Lookback — Sets the smoothness of the price anchor.
Use symptoms to guide adjustment:
Frequent flips on minor pullbacks — Increase Volatility Factor or use a more conservative switch method (e.g. "on estimator").
Excessive give-back — Decrease Volatility Factor or use a more responsive switch method (e.g. "on high/low").
Width reacts too slowly to regime changes — Increase Adaptation Speed or reduce Volatility Lookback.
Bands become erratic during shocks — Reduce Adaptation Speed or increase Volatility Lookback.
↑ A tight factor follows price more closely and flips more often; a loose factor tolerates larger pullbacks.
💮 Trading Applications
Discretionary trailing stop — Move a protective stop with the active band as it tightens.
Trend confirmation — Accept long signals only during a bullish KTE state, and short signals only while bearish.
Exit timing — Treat a direction change as an exit when the trade thesis is trend-following.
💮 Integration with GYTS Suite
The visible bands and estimator can be selected as sources by compatible Pine scripts. Two packed streams are also exposed:
🔗 STREAM KTE 🪜 Trailing Stoploss — Positive lower-band value in a bullish state; negative upper-band value in a bearish state.
🔗 STREAM KTE 🪜 Mechanism — Encodes the switch method and scale-invariant estimator relationship for compatible consumers.
The KTE is, first and foremost, a trailing stop, and these streams are built for stop management. The Order Orchestrator strategy consumes the Trailing Stoploss and Mechanism streams together : the first supplies the active stop level and its direction, the second makes the strategy's trailing-exit runner follow whatever switch method and estimator you set here. So the stop is configured once, in the KTE.
Beyond that primary role, the signed trailing-stop stream can also serve as a trend signal, since its sign flips with direction: it can be read through sign and magnitude as an entry/exit signal, including by Flux Composer . The KTE can also be paired with Market Regime Detector so flips are acted on only when the broader regime supports trend-following behaviour.
🌸 --------- LIMITATIONS --------- 🌸
Trailing-stop latency — Every trailing stop gives back some of the move between the trend extreme and the eventual breach.
Whipsaws in ranges — Low-energy chop can produce repeated flips; a regime filter may help when ranging conditions dominate.
Fast adaptation can widen the stop — Higher Adaptation Speed means faster volatility response, not guaranteed proximity to price.
Direction-conditioned memory — A bullish or bearish outlier remains in its own profile until enough matching-direction samples replace it, which can create plateaux after shocks.
Warm-up and sample size — Long profile windows need sufficient chart history; strongly one-sided markets may leave one side with few recent samples.
🌸 --------- CREDITS --------- 🌸
💮 Academic Sources
Wilder, J. W. (1978). New Concepts in Technical Trading Systems . Trend Research.
Parkinson, M. (1980). The Extreme Value Method for Estimating the Variance of the Rate of Return. Journal of Business, 53 (1), 61–65. DOI
Garman, M. B., & Klass, M. J. (1980). On the Estimation of Security Price Volatilities from Historical Data. Journal of Business, 53 (1), 67–78. DOI
Rogers, L. C. G., & Satchell, S. E. (1991). Estimating Variance from High, Low and Closing Prices. Annals of Applied Probability, 1 (4), 504–512. DOI
Yang, D., & Zhang, Q. (2000). Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices. Journal of Business, 73 (3), 477–491. DOI
Ehlers, J. F. (2024). The Ultimate Smoother. Technical Analysis of Stocks & Commodities , 2024-04. TASC
Ehlers, J. F. (2004). Cybernetic Analysis for Stocks and Futures . Wiley. Covers SuperSmoother, MAMA and more.
💮 Inspiration
Thanks to Trendoscope for inspiring us with the Supertrend - Ladder ATR (2021). It derives long-side stop distance from bearish-candle ATR and short-side distance from bullish-candle ATR, which is one of the mechanisms that we tried to develop further with the KTE.
💮 Libraries Used
FiltersToolkit — Ultimate Smoother, Super Smoother, BiQuad, ADXvma, MAMA, and A2RMA
VolatilityToolkit — Parkinson, Garman-Klass, Rogers-Satchell, and Yang-Zhang estimators
MathTransform — Logarithmic scaling for Adaptation Speed
ColourUtilities — Palette management and light/dark-mode colour adjustment
Indicator

Indicator

Swing Ladder Trend Engine [Jayadev Rana]OVERVIEW
Swing Ladder Trend Engine is a pure price-action trend-following tool. It builds its entire read of the market from confirmed swing highs and swing lows — no moving averages, no ATR, no oscillators. From that swing structure it derives three things: the current trend state, entry and exit signals, and a structure-anchored trailing stop (the "ladder") that only steps in the direction of the trade.
HOW IT WORKS
1. Swing structure. Confirmed pivot highs and lows (Swing Detection Length bars on each side) are classified as HH, HL, LH or LL and tagged on the chart.
2. Trend engine. When a bar closes beyond the most recent confirmed swing high, the trend state flips bullish; a close below the last confirmed swing low flips it bearish. Each swing level can only be broken once, so continuation breaks are tracked cleanly and bars are tinted by the active trend.
3. Ladder stop. Instead of a volatility trail, the stop is anchored to structure itself: in an uptrend it sits below the last confirmed swing low, offset by a configurable percentage of the current swing range, and it can only ratchet upward as new higher lows confirm. The result is a stepped "ladder" that gives the trade room where structure says it needs room, and tightens where structure tightens.
4. Pullback-quality entries. In the default Pullback mode a structure break only arms a setup. The entry itself requires the market to retrace into the breakout leg (between the Min and Max Retracement %), and then print a resumption candle: a close beyond the previous bar's extreme with a directional body of at least the Trigger Body Dominance fraction of its range. Retracements deeper than the maximum void the setup. A Breakout mode is included for traders who prefer to enter on the structure break itself.
SIGNALS: ENTRY, EXIT AND STOP
LONG / SHORT labels mark entries; the label tooltip stores the entry price and the ladder stop at that moment. A trade is closed either when price closes through the ladder stop or when the structure flips against it — the ✕ exit label's tooltip reports the reason and the approximate result in R (risk multiples, measured from entry to the initial ladder stop). All signals are evaluated on confirmed bars only.
DASHBOARD AND ALERTS
A compact dashboard shows the live trend state, the latest swing structure tags, the active signal, the current ladder stop level and the open trade's running R. Six alerts are available: long entry, short entry, exit long, exit short, and bullish/bearish trend flips.
SETTINGS
Swing Detection Length controls the size of the structure being tracked (larger = bigger swings, later confirmation). Entry Mode switches between Pullback and Breakout logic. Min/Max Retracement % and Trigger Body Dominance define what counts as a quality pullback entry. Stop Buffer sets how far beyond the protected swing the ladder sits, as a % of the current swing range. Dashboard position/size, structure labels, bar coloring and colors are all configurable.
LIMITATIONS
Swing points confirm only after the chosen number of right-side bars, so structure tags appear with a delay by design — this is what keeps the logic non-repainting on confirmed bars. Signals fire on bar close, not intrabar. Like any trend-following method, it gives back ground in choppy, range-bound conditions; the pullback filters reduce but do not remove that. R values shown in tooltips and the dashboard are approximations based on closing prices and do not account for gaps, fees or slippage. This is an analysis tool, not financial advice — always test settings on your own market and timeframe before relying on them.
WHY IT IS ORIGINAL
The combination of a swing-anchored ratcheting stop whose buffer adapts to the current swing range, plus an entry gate built from retracement depth and candle body dominance — all derived exclusively from raw price structure — is what this script contributes. It is not a mashup of built-in indicators; every state in the engine comes from the swing ladder itself. Indicator

Donchian Breakout with ATR Trailing Stop (Trend Following)A simple, transparent trend-following strategy: a classic Donchian
(turtle) channel breakout with a single ATR-based trailing stop.
It was deliberately built to be robust across markets rather than
curve-fit to one — the same code and settings held up on both an
equity index (DAX/GER40, 1h) and Bitcoin (BTCUSD, 4h), and across
trailing multipliers of 2.5–3.5.
HOW IT WORKS
- Entry: goes long when price closes above the highest high of the
last N bars (default 20) while above the 200 EMA trend filter.
Short side is optional and off by default.
- Exit: one ATR-based trailing stop (distance = ATR × multiplier,
default 2.5, fixed at entry). It serves as both the initial
protective stop and the trailing exit — cutting losses and letting
winners run, fully automatically. No separate exit signal needed.
- Risk: size is derived from a fixed % risk per trade against the
stop distance (compounding), with optional risk and leverage caps.
- Optional weekend-flat close for instruments with gap risk.
HOW TO USE
- Best on genuinely trending markets. Try it on your own instrument
and timeframe.
- Tune the risk % to your own drawdown tolerance, and the ATR
multiplier to taste (2.5–3.5 behaved similarly — a good sign the
edge isn't fitted to one value).
- Built-in alerts: the entry alert gives you the trailing-stop
distance to set on your broker; the trailing stop handles the exit.
WHAT TO EXPECT — READ THIS
- It's a breakout system, so win rate is LOW: ~40–45% is normal.
The edge is that winners are bigger than losers, not that you're
right often. Judge it by profit factor and drawdown, not win rate.
- Expect long flat/drawdown periods in choppy, range-bound markets.
It performs when markets trend.
- COSTS DECIDE EVERYTHING. Set your own broker's spread/commission
in the properties before trusting any result. Something that looks
great at zero cost can be break-even or worse once real spreads —
and, for leveraged CFDs, overnight financing — are included.
Results vary a lot by broker and instrument.
NOTES
- No repainting: entries use the prior bar's channel; the trailing
stop only ratchets in the trade's favor.
- Not financial advice. Past backtest results do not guarantee
future performance. Always test on your own market, timeframe and
broker costs, and only risk what you can afford to lose. Strategy

Volatility Trail [BOSWaves]Volatility Trail - Hull-Anchored ATR Trail with Gradient Cloud Radiation and Multi-Mode Candle Scoring
Overview
Volatility Trail is a Hull-anchored trend trailing system that constructs an ATR-scaled ratcheting trail from a Hull Moving Average baseline, where trend state, gradient cloud geometry, and candle coloring intensity are driven by the relationship between price and the adaptive trail rather than by fixed thresholds or static band crossovers.
Instead of relying on conventional moving average crossovers or symmetric bands, trend state is determined by a one-directional ratcheting trail that advances in the trend direction and locks in progress, only flipping when price closes through the trail level in the opposing direction. The trail distance from the Hull baseline scales with ATR, ensuring the ratchet respects current volatility conditions rather than applying a fixed distance regardless of market behavior.
This creates a trailing trend framework that combines a responsive Hull baseline with a volatility-calibrated ratchet mechanism, a radiating four-layer gradient cloud that visually maps the space between trail and price, and a configurable candle coloring system that scores each bar by distance from the trail, trail acceleration, or both, producing a chart where candle brightness communicates conviction intensity rather than merely indicating direction.
Price is therefore evaluated not just for its position relative to the trail but for how far it has extended from it and how fast the trail itself is advancing, providing a multi-dimensional conviction reading through the visual layers of the indicator.
Conceptual Framework
Volatility Trail is founded on the principle that a trailing trend system should do three things simultaneously: define trend state through a ratcheting mechanism that locks in directional progress, communicate the spatial relationship between price and the trail through a graduated visual field, and score candle conviction based on measurable characteristics of that relationship rather than applying uniform coloring regardless of momentum state.
Traditional trailing indicators provide a line that defines trend direction but offer no framework for understanding how convincingly price is separated from that line or whether the trail itself is accelerating. This framework adds those dimensions through the gradient cloud and candle scoring systems, transforming a single trail line into a complete visual conviction map that reveals both where price is relative to the trail and the dynamic quality of the separation between them.
Three core principles guide the design:
The trail should ratchet in the trend direction using ATR-scaled distance from a Hull baseline, locking in progress and only reversing when price demonstrates a genuine closing breach rather than a temporary excursion.
The space between the trail and price should be visualized as a graduated gradient field with multiple opacity layers that radiates from the trail toward price, communicating proximity and separation depth visually rather than numerically.
Candle coloring should reflect measurable conviction characteristics through configurable scoring modes, dimming bars with weak conviction and brightening bars with strong distance or acceleration readings to encode momentum quality into the candlestick display.
This shifts trailing trend analysis from single-line direction tracking into a multi-layer conviction visualization where the trail, cloud, and candles collectively communicate trend state, spatial conviction, and momentum quality simultaneously.
Theoretical Foundation
The indicator combines Hull Moving Average baseline construction, ATR-scaled ratcheting trail mechanics, four-layer gradient cloud construction using proportional gap interpolation, and a dual-mode candle scoring system based on distance normalization and trail acceleration measurement.
The Hull Moving Average provides a low-lag directional baseline that reduces the smoothing delay of standard moving averages while maintaining noise resistance. The trail ratchets by advancing the lower band as a minimum during uptrends and the upper band as a maximum during downtrends, preventing the trail from retreating against price and locking in each bar's progress. The gradient cloud divides the gap between trail and price into four proportionally spaced bands at 20, 40, 65, and 85 percent of the total gap, filling each interval with progressively increasing transparency to create a radiating visual field. Candle scoring normalizes either distance from trail or trail advancement speed against ATR, applies a power transformation to suppress weak readings, and maps the result to a gradient between a neutral dim color and the full trend color.
Four internal systems operate in tandem:
Hull ATR Trail Engine : Calculates the Hull MA baseline and derives upper and lower ATR-scaled bands, maintaining a ratcheting trail that advances with the trend and flips to the opposing band only when price closes through the current trail level.
Gradient Cloud System : Computes four proportional interpolation points between the smoothed trail and price, plots invisible bands at each point, and fills the intervals with opacity-graduated fills that intensify near the trail and fade toward price, producing a radiating cloud effect.
Candle Scoring Engine : Measures distance from trail normalized by ATR and trail advancement speed normalized by ATR fraction, applies a power exponent to crush weak scores, and maps the resulting score to a gradient from a dim neutral color to the full trend color through configurable distance, acceleration, or combined scoring modes.
Retest Detection System : Monitors price proximity to the trail after the signal buffer period, triggering retest diamonds when price approaches within an ATR-fraction zone of the trail without crossing it, with per-side cooldown enforcement between consecutive signals.
This design allows the trail to provide clean directional state through ratcheting mechanics while the cloud and candle systems layer spatial and momentum conviction context onto the same chart space.
How It Works
Volatility Trail evaluates price through a sequence of trail-aware and conviction-scoring processes:
Source Selection : The price source used for Hull calculation and trail comparison is selected from Close, HL2, HLC3, or OHLC4, allowing the baseline to be anchored to the most appropriate price representation for the target instrument.
Hull Baseline Calculation : The Hull Moving Average is calculated over the configured length from the selected source, providing a low-lag directional reference that minimises the lag penalty of standard moving averages.
ATR Band Derivation : Upper and lower bands are calculated by adding and subtracting ATR multiplied by the configured factor from the Hull baseline, producing volatility-scaled boundaries that adapt to changing market conditions.
Trail Ratcheting : During an uptrend the trail advances as the maximum of the lower band and the prior trail, preventing retreat against price. During a downtrend it advances as the minimum of the upper band and the prior trail. When price closes through the current trail the trend flips and the trail resets to the opposing band.
Trail Display Smoothing : An EMA smoothing pass over the configurable length is applied to the trail for display purposes, producing a visually cleaner line while signals continue to fire from the raw unsmoothed trail.
Gradient Cloud Construction : The gap between the smoothed trail and close is calculated and four interpolation points are derived at proportional fractions of that gap. Each interval between adjacent points is filled with a directional color at progressively increasing transparency, producing a graduated cloud that radiates from the trail outward toward price.
Distance Scoring : The absolute distance between close and the smoothed trail is divided by three times ATR to produce a normalized 0-1 distance score, measuring how far price has extended from the trail relative to recent volatility.
Acceleration Scoring : Trail advancement speed is measured as the absolute change in trail position over the acceleration lookback, normalized by a fraction of ATR, producing a 0-1 score reflecting how quickly the trail is currently advancing.
Score Combination and Power Transform : Depending on the selected candle mode, the distance score, acceleration score, or their maximum is selected, then raised to the power of 2.5 to suppress low-conviction readings and concentrate brightness at genuinely strong bars.
Candle Color Mapping : The transformed score maps from a fixed dim neutral color at zero to the full trend color at one, producing candles that are nearly invisible during low-conviction conditions and fully saturated during strong extension or acceleration events.
Retest Diamond Detection : After the signal buffer period from the most recent flip, price approaching within a fraction of ATR of the trail without crossing it triggers a directional retest diamond, with per-side cooldown enforced between consecutive signals.
Together, these elements form a continuously updating trail system where ratcheting mechanics define direction, gradient cloud layers map spatial conviction, and candle scoring communicates momentum quality across every bar of the trend.
Interpretation
Volatility Trail should be interpreted as a ratcheting trend system with radiating conviction geometry and multi-mode candle intensity scoring:
Bullish Trend State (Green) : Active when the trail has ratcheted below price and price has not closed below it, with the gradient cloud radiating upward from the trail toward the current bar.
Bearish Trend State (Red) : Active when the trail has ratcheted above price and price has not closed above it, with the gradient cloud radiating downward from the trail toward the current bar.
Trail Line : The smoothed ratcheting trail provides the primary directional boundary, advancing with the trend and serving as the structural invalidation level for the current directional state.
Gradient Cloud : Four fills between the trail and price create a radiating opacity field that intensifies near the trail and fades toward price, visually encoding the spatial relationship between the ratchet boundary and current price action. A thick, prominent cloud indicates substantial separation, while a thin cloud suggests price is close to the trail and near potential retest territory.
Distance Mode Candles : Candle brightness reflects how far price has extended from the trail relative to ATR. Bright candles indicate substantial separation, dim candles indicate proximity to the trail.
Acceleration Mode Candles : Candle brightness reflects how fast the trail itself is advancing. Bright candles indicate the trail is moving quickly with the trend, dim candles indicate the trail is stalling.
Both Mode Candles : Candle brightness reflects the maximum of distance and acceleration scores, brightening when either strong extension or strong trail advancement is present.
▲ Buy Signals : Green triangles mark upward trail flips where trend has switched from bearish to bullish and the trail has reset to the lower ATR band.
▼ Sell Signals : Red triangles mark downward trail flips where trend has switched from bullish to bearish and the trail has reset to the upper ATR band.
◆ Retest Diamonds : Small diamonds plotted below bars during bullish retests and above bars during bearish retests when price approaches within the retest zone of the trail after the signal buffer period, identifying potential continuation interaction points with the trailing boundary.
Trail position, cloud depth, candle brightness, and retest diamond placement collectively provide more conviction information than trend direction alone.
Signal Logic & Visual Cues
Volatility Trail presents two primary trail flip signals alongside continuous retest zone monitoring:
Buy Signal (▲) : Green triangle appears when the trail ratchet flips from bearish to bullish, indicating price has closed above the upper ATR band and the trail has reset to the lower band to begin a new bullish ratchet cycle.
Sell Signal (▼) : Red triangle appears when the trail ratchet flips from bullish to bearish, indicating price has closed below the lower ATR band and the trail has reset to the upper band to begin a new bearish ratchet cycle.
Retest diamond detection provides continuous secondary monitoring, marking proximity to the trail after the signal buffer period with independent per-side cooldown enforcement, identifying potential continuation setups at the ratchet boundary throughout the established trend.
Alert generation covers bullish and bearish trail flips and both bullish and bearish retest events for systematic trend monitoring workflows.
Strategy Integration
Volatility Trail fits within volatility-adaptive trailing and momentum conviction approaches:
Trail Flip Entries : Use trail flip signals as primary trend initiation triggers where price has closed through the ATR-scaled boundary and the ratchet has reset in the new direction, with the newly positioned trail providing an immediate structural invalidation reference.
Candle Mode Selection for Instrument Type : Use Distance mode on instruments where price extension from the trail is the primary conviction indicator, Acceleration mode on instruments where trail advancement speed is more consistent, and Both mode for instruments where either characteristic can signal high conviction depending on market phase.
Cloud Depth Assessment : Use gradient cloud depth as a real-time spatial conviction reading. A deep cloud with multiple visible layers indicates substantial separation and trend momentum. A thin cloud with minimal fill depth indicates price is compressing toward the trail and a retest is increasingly probable.
Retest Diamond Re-entry : Use retest diamonds as lower-risk continuation entry references within established trends, entering in the trend direction when price approaches the trail boundary after the signal buffer period rather than chasing extended price action far from the trail.
ATR Factor Calibration : Adjust the ATR factor to match the instrument's typical volatility behavior at the target timeframe, using higher factors for instruments requiring more room between price and trail and lower factors for tighter ratchet tracking.
Multi-Timeframe Trail Alignment : Apply higher-timeframe trail direction as a bias filter, engaging with lower-timeframe flip signals and retest diamonds only when they align with the established higher-timeframe ratchet direction.
Technical Implementation Details
Core Engine : Hull Moving Average baseline with configurable source and ATR-scaled ratcheting trail mechanics
Trail Logic : One-directional ratchet advancing as band maximum or minimum in respective trend directions with flip on close breach
Gradient Cloud : Four proportional gap interpolation points with interval fills at graduated transparency levels radiating from trail toward price
Candle Scoring : ATR-normalized distance and acceleration scoring with power transform and gradient mapping to dim-to-trend-color range
Retest System : ATR-fraction proximity zone detection with signal buffer and independent per-side cooldown enforcement
Visualization : Smoothed trail line, four-layer gradient cloud fills, flip signal labels, retest diamond markers, and multi-mode intensity-scored candle coloring
Signal Logic : Raw trail flip detection with smoothing applied to display only, preserving signal timing accuracy
Performance Profile : Optimized for real-time execution across all timeframes with stateful trail variable maintaining ratchet progress between bars
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday trail tracking for scalping with shorter Hull length and tighter ATR factor for fast ratchet response to intraday momentum shifts
15 - 60 min : Session-level trend identification with balanced Hull length and moderate ATR factor for reliable directional framing across typical session moves
4H - Daily : Swing-level trailing with longer Hull length and higher ATR factor for sustained ratchet persistence across multi-session directional moves
Suggested Baseline Configuration:
Hull Length : 72
ATR Length : 9
ATR Factor : 1.7
Source : Close
Trail Smoothing : 4
Show Gradient Cloud : Enabled
Color Candles : Enabled
Candle Color Mode : Distance
Show Buy/Sell : Enabled
Retest Diamonds : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's volatility characteristics, Hull responsiveness at the target timeframe, and preferred signal frequency, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Trail flips too frequently : Increase ATR Factor to widen the distance between the Hull baseline and the trail boundary, requiring more significant price displacement before a flip is registered.
Trail flips too slowly : Decrease ATR Factor toward 0.5 for a tighter trail that responds faster to directional changes, or decrease Hull Length for a more reactive baseline.
Hull baseline too laggy : Decrease Hull Length toward 20 for a faster baseline that captures directional shifts earlier, accepting increased sensitivity to short-term price fluctuations.
Hull baseline too reactive : Increase Hull Length for a smoother baseline that filters minor oscillations and produces a more stable trail ratchet with fewer noise-driven flips.
Candles too uniformly dim : Switch to Acceleration mode if the instrument's trail advancement speed is more variable than its price extension, or reduce ATR Factor so distance scores normalize against a tighter trail range.
Too many retest diamonds : Increase Retest Cooldown to enforce greater bar separation between consecutive diamond markers, or increase Signal Buffer to delay retest detection further from each flip event.
Retest diamonds not firing : The retest zone is sized as a fraction of ATR multiplied by the ATR Factor. On instruments with very consistent trail distance this zone may be narrow. Increasing ATR Factor slightly widens the retest detection zone relative to the trail boundary.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with sustained directional moves where the Hull baseline advances consistently and the trail ratchets without frequent resets, producing deep gradient clouds and bright high-conviction candles throughout the move
Instruments with consistent ATR behavior where the volatility-scaled trail distance produces reliable flip signals without excessive noise-driven reversals
Momentum continuation strategies that benefit from the retest diamond system identifying pullback interactions with the trail boundary as lower-risk continuation entry points
Multi-mode candle scoring approaches where distance or acceleration scoring provides additional conviction context that supplements the directional trail signal
Reduced Effectiveness:
Choppy, low-momentum markets where price oscillates near the Hull baseline, causing frequent trail flips and preventing the ratchet from establishing meaningful directional progress
Extremely volatile instruments where ATR spikes produce wide trail distances that delay flip detection relative to the actual structural change in price direction
Consolidation environments where the Hull baseline moves sideways and the trail ratchet stalls, producing minimal cloud depth and uniformly dim candles without directional conviction scoring
News-driven or gap-heavy markets where instantaneous price displacements trigger trail flips that immediately reverse before the ratchet can establish sustained directional progress
Mean-reversion dominant conditions where trail flips occur rapidly in alternating directions without the sustained follow-through required for gradient cloud development or sequential retest patterns
Integration Guidelines
Confluence : Combine with BOSWaves structural tools, order flow analysis, or momentum oscillators to validate trail flip signals with broader analytical context before committing to directional positions
Cloud Depth Monitoring : Track gradient cloud depth evolution throughout the trend as a spatial conviction indicator. Progressively deepening cloud layers suggest sustained separation and trend health while thinning cloud depth warns of price compression toward the trail and potential retest or flip conditions.
Candle Mode Selection : Match the candle scoring mode to the instrument's typical conviction expression. Instruments that show conviction through large extension moves favor Distance mode; instruments that show conviction through accelerating trail advancement favor Acceleration mode; instruments that express conviction through either mechanism favor Both mode.
Ratchet Progress Awareness : Recognize that the trail only advances and never retreats against price within a trend. Rapid trail advancement reflected in bright Acceleration mode candles indicates strong directional follow-through, while a stalling trail with minimal advancement suggests momentum is flattening before potential reversal.
State Discipline : Maintain directional bias aligned with the current trail trend state until a confirmed closing breach of the trail triggers a flip. Retest diamonds and cloud thinning within an established trend represent continuation context rather than reversal signals and should not override the ratchet-defined directional state.
Disclaimer
Volatility Trail is a professional-grade Hull-anchored trend trailing and conviction visualization tool. It uses ATR-scaled ratcheting trail mechanics with gradient cloud construction and multi-mode candle scoring but does not predict future price movements. Results depend on market conditions, instrument volatility characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates order flow context, structural analysis, and comprehensive risk management. Indicator

Calibrated Supertrend Strength-Graded & Multi-Timeframe## Calibrated Supertrend — Confirmed, Strength-Graded & Multi-Timeframe (ST ARC)
### What it is
A Supertrend rebuilt to fix the three things that frustrate everyone who uses the
plain version, and to tell you **how trustworthy each trend flip is** before you act
on it. A classic Supertrend uses a **fixed ATR multiplier** (an arbitrary guess that
whipsaws in volatile markets and lags in calm ones), it **flips on noise** (every
marginal poke through the band reverses it), and it gives you **no sense of quality**
(a great flip and a junk flip look identical). ST ARC addresses all three, then
scores every flip 0–100 and — crucially — **calibrates that score to what actually
happened on this symbol**, so the number is accountable rather than decorative.
It runs on **any symbol, asset class, timeframe and market**. The raw data source
and every optional feed are user-selectable; nothing is hard-coded to a market.
### Why these components are combined (mashup rationale)
Each layer removes one specific, nameable failure of the plain Supertrend and feeds
the next — none is decorative:
1. **Adaptive multiplier** — the band width is no longer fixed. The ATR multiplier
becomes a series that scales with a **volatility rank** (how high current ATR
sits versus its own recent history): wider when volatility is high to cut
whipsaw, tighter when calm, and wider still when trend **efficiency** is low
(choppy tape). The ATR *length* can also adapt to the measured dominant cycle.
2. **Confirmation gate (de-whipsaw)** — a raw flip is only **confirmed** when the
close breaches the prior band by a minimum fraction of ATR *and* a minimum number
of bars have passed since the last flip, evaluated on closed bars
(non-repainting). This fixes the "flips on noise" problem.
3. **Regime classifier** — efficiency ratio + trend strength + a volatility-cluster
measure label the market Trend / Range / Volatile, so flips are trusted or
discounted by context.
4. **Multi-timeframe agreement** — three higher-timeframe Supertrends (multiples of
your chart timeframe) are read with no repainting and counted for agreement; a
signal that all higher timeframes oppose can be vetoed.
5. **Flip-strength score + conviction with hard vetoes** — at each flip a 0–100
strength is built from breach depth, trend strength, efficiency, MTF agreement,
regime alignment, volume thrust and volume delta, then gated by hard vetoes
(volatility spike, higher timeframes opposed, a fresh flip inside a chop regime,
cross-asset conflict). The output is one verdict plus a strength grade.
Remove any single layer and a specific Supertrend failure returns — that is the
justification for combining them.
### How it is original
ST ARC keeps a **self-calibrating quality engine**. It records every confirmed flip
and, a fixed window later, checks whether price actually ran a **favourable target
(measured in ATR)** in the flip's direction — i.e. whether the trade *worked*, not
merely whether the line avoided re-flipping. From that it reports, on the dashboard
and on each flip label, the **realized win-rate of past flips at each strength tier**
on this very symbol, plus the average favourable excursion. It can even **auto-learn
the strength threshold** at which flips have historically met a target win-rate and
use that as the action filter. A stock Supertrend tells you nothing about the quality
of its own signals; this one is accountable to its own track record.
### What it plots
- A single **Supertrend line** on price, green up / red down, with the flip triangle
**colour-graded by strength** (strong = solid, weak = faded) and a small
**strength label** on each flip (score + grade).
- An optional **second, slower Supertrend** (thinner line, contrasting colour,
diamond markers) for fast/slow confluence, with a DUAL agreement readout.
- A compact **dashboard**: verdict, regime, direction, the live adaptive multiplier
and ATR length, the flip state with its strength and that tier's realized
win-rate, MTF agreement, the calibration stat, dominant cycle, a risk-based size
reference and any active veto.
### How to use it
1. Trade with the line: long bias while it is below price (green), short while above
(red). The line is a natural trailing stop.
2. Act on **confirmed flips** (the triangles), not raw touches, and weight them by
the **strength score** — strong flips in a Trend regime with higher-timeframe
agreement are the high-quality ones; weak flips in a chop regime are the ones to
skip.
3. Use the **conviction / strength gates** and any active **veto** as a filter; the
optional **auto-learned strength cutoff** suppresses the verdict on flips weaker
than the level that has historically met your target win-rate.
4. The size shown is an ATR-based reference for journaling, not an order.
5. Alerts cover confirmed flips, the conviction verdict, raw flips and the secondary
Supertrend.
### Settings (use on any asset / market)
- **Raw data source** — `hl2`, `hlc3`, `close`, `ohlc4`, or point it at **another
indicator's plot**. This is what lets it work on any instrument or on your own
series.
- **Supertrend core** — ATR length (with optional dominant-cycle adaptive length)
and base multiplier.
- **Adaptive multiplier** — volatility-rank lookback, calm/volatile scaling and an
optional chop-widening term.
- **Confirmation** — minimum breach in ATR, minimum bars between flips, non-repaint
on close.
- **Calibration** — the judging window and the favourable target (in ATR) that
defines a "good" flip; the auto-learn cutoff and its target win-rate.
- **Regime / MTF / conviction weights / secondary Supertrend** — all exposed.
- **Optional feeds (blank = off):** a *volatility-index symbol* (spike veto) and a
*cross-asset symbol* (confluence). Both blank by default, so the script is fully
self-contained on any market.
### Notes
- It is a **study / indicator**, not a strategy, and it places no orders.
- Confirmed flips are evaluated on bar close to avoid intrabar repainting;
higher-timeframe reads use confirmed values.
---
### Disclaimer
This script is provided for educational and informational purposes only. It is a
technical-analysis study, not financial, investment, or trading advice, and not a
recommendation or solicitation to buy or sell any instrument. No indicator can
predict markets; past behaviour and any historical statistics shown (including the
flip win-rates) do not guarantee future results. Trading involves substantial risk of
loss. You are solely responsible for your own decisions — do your own research and
consider consulting a licensed financial professional before trading. The author
accepts no liability for any loss arising from use of this script.
Indicator

Trend Volatility RegimeThe Trend Volatility Regime is an all-in-one trend-following model that identifies changes in the market regime by combining moving-average crossover signals with volatility-adaptive trailing stops. It features an integrated backtesting engine that provides institutional-grade insights into historical strategy performance, along with a built-in alert system that notifies investors in real time when regime changes occur. The model integrates seamlessly into the price chart and presents backtest results in a clear, color-coded table benchmarked against buy-and-hold.
At its core, the model combines two complementary trend detection components to determine the prevailing market regime. The first component identifies the underlying structural trend using a volatility-adjusted moving-average crossover based on the spread between fast and slow moving averages. The second component identifies trend reversals using an adaptive trailing stop based on changes in price and volatility. Bullish and bearish regimes occur when both crossover and volatility signals are directionally aligned, while conflicting signals result in neutral regimes.
Bullish Crossover Signal = (Fast MA – Slow MA) > (ATR × Trend Margin)
Bearish Crossover Signal = (Fast MA – Slow MA) < –(ATR × Trend Margin)
Bullish Volatility Signal = Price > (Highest Price – (Volatility × Stop Factor))
Bearish Volatility Signal = Price < (Lowest Price + (Volatility × Stop Factor))
By default, the model applies an asymmetric regime design in which conflicting signals default to a bullish regime unless half-equity positions are enabled in the menu. This asymmetric design reflects the tendency of risk assets to deteriorate gradually while recovering more abruptly. The moving-average component captures the slower deterioration typically observed during market tops, while the trailing stop component responds more dynamically to faster reversals typically observed at market bottoms. This helps reduce overreaction to corrections during uptrends while still allowing for faster re-entry following sharp recoveries. To evaluate the performance of different parameter configurations, the model includes a built-in table with the following metrics:
CAGR = Compounded Annual Growth Rate.
Excess = CAGR in excess of buy-and-hold.
Sharpe = CAGR per unit of standard deviation.
Sortino = CAGR per unit of downside deviation.
Calmar = CAGR relative to maximum drawdown.
Max DD = Largest peak-to-trough decline in value.
Alpha (α) = Excess annualized risk-adjusted returns.
Win Rate = Ratio of profitable trades to total trades.
Profit Factor = Total gross profit per unit of losses.
Expectancy = Average expected return per trade.
Turnover = Average annualized change in exposure.
This indicator is designed with flexibility in mind, enabling users to specify the start date of the backtesting period, the preferred trend type, volatility type, and regime visualization. Supported regime visualizations include line, candle, and shaded background. Supported moving-average types include the Exponential Moving Average (EMA), Simple Moving Average (SMA), Wilder’s Moving Average (RMA), and Weighted Moving Average (WMA). Supported volatility types include the Average True Range (ATR), Standard Deviation (SD), and Mean Absolute Deviation (MAD). Supported price sources include Close, HL2, HLC3, and OHLC4. The table follows an intuitive color-coded logic that allows for quick performance comparison against buy-and-hold (B&H):
CAGR = Green indicates above 0%, while red indicates below 0%.
Excess = Green indicates above 0%, while red indicates below 0%.
Sharpe = Green indicates better than B&H, while red indicates worse.
Sortino = Green indicates better than B&H, while red indicates worse.
Calmar = Green indicates better than B&H, while red indicates worse.
Max DD = Green indicates better than B&H, while red indicates worse.
Alpha (α) = Green indicates above 0%, while red indicates below 0%.
Win Rate = Green indicates above 50%, while red indicates below 50%.
Profit Factor = Green indicates above 2, while red indicates below 1.
Expectancy = Green indicates above 0%, while red indicates below 0%.
In summary, the Trend Volatility Regime is a comprehensive trend-following tool designed to help investors stay on the right side of the market by identifying key changes in the market regime. By combining volatility-adjusted moving-average crossover signals with adaptive volatility-based trailing stops, the model seeks to maximise participation during uptrends while reducing exposure during sustained downtrends. While the model provides valuable historical insights, users should remain mindful that past results may not necessarily persist under future market conditions. Indicator

Efficiency Trailing Stop LossEfficiency TSL is an adaptive trailing stop framework designed to dynamically follow market movement while continuously adjusting stop behavior based on changing price efficiency and directional conditions.
Unlike traditional trailing stop systems that rely on static ATR values or fixed structure levels, Flip TSL evaluates how effectively price is moving and uses that information to expand, tighten, or aggressively reduce risk as market behavior evolves.
The objective is not simply to trail price, but to adapt risk management according to changing market conditions beneath the surface.
By combining market efficiency analysis, directional state detection, adaptive stop expansion logic, and automatic long/short transition behavior into a unified framework, the indicator is designed to provide additional context for trade management and evolving market structure.
Features
• Single adaptive trailing stop line
• Automatic Long ↔ Short transition system
• Dynamic stop expansion and tightening engine
• Market efficiency analysis
• Improvement / deterioration detection
• Automatic direction logic modes:
• Stop Cross
• SMA Direction
• Candle Direction
• Structure Step stop logic
• Swing High / Low fallback logic
• Multi-timeframe calculations
• Adjustable timeframe selection
• Wait-until-close confirmation option
• Dynamic ATR stop sizing
• Real-time dashboard
• Fully customizable colors and display settings
Dashboard Includes
• Current direction mode
• Auto direction method
• Efficiency score
• Market state
• Stop mode
• Active ATR multiplier
• Current trailing stop value
Alerts Included
• Flipped Long
• Flipped Short
• Efficiency crossed below threshold
• Long Mode Activated
• Short Mode Activated
Potential Use Cases
• Dynamically manage open positions
• Adapt stop placement to changing conditions
• Reduce risk during deteriorating environments
• Hold stronger trends longer
• Filter lower-quality market conditions
• Add confluence to existing systems
• Study changing market behavior
Interpretation
Expanded
Market efficiency is elevated and conditions remain supportive of directional continuation.
The trailing stop expands and provides additional room for price movement.
Tightening
Market conditions begin slowing or losing efficiency.
The trailing stop contracts and moves closer to price action.
Cut / Take Profit
Market efficiency falls beneath the defined threshold.
The stop may aggressively tighten or move toward current price to reduce exposure and protect gains.
Direction Modes
Stop Cross
Direction flips when price crosses the active trailing stop.
SMA Direction
Direction follows price relative to moving average positioning.
Candle Direction
Direction adapts based on bullish and bearish candle behavior.
About TrendGenY Indicators
TrendGenY indicators are built from market experience, creative concepts, and a constant pursuit of unique perspectives. Rather than following conventional ideas, the focus is on uncovering alternative insights and viewing market behavior through different angles to reveal information that traditional tools may overlook and help traders build a more meaningful edge in the market. Indicator

Extreme Reversal Channel [JOAT]Extreme Reversal Channel
Introduction
Extreme Reversal Channel is an open-source adaptive channel that tracks persistent upper and lower extremes, gradually resets stale levels, and marks confirmed reversal conditions when price rejects a fresh extreme through the channel midpoint.
The problem it solves is stale channel context. Fixed lookback channels can jump abruptly as old bars roll out. Extreme Reversal Channel uses persistent state and controlled interpolation, creating smoother structural boundaries while still adapting to current price.
Core Concepts
1. Persistent Extreme Tracking
The upper channel updates when a new high exceeds the current upper core. The lower channel updates when a new low breaks the current lower core.
2. Counter-Based Reset
If no new extreme appears after the selected reset length, the stale level interpolates toward current price using the reset alpha setting.
upperCore := upperCore * (1.0 - alpha) + high * alpha
lowerCore := lowerCore * (1.0 - alpha) + low * alpha
3. Midpoint Reversal Confirmation
A bullish reversal requires a fresh lower extreme and a confirmed close back above the midpoint. A bearish reversal requires a fresh upper extreme and a confirmed close back below the midpoint.
4. Channel vs Trail Mode
Channel mode shows the upper, lower, and midpoint. Trail mode shows a single adaptive trailing reference derived from the current trend state.
Features
Adaptive upper/lower extremes: Persistent channel boundaries that update with new highs/lows
Reset interpolation: Stale levels drift toward current price instead of disappearing abruptly
Midpoint reversal logic: Reversal labels require closed-bar confirmation
Gradient channel fills: Upper and lower channel regions are lightly shaded
Optional trail mode: Converts the channel into a single adaptive stop reference
Top-right dashboard: Trend, mode, width, price position, reset age, and signal state
Alerts: Confirmed bullish and bearish reversal events
Input Parameters
Channel:
Reset Length: Bars allowed before an untouched extreme resets
Reset Alpha: Interpolation speed toward current price
Body Filter: Minimum candle body quality for reversal labels
Trailing Mode: Switches from full channel to trail display
How to Use This Indicator
Step 1: Use the channel boundaries as adaptive structural extremes.
Step 2: Watch for midpoint rejections after fresh extremes.
Step 3: Use trail mode when you want a simpler directional reference.
Step 4: Read price position and channel width in the dashboard before interpreting a reversal.
Indicator Limitations
Reversal labels can be early in strong breakout conditions
Very narrow channels require caution because small moves can cross the midpoint easily
The channel is adaptive context, not a complete trade system
Signals are confirmed on closed bars and do not use future references
Originality Statement
Extreme Reversal Channel is original in its combination of persistent extreme tracking, reset interpolation, midpoint rejection logic, optional trail mode, and compact dashboard output. It does not copy third-party source code.
Disclaimer
This open-source indicator is provided for educational and informational purposes only. It is not financial advice. Market conditions can invalidate reversal context, and risk management remains essential.
-Made with passion by jackofalltrades
Indicator

Adaptive Flow II | AnonycryptousAdaptive Flow II | Anonycryptous
Description & user manual
Why this indicator is different
Most trend-following indicators use a fixed moving average. A 50-period EMA moves at the same speed whether the market is trending hard or grinding sideways. It cannot distinguish between a clean directional move and noise. It gives the same weight to a volatile consolidation as it does to a strong impulse. The result is signals that arrive late in trends and fire repeatedly during chop.
Adaptive Flow v2 works differently.
At its core is a Kaufman Adaptive Moving Average — a moving average that measures the efficiency of price movement on every single bar and adjusts its own speed accordingly. When price is moving cleanly in one direction with low noise, the flow line accelerates toward price. When price is churning sideways with high volatility and no direction, the flow line nearly stops moving. It adapts. Automatically. Without requiring any manual intervention.
V2 builds significantly on this foundation. It adds five configurable stop modes, full market structure detection through BOS and CHoCH events, three independent signal filters, dynamic extension bands, a session-anchored VWAP, and an expanded dashboard. The result is a complete adaptive trend and structure system — not just a trend indicator, but a context-aware trading framework.
Important notice
Adaptive Flow v2 generates signals based on technical indicator alignment.
These signals are not financial advice.
They do not predict the future.
They do not guarantee profitability.
All trading decisions are made entirely by the user.
Always manage your own risk. Always apply your own judgment.
1. Overview
Adaptive Flow v2 is an adaptive trend-following indicator built around a Kaufman Adaptive Moving Average with a configurable stop engine and full market structure detection.
What it includes:
- Kaufman Adaptive Moving Average rendered as a neon glow line with four stacked plot layers
- Five stop modes: ATR Trailing, Supertrend, Chandelier, Donchian, and Volatility Pivot
- Cloud fill between the flow line and the stop line, reflecting the current trend state
- Dynamic extension bands above and below the flow line at configurable ATR distance
- BOS and CHoCH structure detection with BOS confirmation filter
- Pivot high and low target lines that change color when broken
- EMA 200 macro trend filter with higher timeframe support
- ADX filter for directional environment confirmation
- Session filter to restrict signals to a configurable trading window
- Signal cooldown to prevent repeated triggering
- Session-anchored VWAP with daily and custom session modes
- Bar coloring reflecting the current trend state
- Three presets: default, fast, and smooth
- Live dashboard with 13 data rows
- Seven alert conditions
2. The flow line — Kaufman Adaptive Moving Average
The flow line is the visual heart of Adaptive Flow. On every bar it calculates an Efficiency Ratio — a measure of how directionally efficient price movement is relative to total volatility over the lookback period.
When the Efficiency Ratio is high — price is moving strongly in one direction with low noise — the flow line accelerates toward price. When the Efficiency Ratio is low — price is ranging with high volatility — the flow line nearly stops moving.
This adaptive behavior means the flow line naturally stays close to price during strong trends and pulls away only during genuine transitions. It is not a lagging average that mechanically follows price at a fixed delay. It responds to market character.
The flow line is rendered with four stacked plot layers — a sharp core at full opacity and three progressively wider, more transparent layers behind it — creating a neon glow effect that makes it visually distinct on any chart.
The noise filter adds an additional gate: KAMA only advances when the price displacement exceeds ATR × threshold. This prevents the flow line from reacting to insignificant micro-movements during low-momentum conditions. Disable it for maximum responsiveness in strong trending environments.
3. Stop engine — five modes
The stop engine calculates a dynamic stop level from the flow line. All five modes use the flow line as their reference point, not raw price. This means the stop inherits KAMA's adaptive smoothing before calculating any distance.
When the flow line crosses the stop level, the trend flips and a signal fires.
3.1 ATR Trailing (default)
The stop trails the flow line at a fixed ATR distance using a ratchet mechanism — it only moves in the direction of the trend and locks in the floor or ceiling. This produces the characteristic smooth, flowing wave that follows the flow line closely. The cloud between the flow line and the stop gives a live view of the trend zone width. Default and recommended for most users.
3.2 Supertrend
ATR band above or below the flow line with ratchet mechanism. Similar to ATR Trailing but calculated differently, producing a more angular step-like stop line. More angular appearance, fewer intermediate flips.
3.3 Chandelier
The stop trails the highest or lowest flow line value over a configurable lookback window, then subtracts or adds ATR × multiplier. Exits when the flow line has sustained a reversal beyond the lookback range. Better for trending markets where you want to trail a historical extreme rather than the current level.
3.4 Donchian
The stop follows the highest or lowest flow line value over a rolling window with no ATR component. Purely range-based. The stop level is exactly the rolling high or low of the flow line — clean, simple, no volatility scaling.
3.5 Volatility Pivot
The stop anchors to the last confirmed pivot high or low of the flow line plus an ATR buffer. Structurally aware — the stop sits at a level where the flow line previously reversed, not at an arbitrary distance. Best for traders who want the stop to respect structure rather than trail at a fixed distance.
4. Extension bands
When enabled, two bands are drawn above and below the flow line at ATR × multiplier distance. They are not stop levels — they are extension context. When price reaches the upper band during a bullish trend, it may indicate an overextended condition. When price compresses back toward the flow line after touching a band, it may indicate a pullback area. The bands move with the flow line and adapt to current volatility.
5. Market structure — BOS and CHoCH
Adaptive Flow v2 includes a full market structure detection engine that runs alongside the adaptive trend engine.
Pivot highs and lows are detected on price using configurable left and right bar lookbacks. When price closes beyond a confirmed swing level, the indicator classifies the event as either a Break of Structure or a Change of Character.
A BOS fires when price closes beyond a swing level in the direction of the existing structural trend — confirming continuation. Drawn as a dashed line
A CHoCH fires when price closes beyond a swing level against the existing structural trend — signaling a potential reversal. Drawn as a solid line.
The BOS confirmation requirement prevents false reversals. When set to 1 (default), at least one BOS must confirm the current structural trend before a CHoCH can flip it. This blocks the common false reversal where a sharp pullback briefly closes beyond a swing level before the trend reasserts.
Pivot target lines are drawn automatically at the last confirmed pivot high and low. They extend to the right and change color when price closes through them.
6. Signal filters
Three optional filters are available. All three can be combined. A signal only fires when all active filters agree.
EMA 200 — always active as a macro filter. Bullish signals only fire above the EMA 200. Bearish signals only below. Set the EMA 200 timeframe to a higher timeframe (1H or 4H) when trading on lower timeframes — the native EMA 200 on a 1-minute chart only covers a few hours and provides no meaningful macro context.
ADX filter — when enabled, signals only fire when ADX is at or above the configured threshold. Below this level the market is typically ranging and directional signals carry less weight. Default threshold of 20 removes the weakest trend environments.
Session filter — when enabled, signals only fire during the configured trading window. Defined in HHMM-HHMM format using exchange timezone. Outside the window the flow line continues calculating but no new signals are generated.
Signal cooldown — minimum bars between two signals in the same direction. Prevents repeated triggering during choppy conditions around the stop level.
7. VWAP
The VWAP provides a volume-weighted price reference that resets at the start of each session. It represents the average price paid weighted by volume — a key reference for intraday value and institutional order flow.
Daily mode resets every calendar day. Custom mode anchors to a specific session defined by start and end times in HHMM-HHMM format. Timezone selection ensures correct boundary alignment.
8. Presets
Three preset configurations are available. Selecting a preset overrides the core KAMA calculation parameters.
Default — balanced for swing trading on 4H and daily charts.
Adaptive length 14 | Fast constant 2 | Slow constant 30 | Noise threshold 0.3.
Fast — built for scalping on 1 to 15 minute charts.
Adaptive length 6 | Fast constant 2 | Slow constant 15 | Noise threshold 0.15.
Shorter lookback for faster momentum shift detection. Lower noise threshold preserves full adaptive speed.
Smooth — designed for position trading on daily and weekly charts.
Adaptive length 21 | Fast constant 3 | Slow constant 40 | Noise threshold 0.5.
Extended lookback demands sustained momentum before accelerating. Aggressive noise filtering for high-conviction reads only.
9. Dashboard
The dashboard displays the live state of all indicator components and updates on every bar.
Rows displayed:
- Adaptive Flow — indicator name with trend-colored header and current timeframe
- Trend — current flow line direction: bullish or bearish
- Stop Mode — active stop mode in use
- Structure — current structural direction from BOS/CHoCH logic
- EMA 200 — whether price is above or below the macro filter
- VWAP — whether price is above or below session value
- ADX — current ADX value with confirmation indicator
- Session — whether the session filter is active and the current bar is inside the window
- Noise Filter — whether the noise gate is active
- Stop Distance — distance from current close to stop level in ATR multiples and as a percentage
- Trend Bars — number of bars the current trend has been active
- BOS Count — number of confirmed BOS events in the current structural direction
- Signal — last signal fired: buy, sell, CHoCH, BOS, or none
10. Settings reference
KAMA & Calculation
- Price Source: input for the flow line calculation
- Adaptive Length: efficiency ratio lookback period
- Fast Constant: smoothing speed during trending conditions
- Slow Constant: smoothing speed during ranging conditions
- Enable Noise Filter: toggle the displacement gate
- Noise Threshold: minimum ATR multiple required to advance the flow line
- Preset: Default, Fast, or Smooth
Stop Engine
- Stop Mode: ATR Trailing, Supertrend, Chandelier, Donchian, or Volatility Pivot
- ATR Length: volatility measurement period
- ATR Multiplier: distance scaling for the stop level
- Stop Lookback: rolling window for Chandelier and Donchian modes
- Pivot Buffer: ATR buffer for Volatility Pivot mode
Market Structure
- Show BOS / CHoCH: toggle structure detection
- Pivot Left / Right Bars: swing confirmation lookback
- Max Structure Levels: maximum lines shown on chart
- BOS Required Before CHoCH Flip: false reversal filter
- Show Pivot Target Lines: toggle automatic target lines
- Target Line Color and Width
Signal Filters
- EMA 200 Timeframe: leave empty for chart timeframe
- Show EMA 200: toggle line and label visibility
- EMA 200 Color
- Enable ADX Filter: toggle directional environment gate
- ADX Length and Threshold
- Enable Session Filter: toggle session-based signal restriction
- Session Window: HHMM-HHMM format
- Signal Cooldown: bars between signals
VWAP
- Session: Daily or Custom
- Timezone: UTC, Exchange, or major financial center timezone
- Session Window: for Custom mode
- Show VWAP: toggle line and label
- VWAP Color
Visuals
- Bull Color and Bear Color
- Cloud Transparency: fill between flow line and stop
- Show Extension Bands: toggle ATR extension bands
- Extension Band Multiplier: distance from flow line
- Show Reversal Signals: toggle triangle markers
- Color Candles: toggle bar coloring
- Candle Transparency
Dashboard
- Show Dashboard
- Size: Tiny, Small, or Normal
- Position: Top Left, Top Right, Bottom Left, or Bottom Right
11. How to use
11.1 Initial setup
Select a preset matching your primary trading style. Set the EMA 200 timeframe to a higher timeframe when trading on lower timeframes — 60 for 1H, 240 for 4H. Set the VWAP to Daily or configure a custom session matching your primary market. Choose a stop mode — ATR Trailing is the default and works well across all timeframes. Enable the session filter and ADX filter if you want stricter signal conditions.
11.2 Reading the chart
The flow line and its glow indicate the current adaptive trend. Green indicates a bullish environment. Red indicates a bearish environment. The cloud between the flow line and the stop shows the trend zone width — a wide cloud indicates strong momentum, a narrowing cloud indicates the flow line is slowing.
The stop line is where the trend flips. A reversal signal fires when the flow line crosses it. Triangle markers appear at the stop line at the signal bar.
Extension bands show how far price has moved from adaptive value. Price at the upper band in a bullish trend may indicate overextension. Price returning toward the flow line after touching a band may offer a pullback reference.
BOS and CHoCH lines show structural context. Use them to understand whether the trend is in a confirmation phase (BOS firing repeatedly) or approaching a potential reversal (flow line slowing while price approaches a structural level).
11.3 Timeframe guide
1 to 5 minutes — Fast preset. EMA 200 timeframe set to 60 or 240. Session filter recommended.
15 to 30 minutes — Fast or Default preset. EMA 200 timeframe 240 or D.
1 hour to 4 hours — Default preset. Native EMA 200 or D timeframe.
Daily and above — Smooth preset. Native EMA 200.
11.4 Stop mode selection guide
ATR Trailing — best for most situations. Smooth, flowing, closely follows the flow line.
Supertrend — fewer flips, more angular. Good for lower timeframe noise reduction.
Chandelier — suited for trending markets where you want to trail a recent high or low.
Donchian — clean range-based stop with no ATR influence. Simple and transparent.
Volatility Pivot — best when you want the stop at a structurally meaningful KAMA level.
11.5 Context
Adaptive Flow v2 identifies adaptive trend direction and market structure. It does not filter by fundamental events, news, or macro calendar. A bullish signal during a risk-off macro event may fail more often than one in a clear trending environment. Always apply your own context and judgment alongside the indicator output.
12. Alerts
Seven alert conditions are available:
- Bull Trend: flow line crosses above the stop level, EMA 200 above, all active filters passed.
- Bear Trend: flow line crosses below the stop level, EMA 200 below, all active filters passed.
- Any Trend Change: fires on either bull or bear trend signal.
- Bull CHoCH: market structure flips to bullish via Change of Character.
- Bear CHoCH: market structure flips to bearish via Change of Character.
- Bull BOS: bullish Break of Structure confirms trend continuation.
- Bear BOS: bearish Break of Structure confirms trend continuation.
All alerts include exchange, ticker, and interval in the message.
13. Disclaimer
This indicator is provided for educational and informational purposes only.
All outputs are based on historical price action calculations and do not guarantee future results.
Trading financial instruments involves significant risk of loss.
Past performance does not indicate future results.
Use at your own discretion.
Indicator

Indicator

Liquidity-Anchored Trailing Stop [BigBeluga]Liquidity-Anchored Trailing Stop is a comprehensive volatility and structural framework designed to provide a protective "heatmap" around price action. By fusing multi-layered ATR-based trailing logic with a dynamic Volume Profile, this indicator identifies where market momentum is accelerating and where institutional liquidity is "anchored."
Instead of a single line, this tool provides a graded risk-mitigation zone that adapts to market noise, ensuring you remain in the trend during healthy pullbacks while identifying the exact structural peaks where volume was most concentrated.
🔵 THE DUAL-ENGINE FRAMEWORK
Volatility Heatmap (Trailing Stop): The indicator calculates four distinct levels of trailing protection (Stop 1 through Stop 4). These are anchored to the trend’s direction and volatility, creating a "safety buffer" that narrows or expands based on the Average True Range (ATR).
Trend-Relative Volume Profile (Right Side): Unlike static volume profiles, this engine focuses specifically on the current trend segment. It visualizes the total relative volume transacted at each price bin since the last trend flip, highlighting where the real "meat" of the move occurred.
High Volume Nodes (HVNs): The script automatically detects peaks in the volume distribution. These High Volume Nodes represent structural anchors where the market has spent significant time, serving as high-probability zones for support or resistance.
🔵 CORE ARCHITECTURE
Liquidity Anchoring: By plotting HVN levels (Structural Peaks), the indicator shows you exactly where liquidity is sitting. When a trailing stop aligns with a volume peak, it creates a "Hard Anchor"—a level that is significantly harder for price to break through.
Adaptive Stop Logic: The trailing stops (ts1-ts4) use a ratchet mechanism. In an uptrend, the stops only move up; in a downtrend, they only move down. This prevents the "stop-loss creep" that often leads to giving back profits.
Dynamic Gradient Heatmap: The space between the four trailing bands is filled with a color-coded gradient. Saturated colors represent the core trend, while the outer bands represent the "exhaustion zone" where the trend is at risk of structural failure.
🔵 FEATURES
Granular Profile Rows: Fully adjustable vertical resolution (Profile Rows) allows you to define how detailed you want the volume distribution to be, ranging from broad structural areas to precise price levels.
Peak Level Detection: Horizontal structural lines are automatically drawn across the trend range at major HVNs, providing immediate visual targets and pivot points.
Smart Trend Labels: Clean UI labels (Bull/Bear) mark the exact bar where the trend flips and the volatility bands reset, ensuring you never miss a shift in market regime.
Visual Clarity Toggle: Includes options to show or hide the Volume Profile and Peak Levels, allowing you to use the tool as a pure volatility stop or a full-scale market structure map.
🔵 STRATEGIC APPLICATION
Trailing with the Heatmap: Use the innermost band (Stop 1) for aggressive scalping or tight management, and the outermost band (Stop 4) for macro trend following. If price closes beyond Stop 4, the trend is officially considered "broken."
HVN Confluence: Look for instances where the Trailing Stop aligns with a High Volume Node. These "Anchored Stops" are the most robust areas to place your actual exchange orders, as they are backed by both volatility and historical volume.
Volatility Breakouts: When the ATR bands (Heatmap) contract significantly and then price breaks out, look to the Volume Profile to see if the breakout is supported by a surge in volume at the new price bins.
Targeting Structural Peaks: In a trending market, use the volume peaks on the right side of the chart as natural take-profit targets or areas to expect temporary price stalls.
Liquidity-Anchored Trailing Stop transforms traditional stop-loss logic into a multi-dimensional map of risk and liquidity. By understanding where volume is anchored and how volatility is breathing, you can stay in winning trades longer and exit with precision when the structure finally fails. Indicator
