Skip to content
All library documents

Building and Backtesting a Rolling Vector Autoregression Trading Model

Article Robot Wealth

Summary

This article demonstrates a vector autoregression (VAR) model using daily returns for a basket of U.S. homebuilding stocks. It fits the model on a rolling historical window, forecasts each asset’s next return, and converts the cross-sectional forecasts into dollar weights by centering them on their mean and normalizing their absolute values. The example then applies those weights to subsequent returns to form a portfolio series.

The document shows one-step forecasts alongside actual returns, forecast and actual rankings, a sample set of portfolio weights, and code for a rolling backtest. It also compares cumulative return paths using several historical window lengths. These examples illustrate the workflow but do not establish that the strategy is profitable or robust: no performance statistics, transaction costs, or risk analysis are reported. The article’s opening sections announce topics such as lag selection and trading challenges, but the supplied text does not explain them in detail. Its evidence is therefore limited to a code example and a plotted backtest comparison.

Key ideas

  • A VAR models the relationships among multiple return series and can produce one-step forecasts for each asset.
  • The example translates relative forecast values into normalized long and short portfolio weights.
  • A rolling estimation window allows the forecast and weights to be updated through time.
  • Comparing multiple window lengths illustrates sensitivity to a key model choice.
  • The backtest example omits costs and risk measures, so its plotted returns do not establish practical profitability.

Tags

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