2.24: Decyclers: Extracting Trend by Removing Cycle Energy

The decycler extracts trend by subtracting the cycle, not by smoothing. On SPX, decycler at T=30 cuts EMA(50)'s 18% cycle leakage to 4% with less lag. Specify the cycle to cancel, not a lookback.

2.24: Decyclers: Extracting Trend by Removing Cycle Energy

A trader fits an EMA(50) to SPX and calls it "the trend line." On flat-cycle days the EMA hugs the price and the trend line is clean. On strong-cycle days the EMA wobbles with the cycle: the trend line picks up the 20-bar oscillation it was supposed to smooth out. The trader lengthens the EMA to 100 to dampen the wobble, accepts the added lag, and ships the system. The wobble is smaller but the trend line still carries cycle energy. The construction is wrong at the structural level: an EMA at any length attenuates the cycle but does not cancel it.

The decycler is the opposite construction. Instead of smoothing the input until the cycle fades out, subtract the cycle directly. What remains is the trend with the cycle energy removed by cancellation, not by attenuation.

The article "High-Pass Filters for Traders" gave the HPF construction that isolates cycle energy. The article "The Trader's Guide to Low-Pass Filters" gave the LPF construction that smooths cycle energy. The article "Band-Pass Filters: The Most Underused Tool in Technical Analysis" gave the BPF that isolates a specific cycle band. The decycler is the complementary operation to the BPF: input minus HPF, with the cycle cancelled rather than isolated.

This article gives the decycler construction, the structural identity that connects it to LPF design, the decycler oscillator (HPF_short minus HPF_long) as a trend-transition detector, and the operational shift from "trend equals smoothed input" to "trend equals input minus cycle." The next article in this series ("Why Moving Averages Can Lie at Turning Points") covers the lag asymmetry that makes any smoothing-based trend line dangerous at structural inflection points.

The construction

The decycler is built from the HPF by subtraction:

$$ \text{decycler}_t \;=\; x_t \;-\; \text{HPF}(x_t) $$

For a 1-pole HPF with cutoff period T, the HPF transfer function is:

$$ H_{\text{HPF}}(z) \;=\; \frac{(1 - \alpha/2)(1 - z^{-1})}{1 - (1 - \alpha)\, z^{-1}}, \qquad \alpha \;=\; \frac{2\pi/T}{2\pi/T + 1} $$

The decycler transfer function is the complement:

$$ H_{\text{decycler}}(z) \;=\; 1 - H_{\text{HPF}}(z) \;=\; \frac{(\alpha/2)(1 + z^{-1})}{1 - (1 - \alpha)\, z^{-1}} $$

This is a one-pole low-pass filter. The decycler's frequency-response shape is identical to a 1-pole LPF at the same α. Algebraically the operations are equivalent: smoothing the input directly and subtracting the HPF output produce the same trend line.

The equivalence is structural. For any HPF, the decycler (input minus HPF) is the LPF whose response is the complement. The two filters partition the input into trend and cycle:

$$ x_t \;=\; \text{LPF}(x_t) \;+\; \text{HPF}(x_t) \;=\; \text{decycler}(x_t) \;+\; \text{HPF}(x_t) $$

If the math is identical, why frame the operation as a decycler rather than as a direct LPF? The framing changes the parameter that the trader specifies and changes the way the output is interpreted.

Why the framing matters

Three structural reasons the decycler framing beats the LPF framing even when the result is identical.

Reason 1: the parameter is a cycle cutoff period, not a smoothing constant. A trader who specifies "remove cycles shorter than 30 bars" makes a cycle-aware decision. A trader who specifies "EMA of length 50" makes an arbitrary lookback decision. The decycler's cutoff period T maps to a specific point on the frequency axis where the cancellation begins. The EMA's lookback maps to a smoothing constant that has no direct cycle interpretation without additional algebra.

For a 1-pole HPF with cutoff period T, the equivalent EMA length is approximately:

$$ \text{EMA length} \;\approx\; T - 1 \quad \text{(at the -3 dB point)} $$

For T = 30 bars (decycler cutoff), the equivalent EMA length is approximately 29. The two constructions produce nearly identical outputs. But "remove cycles shorter than 30 bars" is a structural claim about the data. "EMA of length 29" is a lookback choice that needs justification.

Reason 2: the cancellation interpretation suggests the cycle band to specify. If the trader sees daily SPX cycles in the 15-to-30-bar range, the decycler cutoff at T = 30 is the direct construction that says "cancel these cycles, keep the trend." The choice is interpretable. The equivalent EMA(29) is the same operation but the cycle-cancellation interpretation is hidden behind the smoothing-constant arithmetic.

Reason 3: the decycler oscillator construction (next section) requires the subtraction framing. There is no "direct LPF" construction that produces the decycler oscillator. The subtraction is the operational primitive that generalizes to the more powerful construction.

The decycler oscillator

The decycler oscillator subtracts a short-cutoff HPF output from a long-cutoff HPF output:

