Skip to content
All library documents

Kalman Filter Pairs Trading with a Dynamic ETF Hedge Ratio

Article QuantStart

Summary

This article describes a mean-reversion strategy trading the spread between TLT, a long-duration Treasury ETF, and IEI, an intermediate-duration Treasury ETF. A recursive Kalman filter estimates a time-varying linear relationship between the pair, along with the prediction error and its variance. The strategy enters a long or short spread position when the error crosses a band set by one standard deviation of forecast uncertainty, and exits when the error returns across the corresponding threshold. Position quantities use the estimated hedge ratio, rounded to whole ETF units.

The article outlines implementing the signal logic in QSTrader, which handles market data, portfolio positions, and orders. It discusses synchronizing daily price events so both ETF observations are available before updating the filter. Filter noise parameters and trade size are fixed in the example, while the backtest relies on historical daily bars spanning 2009 to 2016. The text explains the method and implementation but provides no clear performance results in the supplied excerpt. Fixed parameters, a chosen band, transaction costs, and the assumption that the spread mean-reverts all limit how broadly the example can be interpreted.

Key ideas

  • The Kalman filter updates the pair’s hedge ratio as new ETF prices arrive.
  • Forecast errors measure departures from the relationship estimated for the two ETFs.
  • The strategy uses forecast uncertainty to set entry and exit thresholds for spread positions.
  • Long and short spread trades take opposite positions in TLT and IEI according to the estimated hedge ratio.
  • Fixed model parameters and assumed mean reversion require validation, and the supplied excerpt does not establish profitability.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.