Concept

Trend Magic

Trend Magic is a Trend concept. The Library holds 1 implementation, a working definition you can pull into Quant.

Top Trend Magic indicator

The top custom implementation, built on the original standard Trend Magic formula.

1 total

This Trend Magic implementation is strategy-ready: open it in Quant, set your rules, and it backtests automatically.

What is Trend Magic?

Trend Magic is a trailing trend line that takes its direction from momentum rather than from price alone. It computes a CCI and an ATR: while the CCI is at or above zero the line is drawn below price (typically the low minus an ATR-based offset) and only ratchets upward; when the CCI drops below zero the line jumps above price (high plus the offset) and only ratchets downward. The line's color flips with the CCI's sign, giving a two-state long/short regime.

That construction places it in the same family as Supertrend and other stop-and-reverse trailers, with one distinction: the flip is decided by the oscillator crossing zero, not by price piercing the band, while ATR only sets the line's distance from price. Like every trailing regime tool it trends well and chops badly; sideways markets produce clusters of false flips that no parameter choice fully removes.

The ratchet is the construction's heart. In the bullish state each bar proposes a line at the low minus the ATR offset, and the plotted value is the higher of that proposal and yesterday's line, so the floor rises or holds but never retreats; the bearish state mirrors this with a ceiling that only descends. When the CCI's sign finally flips, the line does not travel to the other side, it is recomputed there, which is why flips print a visible jump. KivancOzbilgic's port is the canonical version on the platform, with a CCI length near 20 and the ATR offset as the two exposed inputs.

The design's descendants address its known weakness. AlphaTrend, from the same author, rebuilds the idea with an ATR-band construction gated by a money-flow condition instead of a raw CCI sign, explicitly to cut the range-chop flipping that Trend Magic inherits from its zero-cross trigger. The practical mitigation inside Trend Magic itself is external: pair the line with a regularity or slope filter so flips only count when the broader regime read agrees, and let the ratchet do what it does best, trail risk under an established move.

How to identify Trend Magic's states

Two inputs, two states, one ratchet: the whole tool is readable from its construction.

  1. 1Compute the CCI, commonly around 20 periods; its sign is the sole flip authority.
  2. 2Compute the ATR offset that sets how far the line trails from price.
  3. 3In the bullish state (CCI at or above zero), plot the higher of low-minus-offset and the prior line: a floor that only rises.
  4. 4In the bearish state (CCI below zero), plot the lower of high-plus-offset and the prior line: a ceiling that only falls.
  5. 5Read color flips as regime transitions and the gap between price and line as the trend's current risk buffer, remembering flips bunch together in ranges.

How traders use it

  • As a regime filter: long setups are taken only while the line sits below price in its bullish state, shorts only in the opposite state, with other tools handling entries.
  • As a trailing stop reference: the ratchet never gives ground within a trend, so the line (or a buffer beyond it) serves as an exit level that tightens as the move extends.
  • As a flip-signal generator: color changes mark state transitions, usually traded only with confirmation because flips bunch together in ranges.
  • As the exit engine for external entries: entries come from structure, patterns or momentum, while Trend Magic's ratcheting line manages the position, a division of labor that sidesteps its weak flip timing.
  • In multi-timeframe stacks: a higher-timeframe Trend Magic supplies the permitted direction while the trading timeframe handles execution, so range chop on the lower frame cannot flip the governing bias.

Trend Magic vs related trailing tools

Supertrend: Both trail an ATR-offset line and hold state until flipped, but Supertrend flips when price crosses the band while Trend Magic flips when its CCI crosses zero. The momentum trigger can lead or lag the price trigger at turns, and the two disagree exactly where turn-timing matters.

EMA: An EMA is a continuous line that bends through every fluctuation; Trend Magic is a stateful ratchet that refuses to retreat within a regime. The EMA gives graded, always-on information, the ratchet gives a binary regime plus a hard risk line, two different jobs often run side by side.

MA Slope Filter: Both produce a binary trend gate. The slope filter derives it from an average's direction, changing gradually; Trend Magic derives it from an oscillator's sign, changing instantly at the zero cross. The instant flip is sharper in trends and noisier in chop, which is the whole trade.

Concept family

Trend

100 concepts mapped · 100 in the Library

Trend Magic FAQ

Turn Trend Magic into a trading strategy.

Take the implementation from this page into Quant, then build on it, backtest it on real data, and keep refining it in conversation.