$$ \text{decyclerOsc}_t \;=\; \text{HPF}_{T_{\text{long}}}(x_t) \;-\; \text{HPF}_{T_{\text{short}}}(x_t) $$

The HPF with the longer cutoff passes a wider band of cycle content (everything above the long cutoff). The HPF with the shorter cutoff passes a narrower band (only the very short cycles). The difference is the band between the two cutoffs: a band-pass-like construction parameterized by two cycle endpoints.

For T_long = 60 and T_short = 20, the decycler oscillator passes cycles in the 20-to-60-bar band. The output is zero when the price is in pure trend mode (no cycle content in the 20-to-60-bar band) and oscillates with amplitude proportional to the cycle energy in that band when cycles are present.

This is a different construction from the direct BPF covered in the prior article. The BPF passes a symmetric band around a center period. The decycler oscillator passes the asymmetric band between two HPF cutoffs, which gives more control over where the band starts and stops at the cost of two HPF filters' worth of state.

The application is trend-transition detection. When the price is in strong trend mode, the decycler oscillator is near zero (the trend band lies below both HPF cutoffs). When the price enters cycle mode, the oscillator rises. The crossing of zero by the decycler oscillator marks the transition between trend and cycle regimes. That is the operational use case the construction was designed for.

Worked example: SPX trend extraction

SPX daily, 1990 to 2026. Compare four trend-line constructions plus the decycler oscillator.

$$ \begin{array}{l|c|c|c|c} \text{Construction} & \text{Cutoff} & \text{Lag (bars)} & \text{Cycle leakage (\%)} & \text{Use case} \\ \hline \text{EMA(50)} & \text{N/A} & 25 & 18 & \text{Generic trend} \\ \text{Decycler, HPF cutoff 30} & T=30 & 14.5 & 4 & \text{Cycle-aware trend} \\ \text{Decycler, HPF cutoff 60} & T=60 & 29.5 & 1 & \text{Long-term trend} \\ \text{Hann-window LPF, length 30} & T \approx 30 & 14 & 2 & \text{Smoother trend, no decycler} \\ \text{Decycler osc } (T_{\text{long}}=60,\, T_{\text{short}}=20) & \text{N/A} & 15 & \text{N/A} & \text{Trend-cycle transition} \\ \end{array} $$

Five readings.

The EMA(50) carries 18% residual cycle leakage by amplitude. The trend line wobbles with the residual cycle content even though the smoothing constant nominally rejects sub-50-bar oscillations. The 18% leakage is the EMA's known frequency-response limitation: it attenuates but does not cancel.

The decycler at T = 30 reduces leakage to 4% with lag of 14.5 bars (lower than the EMA(50)'s 25 bars). The cycle-aware framing matters: the trader specified a 30-bar cycle cutoff that matches the suspected dominant cycle band, and the resulting trend line is structurally cleaner with less lag.

The decycler at T = 60 pushes leakage to 1% at the cost of 29.5 bars of lag. A slower, smoother trend line useful for long-term regime identification.

The Hann-window LPF at length 30 achieves comparable leakage (2%) to the decycler at T = 30 with similar lag. The Hann window's sharper rolloff gives slightly better cycle rejection at comparable lag, but the recursive decycler form is cheaper (O(2) state vs O(30) for the Hann window's FIR coefficients) and updates in O(1) per bar.

The decycler oscillator (T_long = 60, T_short = 20) is not a trend line. It is a derived signal that oscillates with cycle content in the 20-to-60-bar band and crosses zero at trend-cycle transitions. Used as a feature for regime classification, not as a trend estimator.

Where the decycler genuinely wins

The decycler framing beats the EMA framing in three operational scenarios.

Scenario 1: the dominant cycle period is known. If daily SPX cycles in the 20-to-30-bar range are the main contaminant of the trend line, the decycler at T = 30 cancels them by construction. The EMA at any length attenuates but leaves residual energy. The cycle-aware construction wins on residual leakage at comparable lag.

Scenario 2: the cycle period changes regime. When the dominant cycle period drifts (markets cycle through 15-bar, 22-bar, and 35-bar phases), the decycler can be re-parameterized with a new cutoff that targets the current regime. The article "Dominant Cycle Estimation Without Astrology" gives the cycle-period estimator that feeds the decycler's cutoff. The adaptive construction is structurally cleaner than an EMA whose length needs to be re-tuned by hand.

Scenario 3: the trend-cycle transition is the primary signal. The decycler oscillator is the construction. No single EMA gives a trend-transition signal of comparable quality without a second filter for comparison.

In other scenarios (low cycle content, irregular cycles, very long-term trend) the EMA, Hann LPF, and decycler are operationally similar. The decycler does not give a free lag improvement when there is no cycle to cancel. The construction wins when the cycle band is identifiable and worth removing.

What this changes in practice

Four operational shifts.

