Skip to content
All library documents

Backtesting Momentum Models Across Rolling Windows

Code Stratmill research code

Summary

This code manages backtest outputs for momentum experiments. It reads results from multiple train and test intervals, aggregates captured returns, and can rescale those returns to a target volatility. It calculates performance summaries that include return, volatility, Sharpe and Sortino ratios, drawdown, and profit-loss measures, with results grouped across asset classes and cost assumptions. Yearly Sharpe ratios are also collected for reporting.

The document additionally defines a classical intermediate momentum position as a weighted combination of the signs of normalized monthly and annual returns. In the shown classical-method routine, the weight is set to zero, so positions follow the annual signal; a long-only comparison is also produced from the same returns. These outputs are saved for later analysis. The excerpt is partial and omits parts of the aggregation workflow, while the code itself supplies no performance findings. It describes research plumbing and benchmark construction, not evidence that the momentum approach is profitable; the shown section also does not establish how costs, data quality, or model selection are handled throughout the full experiment.

Key ideas

  • The workflow aggregates captured returns and metrics across train and test windows.
  • It can rescale combined returns using estimated annual volatility and a target volatility level.
  • Reported measures include risk-adjusted performance, drawdown, and return-distribution summaries.
  • The classical position blends monthly and annual return signs, while the shown run uses the annual signal alone.
  • A long-only return series provides a basic comparison, but the excerpt reports no results.

Tags

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