Cybernetic Trading Indicators: John Ehlers DSP Filters and Cycle Tools in Pine Script

John Ehlers applies digital signal-processing methods to market indicators. Low-pass, high-pass and combined filters emphasize different frequency ranges. Their response depends on the coefficients, sampling interval and initialization; filtering does not establish a predictable market cycle or eliminate trading losses.

Digital signal processing for markets

Inspect the frequency response and the implementation

A smoother trades responsiveness against attenuation. A named cutoff describes the filter design, not a guarantee that the market follows a cycle of that length.

SuperSmoother
A recursive low-pass design. Compare attenuation, delay and startup behavior with a specified baseline.
Roofing filter
Combines high-pass and low-pass stages. Its raw output is not automatically bounded or statistically stationary.
Decycler
Subtracts a high-pass component from price. The published Decycler Oscillator adds another filtering and scaling step.
Evaluation
Test known input sequences and signal timestamps before measuring a trading rule.

Cybernetic indicators require exact mathematical coefficients. Coefficient errors can distort frequency responses and introduce instability.

Identify the published variant

Cybernetic Analysis for Stocks and Futures and Ehlers's later articles contain multiple filters and oscillators. A name alone does not specify the equation. Record the publication, pole count, source, cutoff, initialization and any later modifications.

A trend-plus-cycle-plus-noise decomposition is a modeling choice. It does not demonstrate that observed prices contain stable, separately identifiable cycles. A filter can attenuate selected frequencies while still lagging, overshooting or producing repeated crossings.

Distinguish the filter families

A SuperSmoother is a low-pass filter; a Roofing construction applies high-pass and low-pass stages to emphasize an intermediate frequency range. Attenuation is frequency-dependent, not complete removal of everything called noise. A cutoff does not certify that a crossing represents a structural market turn.

The simple Decycler subtracts a high-pass result from price. The September 2015 published Decycler Oscillator applies a further high-pass stage to that decycled series and scales the result relative to price. It is not simply price minus the Decycler. Neither construction proves future direction.

Check the SuperSmoother recurrence

For the two-pole variant below, the coefficient on the second previous filter output is negative: −a². The input term averages the current and previous source. These details differ from an arbitrary three-input recurrence and materially affect the response.

The example uses radians and a cutoff of at least three bars. It seeds the first two observations from the source, then applies the recurrence. This explicit seed can differ from another implementation's early values. It plots a filter, not entry signals or a strategy.

Two-pole filter demonstration; no trading signalspine
//@version=6
indicator("Two-pole SuperSmoother: explicit seed", overlay=true)
source = input.source(close, "Source")
cutoff = input.int(10, "Cutoff period", minval=3)
angle = math.sqrt(2.0) * math.pi / cutoff
a = math.exp(-angle)
c2 = 2.0 * a * math.cos(angle)
c3 = -a * a
c1 = 1.0 - c2 - c3
var float filtered = na
if na(source)
    filtered := na
else if na(source[1]) or na(filtered[1]) or na(filtered[2])
    filtered := source
else
    filtered := c1 * (source + source[1]) / 2.0 + c2 * filtered[1] + c3 * filtered[2]
plot(filtered, "SuperSmoother", color=color.blue, linewidth=2)

Validate numbers before trading signals

Test a constant input, a single impulse and a step change in an independent numerical implementation. A constant source with matching initial states should remain constant because the coefficients sum to one. Inspect the step response for delay and overshoot instead of claiming that either is absent.

For cutoff 10, approximate coefficients are c1 = 0.253195, c2 = 1.158046 and c3 = −0.411241. With current and previous inputs both 100 and both prior filter states 100, the next output remains 100. This arithmetic checks the recurrence, not a trading advantage.

Define realtime behavior separately

On an indicator's forming bar, its source and filtered output can change with incoming updates. Confirmed-bar alerts and provisional intrabar signals are different designs. A higher-timeframe request also needs its own confirmation policy; closing the chart bar does not finalize the higher-timeframe bar.

The AI Coding Agent can draft an implementation from a named formula and explicit requirements. Request syntax validation, compare numerical values against the source formula and test alert timing. Generated code is not automatically mathematically verified or ready for unattended execution.

How Pineify helps

Use the Pine Script AI Coding Agent to draft a specified DSP formula, then request syntax validation and compare the numerical output with an independent reference. A compiler check cannot establish the formula's accuracy or profitability.

This page is for educational and informational purposes only and does not constitute investment advice. Digital signal processing filters and cybernetic indicators do not guarantee profitable market results. Always test your strategies on historical data.

Frequently asked questions

Do cybernetic indicators eliminate lag?

No universal zero-lag claim is supported. Delay and attenuation depend on frequency and design, and a responsive output can still produce false signals.

Is the SuperSmoother a strategy?

No. It is a filter calculation. A strategy needs separate entries, exits, sizing and execution assumptions.

Is a Roofing output always bounded?

No. The raw filtered output has no fixed oscillator range unless a separate normalization imposes one.

Is the Decycler Oscillator just price minus the Decycler?

No. The published September 2015 construction adds a high-pass stage to the decycled series and scales its result.

Does syntax validation verify the mathematics?

No. It checks accepted Pine syntax and supported constructs. Numerical and timing behavior require separate checks.