WiseTrader Toolbox

CyberCycle

Background

The Cyber Cycle is one of John Ehlers' cycle oscillators (from Cybernetic Analysis for Stocks and Futures). It first lightly smooths price, then applies a second-difference filter that strips out the trend and leaves behind the oscillating cycle component swinging above and below zero. Traders use it the way they use any cycle oscillator: zero-line crossings and turning points flag the rhythm of the market, and it is especially useful for timing entries and exits inside a ranging, cyclic market.

Its responsiveness is set by a single smoothing constant, Alpha, rather than a period. A small alpha produces a smooth, slow cycle; a larger alpha makes it quicker and noisier. Roughly, alpha plays the same role that the length does in a conventional oscillator.

Included formula

The toolbox ships a ready-made Cyber Cycle indicator, so you can use it straight away. In AmiBroker open the Charts window, expand the WiseTraderToolbox group and drag Cyber Cycle onto a price chart.

It plots the cycle together with a one-bar-lagged copy of itself, as a fast/slow pair, and marks a buy where the cycle crosses above the lag and a sell where it crosses below. The same formula can be run as an Exploration from the Analysis window to scan a watchlist for the latest signal. Its parameters let you change the smoothing, the line colours, whether the signal arrows are shown, and let you compare against a second symbol.

Note

The included chart calculates the cycle on the median price, (H+L)/2, with Alpha defaulting to 0.2. These are just starting points; adjust them to suit the market you trade.

The exported function

If you would rather build your own formula, the toolbox exports the cycle as a single AFL function you can call directly — it is the engine inside the included chart.

CyberCycle(Price, Alpha)
ParameterDescription
Price The price array the cycle is calculated on. You can pass an already-smoothed series if you wish. It must not contain empty/null values at the left edge of the data.
Alpha A smoothing constant between 0 and 1 that controls responsiveness — it plays the same role as a period in other oscillators. Smaller values give a smoother, slower cycle; larger values react faster. Must be 0 or greater.

Returns a per-bar array holding the cycle oscillator, centred around zero.

cycle = CyberCycle( Close, 0.07 );
Plot( cycle, "Cyber Cycle", colorBlue );
Plot( 0, "", colorGrey50, styleNoLabel );      // zero reference line
Tip

Treat upward zero-line crossings as the cycle turning up and downward crossings as it turning down. Lower Alpha if the oscillator is too noisy, raise it if it reacts too slowly.