Skip to content
All library documents

Interpreting a Momentum Factor Based on Intermediate- and Long-Term Returns

Article Quant Q&A · Author: Validus Oculus

Summary

The document presents a Quantopian-style equity momentum factor formula and asks why it appears to assign a negative score when recent returns exceed longer-term returns. The calculation compares a price return measured from roughly one year earlier to a point one month earlier with the most recent one-month return, then scales the difference by the standard deviation of returns. This is a volatility-normalized measure of intermediate-term performance relative to the latest month.

The question arises because the sign convention may differ from the intuitive idea of ranking securities by strongest momentum. The snippet alone does not include an answer or resolve whether the formula is intended to reward reversal of the latest month, how the resulting signal should be ranked, or whether its implementation is correct. It therefore offers a useful prompt about factor definition and direction, but no empirical evidence, backtest, or explicit trading conclusion.

Key ideas

  • The factor compares a long measurement period ending one month ago with the latest one-month return.
  • The return difference is divided by return volatility to normalize the signal.
  • The question concerns how the formula’s sign maps to the intended long and short rankings.
  • The document provides code and a question but no resolution, validation, or performance evidence.

Tags

Full text
# How momentum factor is calculated?


# How momentum factor is calculated?












I got following code from the Quantopian Lecture about factor investing. Following is calculating momentum factor. Earlier in the lecture, instructor told that, we will sort the securities based on their factor score and go long on top quantile and short on bottom quantile. I think formula is wrong because if short-term return is greater than long-term return, we will get negative momentum factor score.

What I am missing here?

```
class MyFactor(CustomFactor):
        """ Momentum factor """
        inputs = [USEquityPricing.close,
                  Returns(window_length=126)]
        window_length = 252

        def compute(self, today, assets, out, prices, returns):
            out[:] = ((prices[-21] - prices[-252])/prices[-252] -
                      (prices[-1] - prices[-21])/prices[-21]) / np.nanstd(returns, axis=0)
```
```

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

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