SuperSmoother

The SuperSmoother of John Ehlers is a low-pass filter that removes the cycles shorter than its critical period n with far less lag than a moving average of the same length. Angles are in degrees.

The formula for the SuperSmoother, in its two-pole form (Ehlers, 2013), first sets its coefficients \(a_{2}\) and \(b_{2}\) from the critical period n:

\[a_{2} = \exp\left(-\frac{\sqrt{2} \cdot \pi}{n}\right)\] \[b_{2} = 2 \cdot a_{2} \cdot \cos\left(\frac{\sqrt{2} \cdot 180}{n}\right)\]

The filter then averages the last two prices and adds its own last two values:

\[\text{Two Pole Filter} = \frac{\left(1 - b_{2} + a_{2}^{2}\right) \cdot (\text{Price} + \text{Price}_{t-1})}{2} + b_{2} \cdot \text{Two Pole Filter}_{t-1} - a_{2}^{2} \cdot \text{Two Pole Filter}_{t-2}\]

In its three-pole form (Ehlers, 2004), the SuperSmoother sets its coefficients \(a_{3}\) and \(b_{3}\) from the same critical period n:

\[a_{3} = \exp\left(-\frac{\pi}{n}\right)\] \[b_{3} = 2 \cdot a_{3} \cdot \cos\left(\frac{\sqrt{3} \cdot 180}{n}\right)\]

The filter then adds its own last three values to the price:

\[\text{Three Pole Filter} = \left(1 - b_{3} + b_{3} \cdot a_{3}^{2} - a_{3}^{4}\right) \cdot \text{Price} + \left(b_{3} + a_{3}^{2}\right) \cdot \text{Three Pole Filter}_{t-1} - \left(a_{3}^{2} + b_{3} \cdot a_{3}^{2}\right) \cdot \text{Three Pole Filter}_{t-2} + a_{3}^{4} \cdot \text{Three Pole Filter}_{t-3}\]

Where Price is the close and Price(t-1) the close of the period before. Averaging the last two prices removes the two-period cycle completely; the three-pole filter is smoother at the cost of more lag. The SuperSmoother shows the trend and the longer cycles, and Ehlers uses it as the smoothing step of most of his later indicators.

A moving average smooths the price by averaging it over the last n periods, so that the trend shows through the noise of single periods. It is the oldest and most widely used trend indicator: the direction of the average shows the direction of the trend, the price above (below) it an uptrend (downtrend), and other indicators, from the MACD to the Bollinger Bands, are built on it. Every moving average trades smoothness against lag: the more periods it averages, the smoother it is and the later it turns after the price. The averages differ in how they weight the prices within the window and whether they adapt their speed to the market, each a different answer to that trade-off.

Also known as: SSF, super smoother filter, Ehlers’ SuperSmoother.

In the Finance Toolkit this is get_moving_average with method="super_smoother", the same function as Moving Average.

Example · ^GSPC · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_moving_average:

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["^GSPC"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_moving_average(method="super_smoother", window=50)

Which returns:

References

  • Paper Ehlers, J.F. (2004). “Cybernetic Analysis for Stocks and Futures.” John Wiley & Sons.
  • Paper Ehlers, J.F. (2013). “Cycle Analytics for Traders: Advanced Technical Trading Concepts.” John Wiley & Sons.
  • Paper Ehlers, J.F. (2014). “Predictive And Successful Indicators.” Technical Analysis of Stocks & Commodities, 32(1), 16-25.
  • Library Referenced against pandas-ta-classic’s ssf (SuperSmoother)
Share