SignalNoiseRatio
Background
Cycle measurements are only trustworthy when there is actually a cycle present. The Signal-to-Noise Ratio (SNR), from John Ehlers' Rocket Science for Traders, estimates how strong the detected cycle is relative to the bar-to-bar range "noise" of the market, expressed in decibels. A high SNR means a clean, tradeable cycle; a low SNR means the market is mostly noise and cycle-based signals should be treated with caution.
This is the classic, lightweight SNR: it compares the amplitude of the in-phase and quadrature cycle components (from the homodyne discriminator) against a smoothed measure of the high-low range. Traders use it both as a confidence filter — only act on cycle signals when SNR is healthy — and as a fine-tuning input, nudging an adaptive indicator's period as the ratio rises and falls.
Included formula
The toolbox ships a ready-made Signal Noise Ratio indicator, so you can use it without writing any code. In AmiBroker open the Charts window, expand the WiseTraderToolbox group and drag Signal Noise Ratio onto a chart.
It plots the signal-to-noise ratio, in decibels, in its own pane below price; read it as a confidence gauge — the higher the reading, the cleaner the cycle. The line colour is set from the indicator's parameters.
The exported function
If you would rather build your own formula, the toolbox exports the calculation as a single AFL function you can call directly — it is the engine inside that indicator.
SignalNoiseRatio()
This function takes no arguments. It reads the current symbol's High and Low directly and returns a per-bar array of the signal-to-noise ratio in decibels.
Usage
snr = SignalNoiseRatio();
Plot( snr, "Signal/Noise (dB)", colorBlue );
Plot( 6, "", colorGrey50, styleDashed | styleNoLabel ); // a typical "tradeable" threshold
// Only take cycle signals when the cycle is strong enough
cycleIsClean = snr > 6;
For a sharper, spectrum-based measurement that can also draw on the Burg, Kalman and Multitaper engines, see EnhancedSignalNoiseRatio.