Trend Magic is a very popular trend indicator in the trader community. In Algo Signals, it gives a simple answer: the trend is bullish as long as the CCI is zero or positive, bearish otherwise.
What Trend Magic is for
It tells you which side of its recent average price sits on, taking the usual dispersion of prices into account. A price clearly above its average gives a positive CCI, clearly below a negative one. The aim is to take the dominant side.
How it is calculated
Start from each candleโs typical price: (high + low + close) รท 3. Compute its simple average over 20 candles (SMA), then the mean deviation, that is the average of the absolute gaps between each typical price and that SMA. The CCI is (typical price โ SMA) รท (0.015 ร mean deviation). The state is bullish if the CCI is greater than or equal to 0, bearish if negative. While the history is too short, the state is neutral.

Reading the signal in Algo Signals
The buy signal appears when the CCI goes from negative to zero or positive, the sell signal when it goes from positive to negative. It is therefore a crossing of the CCIโs zero line. There is no neutral zone: on every candle the state is one of the two.

The settings
- CCI period (period): 20 by default, adjustable from 2 to 200. Shorter, the CCI changes sign more often; longer, less often.
- ATR period (atrPeriod): 5 by default, from 1 to 100. In the current code it only checks that enough history exists and does not change the bullish or bearish state.
- The threshold is always zero: there is no setting for a neutral zone.
The traps
Because the threshold is zero, the slightest move of price to the other side of its average flips the state. When price stays near its average, the CCI oscillates around zero and the indicator strings together opposite signals.

Key takeaways
- Trend Magic follows the sign of the CCI (period 20): bullish if โฅ 0, bearish otherwise.
- The signal is the CCI changing sign; there is no neutral zone.
- Near zero it flips constantly: signals lose their value.
- Pair it with the ADX or the ATR to know whether the market is directional enough.
๐ Lesson test
Log in to take this lessonโs test. Once you have passed all the tests, you will receive a certificate in your name.
Log inThese lessons are for understanding and are not investment advice. No method guarantees winning.