John Ehlers in Rocket Science for Traders and Cybernetic Analysis for Stocks and Futures detailed the Ultimate Smoother study. The study is a two-pole low-pass digital filter designed to smooth price data while introducing significantly less lag than traditional moving averages.
In the image above there are three studies applied to smooth the data. All three are using 20-periods for the length of the study. There is the Ultimate Smoother, the Simple Moving average, and the Exponential Moving Average. Visually, the Ultimate Smoother more closely tracks the price action.
The Ultimate Smoother is:
- A recursive digital filter (IIR filter)
- Optimized to minimize lag for a given level of smoothness
- Superior to the EMA, SMA, and many adaptive averages
And unlike adaptive MAs, it does not change parameters dynamically - its advantage comes from filter design, not adaptation.
Inputs:
- Pt: price (Close, Median, etc.)
- N: smoothing period
Constants:
- a = e(-1.414π/N)
- b = 2acos (1.414π/N)
Recursive Filter Equation:

This is a 2-pole Butterworth-style filter.
The Code below is from the CQG Formula Builder (and is included in the downloadable CQG PAC):
p:= Close(@);
f:= (1.414*3.14159)/len;
a:= Exponential(-f);
c2:= 2*a*Cos(f);
c3:= -a*a;
c1:= 1-c2-c3;
ssmooth:= c1*(p+p[-1])*0.5+c2*(ssmooth[-1])+c3*(ssmooth[-2]);
Why it's "Ultimate":
- Compared to the EMA with the same period the Ultimate Smoother has lower lag, is smoother and should result in less whipsaws.
- The Ultimate Smoother achieves maximum smoothness for minimum delay, which is the theoretical goal of a low-pass filter.
Included with the post is a CQG PAC produced by CQG Product Specialist Valeriy Alekseyev that installs a page with charts and the Ultimate Smoother study.
Requires CQG Integrated Client or CQG QTrader. This post was assisted by AI and reviewed by Thom Hartle.