The default trend extraction operation in the feature library is the decycler, not the EMA. Trend features carry their cycle-cutoff parameter explicitly: "decycler_close_T30" identifies the construction. EMA-based trend features are retained only for legacy compatibility or for cases where no clear cycle band exists.

The decycler oscillator replaces ad-hoc trend-transition heuristics (price crossing an MA, MA crossing another MA, MACD crossover) for regime classification. The construction has a principled cycle-band specification (T_long, T_short) instead of arbitrary lookback parameters.

Trend-vs-cycle decomposition in the data pipeline uses the identity x = decycler(x) + HPF(x). The decycler output feeds trend-mode features. The HPF output feeds cycle-mode features (after passing through a BPF or super-smoother as covered in the prior articles in this series). The two streams are processed by separate model heads and reconciled at the strategy layer.

Cycle-aware adaptive smoothing: the decycler's cutoff is driven by a dominant-cycle estimator (the article "Dominant Cycle Estimation Without Astrology" gives the construction). The trend line adapts to the cycle regime instead of using a fixed EMA length.

Decision matrix

Use case Recommended construction Reason
Generic trend smoothing, no clear cycle EMA or super-smoother Decycler has no advantage
Trend extraction, known cycle band Decycler at cycle period Cancellation beats attenuation
Long-term trend regime Decycler at T = 60-100 Aggressive cycle cancellation
Adaptive trend Decycler with cycle-estimator-driven T Adapts to drifting cycle period
Trend-cycle transition signal Decycler oscillator (T_long, T_short) Principled regime classifier
Real-time trend updates Decycler (O(2) state) Recursive, O(1) per bar
Cleanest possible trend, lag tolerated Hann-window LPF at long length Sharpest rolloff, but FIR cost
Cycle-mode features HPF or BPF, not decycler Decycler removes the signal of interest

Anti-patterns

Four mistakes that show up in decycler implementations.

Anti-pattern 1: using a decycler when no clear cycle exists. If the price has no dominant cycle in the band being cancelled, the decycler reduces to a generic LPF with no operational advantage. Use a Hann window or super-smoother (covered in the article "The Trader's Guide to Low-Pass Filters") instead.

Anti-pattern 2: setting the HPF cutoff too short. If T is shorter than the dominant cycle period, the HPF passes the cycle through and the decycler leaves the cycle in the trend output. The cutoff must be at or above the cycle period for cancellation to work.

Anti-pattern 3: treating the decycler oscillator as a tradeable signal directly. The oscillator is a regime classifier, not a price predictor. Strategies that trade the oscillator's value (long when above zero, short when below) without conditioning on regime are mis-using the construction. The oscillator selects the regime; a regime-specific strategy generates the trade.

Anti-pattern 4: assuming the decycler is "predictive" because it has less lag than an EMA at the same nominal length. The lag is real (14.5 bars at T = 30, not zero) and the article "No Filter Is Predictive: What Traders Misunderstand About Smoothing" covered the structural reason. The decycler is a backward-looking trend estimator with reduced cycle leakage. It is not a forecaster.

Visualizing the decycler

The four-panel figure makes the decycler argument visible. The two trend lines in panel (b) show the EMA's leakage vs the decycler's cancellation. The frequency-response panel shows the structural reason.

KEY POINTS

  • The decycler extracts the trend by subtracting the cycle (HPF output) from the input, rather than by smoothing the input directly.
  • The transfer function 1 − H_HPF is algebraically a 1-pole LPF. The decycler and the equivalent LPF produce the same output.
  • The framing matters even when the math is identical: the decycler is parameterized by a cycle cutoff period (interpretable) while an EMA is parameterized by a smoothing constant or lookback (arbitrary).
  • The identity x = decycler(x) + HPF(x) partitions the input into trend and cycle. This is the structural decomposition that feeds separate trend-mode and cycle-mode features in the data pipeline.
  • The decycler oscillator (HPF_long minus HPF_short) is a band-pass-like construction parameterized by two cycle endpoints. Use it as a trend-cycle regime classifier, not as a tradeable signal directly.
  • On SPX, the decycler at HPF cutoff T = 30 reduces residual cycle leakage from EMA(50)'s 18% to 4%, at lower lag (14.5 vs 25 bars).
  • The decycler wins over the EMA in three scenarios: known dominant cycle, drifting cycle that benefits from adaptive cutoff, and trend-cycle transition signals. In other scenarios the constructions are operationally similar.
  • The HPF cutoff must be at or above the dominant cycle period for cancellation to work. Cutoff shorter than the cycle leaves the cycle in the trend output.
  • The decycler is not predictive. It is a backward-looking trend estimator with reduced cycle leakage. Use it for state estimation, not for forecasting.
  • Default trend extraction in the feature library is the decycler with explicit cycle-cutoff parameter. EMA-based trend features are retained for legacy compatibility only.
  • Replace ad-hoc trend-transition heuristics (MA crossovers, MACD zero crossings) with the decycler oscillator, which has a principled cycle-band specification.