Trend Magic
By LuxAlgoApr 25, 2026
Trend Magic is the definitive clean build of the Trend Magic trailing line, a two-state regime tool steered by momentum rather than by price touching the line. While the CCI holds at or above zero the line rides below price at the low minus an ATR offset, ratcheting only upward; once the CCI turns negative it jumps above price and ratchets only downward. A gradient fill spans the room left between price and the ratcheted level.
How to Trade the Trend Magic?
- Bullish flip: the CCI crosses up through zero and the line resets below price — the long regime begins with a rising floor.
- Bearish flip: the sign turns negative and the line resets above price with a descending ceiling.
- Line tests: because flips are CCI-gated, price can touch or even pierce the trailing level without ending the regime — the trailing-stop reference event, alerted separately for each side.
Within a state the line never gives ground, which is what makes it usable as a ratcheted exit level: longs trail against the rising line, shorts against the falling one. The ATR multiplier moves the line closer or further without changing when it flips.
Trend Magic Settings
- CCI Length (default 20): lookback of the steering oscillator — shorter lengths flip earlier but whipsaw more; longer ones lag turns.
- CCI Source (default hlc3): typical price, matching the classic CCI construction.
- ATR Length (default 5): averaging window of the offset that sizes the line's distance.
- ATR Multiplier (default 1.0): ATRs between price and the line; it sets distance only, never timing.
- Style toggles cover flip markers, the gradient trail fill, the regime colors and line width.
Frequently Asked Questions
How does Trend Magic differ from Supertrend?
Both trail ATR-offset levels that ratchet with the trend, but Supertrend reverses when price crosses its band, while Trend Magic flips only on a CCI sign change. Price piercing this line is information, not a reversal — a distinction that changes how stops behave around the level.
Why does the line jump at a flip instead of bending?
Because it is recomputed on the opposite side of price rather than traveling there: a bullish flip re-seats it at the low minus the offset, a bearish flip at the high plus it. The visible gap is the construction working as designed.
How can false flips in ranges be reduced?
Lengthening the CCI helps, and a larger ATR multiplier keeps the line further from price, but no parameter removes range chop entirely. The practical mitigation is external — pair the flips with a regime or slope filter and let only agreeing signals through.
The Library is free. Quant makes it yours.
Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.
