Forecasting with HoltWinters Exponential Smoothing

Forecasting with HoltWinters Exponential Smoothing

By Jacques Joubert

I recently enrolled in the QuantInsti Executive Programme in Algorithmic Trading and one of the areas in quantitative finance that interests me greatly is the analysis of financial time series. During the course we will take on a massive project to build our own trading strategy with the help of a mentor, and in attempt to familiarize myself with the work, I built this simple strategy using the HoltWinters exponential smoothing.

I hope that others may find this useful. I learnt a great deal from writing the following blog post:

  1. Build an indicator to forcast a share 1 day into the future using the HoltWinters Exponential Smoothing method.
  2. Backtest the strategy and show performance metrics

About HoltWinters exponential smoothing

“The Holt-Winters method was suggested by Holt (1957) and Winters (1960), who were working in the School of Industrial Administration at Carnegie Institute of Technology, and uses exponentially weighted moving averages to update estimates of the seasonally adjusted mean (called the level ), slope, and seasonals. The” (Introductory Time Series with R, By Paul S.P. Cowpertwait, Andrew V. Metcalfe)

Getting Starterd

We will make use of the following packages

Get closing price data for the S&P500 from Yahoo Finance

Set up the function to predict the returns one day forward and return 1 for a long and -1 for a short


Generate a List of signals for the closing price data

Calculate the Change in Price for the underlying Asset which is the S&P500 in this case

Next calculate the daily returns for our portfolio

Strategy Reporting

returns Performance

To the Readers:

If you are looking to learn more, I recommend the following book:

Analysis of Financial Time Series

Leave a Reply

Your email address will not be published. Required fields are marked *