Skip to content
All library documents

Preparing Momentum Features with Volatility Scaling and Change Points

Code Stratmill research code

Summary

This data-preparation workflow builds model inputs for a momentum strategy from asset closing prices. It clips prices using bounds based on an exponentially weighted mean and standard deviation, derives daily returns and volatility, and creates a next-period target by scaling returns for volatility. It also calculates returns over several horizons, normalizes them by daily volatility and horizon length, and adds MACD signals and calendar features.

Separate functions load change-point detection outputs for multiple assets, forward-fill missing results, and calculate normalized change-point locations from the lookback length. Those features can then be joined to the momentum inputs by date and ticker. The document provides implementation details but no backtest or evidence that these features improve forecasts. Its price filter uses a permissive OR condition, and the code does not explain choices such as the clipping parameters, signal windows, or data alignment safeguards; the next-period target also requires care to avoid leakage when training models.

Key ideas

  • Exponentially weighted bounds are used to limit extreme prices before calculating returns.
  • Volatility-scaled next-period returns serve as the model target.
  • Returns across multiple horizons are normalized by daily volatility and horizon length.
  • MACD signals, calendar fields, and change-point measures expand the feature set.
  • Missing change-point values are forward-filled before their normalized locations are recomputed.

Tags

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