Holt-Winters Moving Average

The Holt-Winters Moving Average (HWMA) applies the exponential smoothing of Holt (1957) and Winters (1960), which smooths the level and the trend of a series separately, to the price, with the acceleration of the price as a third part, and adds the three up into a forecast of the next price.

The formula for the Holt-Winters Moving Average smooths the level F towards the close, with the smoothing factor alpha, starting from the level the velocity V and acceleration A of the period before project:

\[F = (1 - \alpha) \cdot (F_{t-1} + V_{t-1} + 0.5 \cdot A_{t-1}) + \alpha \cdot \text{Close}\]

It smooths the velocity V towards the change of the level, with the smoothing factor beta, and the acceleration A towards the change of the velocity, with the smoothing factor gamma:

\[V = (1 - \beta) \cdot (V_{t-1} + A_{t-1}) + \beta \cdot (F - F_{t-1})\] \[A = (1 - \gamma) \cdot A_{t-1} + \gamma \cdot (V - V_{t-1})\]

The average is the level projected one step ahead:

\[\text{HWMA} = F + V + 0.5 \cdot A\]

Where alpha, beta and gamma lie between 0 and 1; larger values make each part follow the price more closely. Because it projects the trend forward, the HWMA has little lag in a steady trend, but it overshoots the price when the trend turns.

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: HWMA, Holt-Winter moving average.

In the Finance Toolkit this is get_moving_average with method="holt_winters", 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="holt_winters", window=50)

Which returns:

References

  • Paper Holt, C.C. (1957). “Forecasting Seasonals and Trends by Exponentially Weighted Moving Averages.” ONR Memorandum 52, Carnegie Institute of Technology (reprinted in the International Journal of Forecasting, 20(1), 2004).
  • Paper Winters, P.R. (1960). “Forecasting Sales by Exponentially Weighted Moving Averages.” Management Science, 6(3), 324-342.
  • Paper MQL5 Code Base: HWMA (https://www.mql5.com/en/code/20856).
  • Library Referenced against pandas-ta-classic’s hwma (Holt-Winters Moving Average)
Share