OPEN-SOURCE SCRIPT
업데이트됨 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.
### 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.
릴리즈 노트
Minor update릴리즈 노트
UPDATE — Calibrated Supertrend (ST ARC)=======================================
NEW · Path-Dependent Volatility band scaling (optional, OFF by default)
----------------------------------------------------------------------
The band distance (ATR x adaptive multiplier) can now be pre-scaled by a factor
read from the recent return PATH: activity clustering (fast vs slow average of
squared returns), leverage (recent down-moves widen the band), and upside
convexity (strong up-moves widen it a touch).
Why it helps: the existing multiplier adapts to where volatility SITS in its own
history (a reaction). This new layer reads what the recent path implies is
COMING, so the band can widen BEFORE the move and re-tighten as it calms —
fewer late stops, fewer flips into an expanding move.
• Enable it in the new "Path-dependent volatility (anticipatory band)" group.
• OFF by default — with it off (or Influence Weight = 0) the band, flips, gates,
verdict and alerts are identical to the previous version.
• When on, the MULTIPLIER dashboard cell shows the live factor (e.g. "pv1.15").
>1 = path-widened (anticipating expansion); <1 = path-tightened (calming).
• Built only from your selected Price Source and the ATR, so it inherits the
indicator's any-symbol / any-market behaviour and stays non-repainting.
Everything else — the confirmation gate, regime engine, MTF agreement, empirical
flip-reliability tracker, conviction score and vetoes — is unchanged.
For educational and informational purposes only. Not financial advice. Past
performance does not guarantee future results. Manage your risk.
릴리즈 노트
RELEASE NOTES — what's newBulk-volume trade-side delta. Volume delta no longer labels a whole bar 100% buy/sell from the tick rule. It splits each bar's volume into a buy fraction = CDF of the bar's standardized price change, so marginal bars add little and wide-range bars add a lot — a much cleaner CVD. Runs at the lower timeframe with a chart-bar fallback; toggle reverts to the tick rule.
Fractal-dimension trend-quality. A multi-scale roughness measure offered as a swap/blend with the efficiency ratio in the trend-vs-chop test. Same axis as the efficiency ratio, so it's a swap, not a stacked vote; its value is shown as a dashboard cross-check.
Plateau-robust self-tune. The optional online multiplier tune now prefers a value whose neighbouring grid settings are also good (a broad plateau) over a lone spike — anti-overfit.
Walk-forward + runs-test on reliability. Hold-rate is now reported recent-window vs all-history (out-of-sample decay visible, not averaged away) plus a runs-test that flags when wins/losses cluster. New CALIB dashboard row, amber on degradation/clustering.
Also: 14 numbered institution-style setting groups; full-luminance adaptive dashboard theme; NIFTY/BankNifty defaults (India VIX) with the raw source and all feeds user-selectable for any market.
WHAT IT IS
A Supertrend rebuilt to fix its three weaknesses, with a self-auditing layer on top. A plain Supertrend uses a fixed ATR multiplier (whipsaws when volatile, gives back when calm), flips on any marginal poke, and looks identical in a trend and in chop. Here the multiplier adapts to a volatility rank and to trend efficiency, a flip is confirmed only on a meaningful ATR breach after a minimum hold (non-repainting), and the line is wrapped in a regime read, multi-timeframe agreement, a conviction score with hard vetoes, and an empirical record of how this symbol's own past flips resolved. Works on any symbol/timeframe/market — source and feeds are user-selectable, nothing is hard-coded to one instrument.
WHY THE COMPONENTS ARE COMBINED (mashup justification)
The layers aren't separate indicators stapled together; each neutralizes a specific failure of the one before it and consumes its output:
Adaptive multiplier → fixes fixed-multiplier whipsaw/give-back via a volatility-rank and efficiency scaler.
Path-dependent band → pre-widens/re-tightens from the recent return path so stops aren't late.
Confirmation gate → kills noise flips (ATR-breach + min hold, on closed bars).
Regime read (efficiency/fractal dimension + directional strength + volatility clustering) → tells you whether a flip is trustworthy at all.
Multi-timeframe agreement → down-weights/vetoes flips against the larger structure.
Volume delta → independent participation check.
Conviction + vetoes, then empirical reliability/calibration → fold it into one accountable number and report how flips with this profile actually resolved on this symbol.
Remove any layer and a concrete failure returns (whipsaw, late stops, reacting late, fading a trend, flipping in chop, acting without participation, trusting an un-validated threshold). That's why they ship as one tool.
HOW TO USE IT
Set the raw data source (defaults hl2; can point at any series), leave the rest on defaults. Read the dashboard verdict as context, not an order: LONG/SHORT shows only on a confirmed flip clearing conviction, strength and veto gates — else HOLD/WEAK/VETO. Use the regime row to size trust (Trend + MTF agreement = high conviction; Range/Volatile is de-emphasized/vetoable). Watch RELIABILITY and CALIB to see, from this symbol's history, how often such flips followed through and whether that rate is decaying or clustering. The Supertrend line is the natural trailing stop; the risk row sizes a position from your inputs as context only. Compact dashboard is default; Pro shows all rows.
WHAT MAKES IT ORIGINAL
The self-calibrating, self-auditing layer. Instead of emitting a fixed line and leaving you to guess, it keeps an empirical record of how its own confirmed flips resolved on the current instrument, exposes the hold-rate with a recent-vs-all walk-forward split, runs an independence test on the outcome sequence, and grades each flip against realized hit-rates — so thresholds are accountable, not asserted. The fractal-dimension cross-check, plateau-robust tune and bulk-volume delta are all chosen to add complementary information and resist overfitting, not to stack lookalike metrics.
LIMITATIONS
Reliability/calibration/walk-forward/runs-test need history — fresh or short series read "learning…". Adaptive thresholds and the optional online self-tune adapt to recent behaviour; more adaptive isn't always better, so self-tune is off by default and labelled as the overfit-prone lever. Volume delta needs volume data. MTF/cross-asset reads update on their own bar closes. This is a study for context and process — not a strategy, not a signal service, not financial advice. Nothing here predicts price.
CONCEPT CREDITS
ATR and the directional-movement/strength index — J. Welles Wilder. Efficiency ratio — Perry Kaufman. Dominant-cycle (homodyne discriminator) and fractal-dimension market-mode — John Ehlers. Bulk volume classification — Easley, López de Prado & O'Hara. Runs test for sequence randomness — Wald & Wolfowitz. Normal-CDF rational approximation — Abramowitz & Stegun. The ATR-trailing-band ("Supertrend") construction and Fibonacci length ladder are long-standing public techniques. The code uses only universal technical terms; the people are credited here.
DISCLAIMER
For educational and informational purposes only — a study/indicator, not a strategy, recommendation, or financial/investment/trading advice. It does not predict price. Markets carry substantial risk of loss; historical or in-sample statistics shown do not guarantee future results. You are solely responsible for your decisions and risk management. Test thoroughly before relying on anything here.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.