Noon Barbari
Sign up

Back to all indicators

trend_magicStructure indicator

Trend Magic

CCI + ATR trend trail.

What it is

CCI + ATR trend trail.

Trend Magic combines an ATR band with the Commodity Channel Index (CCI) to produce a single trend line. When CCI is non-negative, the line is anchored to `low − ATR` (a rising support floor); when CCI turns negative, it switches to `high + ATR` (a falling resistance ceiling). The line only moves in the favourable direction — it never gives ground in the active trend.

Anchoring to wick extremes instead of close or hl2 keeps the stop just beyond recent noise. The CCI gate adds a momentum filter, so the line flips on a measurable shift in price acceleration rather than only on a band breach.

Defaults are typically CCI period 20 and ATR period 5 with factor 1, but the parameter set is sensitive — test before deploying.

if CCI ≥ 0:  line = max(line_{t−1}, low − ATR)
if CCI < 0:  line = min(line_{t−1}, high + ATR)

Read the full Trend Magic definition in the glossary →

Live chart

TradingView has no built-in study for this indicator, so there's no live chart to embed here. It's a structure / smart-money tool — the best way to see it is to run it inside a strategy and backtest it.

The strategies below put this indicator to work — open one and backtest it.

Parameters

ParameterDefaultRange
CCI period202 – 200
ATR period52 – 200
Coefficient10.1 – 10

Output fields

The named values this indicator exposes to your entry and exit rules.

trailstateCCI

Related strategies

Ready-made, runnable templates that use this indicator. Open one to inspect or backtest it.

Backtest this indicator

Drop this indicator into a rule-set, run it over years of BTC/USDT data, and see whether the edge is real or just curve-fit — no credit card required.