WiseTrader Toolbox

Cycle Engines (Spectral Estimators)

Background

Several of the cycle indicators in the toolbox do not just run one fixed algorithm. Internally they all need the same two things from the price series: an estimate of the dominant cycle (how many bars the market is currently swinging over), and a clean, band-limited reconstruction of that swing that the indicator can build its output from. There is more than one way to measure those, and each method has its own personality — some react faster, some are smoother, some give a cleaner reading when the market is noisy.

Rather than ship a separate indicator for every method, the toolbox lets five indicators take an optional Engine argument that picks which estimator does the work. The five engine-aware indicators are DominantCycle, SineWave, InstantTrendline, HilbertOscillator and EnhancedSignalNoiseRatio. They all accept the same engine codes, so you can write your formula once and audition the different estimators by changing a single number.

Note

The Engine argument is optional. If you leave it out, you get engine 0 (Homodyne) — the original, low-lag Ehlers behaviour — so existing formulas keep working exactly as before.

Choosing an engine

CodeNameBest for
0Homodyne discriminator (default) The everyday choice. Low lag, smooth, and what every cycle indicator used historically. Use it unless you have a reason not to.
1Ehlers alpha Dominant Cycle A simpler phase-accumulation cycle read whose responsiveness you tune by hand with the Alpha argument. The only engine that uses Alpha.
2Autocorrelation periodogram ("Mesa") A full spectral read. Steady and well-behaved on real markets; the open basis of Ehlers' MESA approach. Also provides a real signal/noise spectrum.
3Burg maximum-entropy spectrum Highest frequency resolution and no spectral leakage — the best engine for separating two cycles that sit close together. Also provides a signal/noise spectrum.
4Kalman cycle tracker The lowest lag and the fastest to adapt when the cycle length changes, because it tracks a per-bar period with no fixed analysis window. Also provides a signal/noise spectrum.
5Concentrated-taper periodogram ("Multitaper") The cleanest, steadiest noise floor — best when you care most about a stable reading in choppy data. Also provides a signal/noise spectrum.

The engines in plain English

0 — Homodyne discriminator (default)

This is John Ehlers' classic instantaneous-cycle measurement. It treats price like a radio signal, splits it into in-phase and quadrature components with a short filter, and reads how fast the phase is turning to get the current cycle length. It is fast to respond, naturally smooth, and the historical default for every cycle indicator in the toolbox. When you call an engine-aware indicator without an Engine argument, this is what runs.

1 — Ehlers alpha Dominant Cycle

A lighter-weight cycle read, also from Ehlers, that accumulates phase and uses a single smoothing constant, Alpha, to decide how quickly it reacts. A small alpha gives a smooth, sluggish period; a larger one gives a twitchier, faster one. This is the only engine that pays attention to the Alpha argument — every other engine ignores it.

2 — Autocorrelation periodogram ("Mesa")

Instead of reading a single instantaneous period, this engine builds a whole power spectrum every bar. It first passes price through a roofing filter (a band-pass that strips out the long trend and the high-frequency jitter), measures how strongly the filtered series correlates with delayed copies of itself, and turns that into a spectrum showing how much energy sits at each cycle length. The dominant cycle is then read as the power-weighted centre of that spectrum, which keeps it smooth. This is the published, open basis of Ehlers' MESA methodology — it is not a clone of the proprietary MESA9 product.

3 — Burg maximum-entropy spectrum

Burg is the original meaning of "MESA" — Maximum Entropy Spectral Analysis. Rather than correlating the series with itself, it fits a small predictive (auto-regressive) model to a trailing window of the roofed price and reads the spectrum off that model. The payoff is sharper frequency resolution and no spectral leakage, so when two cycles sit close together this engine is the most likely to tell them apart. The model is built with Burg's lattice recursion, which is unconditionally stable, so the spectrum never blows up.

4 — Kalman cycle tracker

This engine reads a per-bar cycle length from a quadrature demodulation of the roofed price (similar in spirit to the Homodyne engine) and then smooths it with a Kalman filter — a tracker that balances the new measurement against its own prediction to give a low-lag result. Because it carries a running estimate rather than re-analysing a fixed block of history every bar, it is the lowest-lag engine and the quickest to catch on when the market's cycle length actually changes.

5 — Concentrated-taper periodogram ("Multitaper")

This engine also builds a spectrum every bar, but before transforming the window it multiplies it by a single specially-shaped taper (a Slepian/DPSS-style window) that concentrates the signal's energy and suppresses spectral leakage. The result is the cleanest, steadiest noise floor of any engine, so a real cycle stands out clearly and the reading does not jitter from bar to bar.

Note

The "Multitaper" name is kept only for naming consistency. This engine uses a single concentrated taper for leakage suppression, not an average of many tapers — testing showed that adding more tapers actually degraded the cycle reading in this pipeline.

Engines and the spectral SNR

Engines 2, 3, 4 and 5 all build a genuine power spectrum, so they can also report a real signal power and noise floor. The EnhancedSignalNoiseRatio indicator uses exactly that pair to produce a true decibel signal-to-noise reading when you select one of these engines. Engine 0 (Homodyne) falls back to Ehlers' original amplitude-versus-range SNR estimate instead, and engine 1 (Ehlers alpha) has no spectrum and therefore no SNR at all.

Usage

// Read the dominant cycle three different ways and compare.
homodyne   = DominantCycle( Close );        // engine 0 (default)
burg       = DominantCycle( Close, 3 );     // engine 3 (Burg, sharpest)
kalman     = DominantCycle( Close, 4 );     // engine 4 (Kalman, lowest lag)

Plot( homodyne, "Homodyne", colorRed );
Plot( burg,     "Burg",     colorBlue );
Plot( kalman,   "Kalman",   colorGreen );
Tip

Start with the default Homodyne engine. Switch to Burg (3) when you need to resolve closely spaced cycles, Kalman (4) when lag matters most, or Multitaper (5) when you want the steadiest reading in noisy markets.

Warning

The spectral engines (2–5) need a long warm-up before their first valid value — roughly 50 to 100 bars — and leave the leading bars empty. Make sure your chart or scan has enough history before relying on their output.