Trend Magic¶
Indicators · Trend
Trend Magic — CCI-gated ATR trailing line; zero-cross of CCI flips the trend.
Trend Magic is a hybrid trend tool that pairs a momentum gate with a volatility-based trailing line. It draws a single line that trails below price in uptrends and above price in downtrends — like Supertrend — but it decides when to flip using the CCI crossing its zero line rather than a price/band cross. The result is a colour-coded trend line that's quick to call direction changes via momentum while keeping a volatility-aware stop level.
How it works¶
Two parts combine. The trailing line is built from ATR — over the ATR period (default 5), scaled by the ATR multiplier (default 1.0) — placed as a stop that ratchets in the trend's favour. The direction is gated by CCI over the CCI period (default 20): when CCI is positive the line trails below price (uptrend); when negative, above (downtrend). The block fires Bull ↑ when CCI crosses up through zero and Bear ↓ when it crosses down — those zero-crosses are the trend flips. The Trend Magic line plots on the price pane.
When to use it¶
Use Trend Magic as a trend-direction and trailing-stop tool, much like Supertrend, but when you want momentum (CCI) rather than pure price action to drive the flips — it can turn a little earlier as a result. Trade in the direction the line indicates, use the line itself as a trailing stop, and take the CCI zero-cross arrows as entries. As with all trend tools it whipsaws in ranges (here, when CCI oscillates around zero), so a regime filter helps.
Example¶
A momentum-flipped trend ride: wire bars into Trend Magic, take Bull ↑ into a Buy Signal gated by ADX / DMI so CCI's zero-crosses only count in real trends, and trail the exit with the Trend Magic line via a Structural Stop-Loss. Backtest in the Tester.
Tips & gotchas¶
- CCI drives the flips, ATR draws the stop. That's the twist versus Supertrend's price/band flip.
- The multiplier tunes the trail — wider = looser stop, fewer flips; tighter = quicker.
- Range = CCI whips around zero → frequent false flips; filter the regime.
- Compare with Supertrend on your instrument — momentum-gated vs price-gated flips behave differently.
Related blocks¶
Inputs¶
| Socket | Type | What to wire in |
|---|---|---|
| Bars | bars |
Price bars |
Outputs¶
| Output | Type | Plots as | Description |
|---|---|---|---|
| Trend Magic | series |
Line | Trailing trend line (price scale) |
| Bull ↑ | signal |
Signal arrows | CCI crosses up through zero |
| Bear ↓ | signal |
Signal arrows | CCI crosses down through zero |
Parameters¶
| Parameter | Type | Default | What it does |
|---|---|---|---|
| CCI period | number · 2–200 | 20 |
|
| ATR period | number · 1–100 | 5 |
|
| ATR multiplier | number · 0.1–10.0 | 1.0 |
|
| Line color | colour | #29b6f6 |
Reference auto-generated from the block catalog · category Indicators.