Trend Magic
Indicator
Trend Magic is a trailing line that sits under the close while a 20-bar CCI is at or above zero, and above it while CCI is below.
Described by Kivanc Ozbilgic, 2021. Reviewed by the ChartLabs team, updated Nov 2026.
TrendMagic 65830.30
On price
TrendMagic 65830.30
On price
Illustration on simulated data.
Trend MagicWhat is the Trend Magic indicator?
Trend Magic is one line on the price. While a 20-bar CCI of the typical price is at or above zero, the line sits under the close, at the close minus 1 times a 14-bar ATR. While CCI is below zero, the line sits above the close, at the close plus that ATR.
While the side stays the same, the long line can only rise and the short line can only fall. On a change of side, the line jumps to the new side's price. The first bar is the close, and it counts as the long side. A flat window makes CCI undefined, and an undefined CCI is read as the short side.
The line is two pixels, #26a69a on the long side and #ef5350 on the short side. It is not SuperTrend: the side comes from CCI, and the distance is taken from the close. CCI is Donald Lambert's (1980). True range is Wilder's (1978). Kivanc Ozbilgic described Trend Magic on TradingView in 2021.
Not SuperTrend
SuperTrend flips on price against its own band. Trend Magic flips when CCI crosses zero.
First bar
The first bar is drawn at the close and counted as the long side. There is no ATR trail yet.
Trend Magic signalsFive patterns to know.
Line under price
CCI is at or above zero, so the trail sits below the close and can only rise.
Line over price
CCI is below zero, so the trail sits above the close and can only fall.
Side change
CCI has changed sign, and the line has jumped to the other side of the close.
CCI undefined
A flat typical-price window has no CCI. That bar is drawn on the short side.
Trail holding
The side has not changed, so a pullback in price does not pull the line back with it.
Trend Magic formulaHow it is calculated.
Read CCI
Take a 20-bar CCI of the typical price, (high + low + close) / 3, including the current bar. At or above zero is the long side. Below zero, or undefined, is the short side.
Place the candidate
Long is the close minus the ATR multiplier times ATR. Short is the close plus it. ATR starts as this bar's high-low, then smooths with alpha 1/14.
Trail or jump
While the side holds, keep the long line at the higher of the new candidate and the previous line, and the short line at the lower. On a change of side, take the new candidate. The first bar is the close.
Trend Magic settingsEvery setting, explained.
| Setting | Default | Range | What it changes |
|---|---|---|---|
| CCI Length | 20 | 1 to 10,000 | Bars in the CCI that picks the side. The Signal lens changes this. |
| ATR Multiplier | 1 | 0 to 100 | How many ATRs the line sits away from the close. |
| ATR Length | 14 | 1 to 10,000 | Bars in the average true range. |
| Line | #26a69a | Fixed | Two pixels on the price. The short side is #ef5350. |
- Setting
- CCI Length
- Default
- 20
- Range
- 1 to 10,000
- What it changes
- Bars in the CCI that picks the side. The Signal lens changes this.
- Setting
- ATR Multiplier
- Default
- 1
- Range
- 0 to 100
- What it changes
- How many ATRs the line sits away from the close.
- Setting
- ATR Length
- Default
- 14
- Range
- 1 to 10,000
- What it changes
- Bars in the average true range.
- Setting
- Line
- Default
- #26a69a
- Range
- Fixed
- What it changes
- Two pixels on the price. The short side is #ef5350.
Drag to see how the setting changes the lines and how many signals you get. Illustration on simulated data.
Trend Magic strategiesUse it in 3 setups.
Long while the line is under price
CCI is non-negative and the trail is rising under the close. Traders often keep a long idea while price stays above the line.
A flip of side
CCI has changed sign. The line is now on the other side. It is a change of the trail, not a price target.
Short while the line is over price
CCI is negative and the trail is falling above the close.
Trend Magic mistakesCommon mistakes.
Calling it SuperTrend
The side is CCI of the typical price, not a close through a band built from the high or the low.
Expecting a flat market to stay long
A flat window makes CCI undefined, and that bar is drawn on the short side.
Using the line as a target
The line trails the close by one ATR. It does not say where the next swing ends.
Trend Magic combinationsPair it with these.
Trend Magic + CCI
Trend Magic's side is this CCI, at or above zero versus below.
Trend Magic + ATR
The distance from the close is a multiple of average true range. The chart's ATR uses its own length.
Trend Magic + ADX
ADX says whether the trend has strength. The line says which side CCI is on.
Trend Magic + EMA
The EMA is a plain average of price. This line only moves one way until CCI flips.
Trend Magic FAQQuestions traders ask.
What are the Trend Magic settings?
CCI length 20, ATR multiplier 1 and ATR length 14. There is no source menu. CCI uses the typical price and the trail uses the close.
Why is the first bar on the close?
There is no previous line to trail. The first bar is the close, and it counts as the long side.
How does the line decide its side?
A 20-bar CCI of (high + low + close) / 3. At or above zero, the line sits under the close. Below zero, it sits above the close.
What is a flat window?
If the typical prices in the window do not vary, CCI is undefined. An undefined CCI is drawn on the short side.
Is Trend Magic the same as SuperTrend?
No. SuperTrend is not this line. The side here comes from CCI, and the offset is taken from the close.
Does it repaint?
No. A closed bar's line stays. The live bar moves until it closes, because CCI and the true range can still change.
Who described it?
Kivanc Ozbilgic, Trend Magic, TradingView (2021). CCI is Donald Lambert's (1980). True range is J. Welles Wilder's (1978).
What timeframe can I use?
Any. The 20 and the 14 are bars, so a daily chart holds a side longer than a one-minute chart.
Related indicatorsMore trend tools.
All trend indicatorsTry Trend Magic on a live chart.
Free. No download.
Works in your browser and on iPhone too.