Momentum

Haiyue
9min

I. What is the Momentum Indicator

The Momentum indicator (MOM) is the most fundamental momentum indicator in technical analysis, directly calculating the difference between the current price and the price nn periods ago to measure the speed and direction of price change. As the simplest way to measure momentum, it is the conceptual foundation for many complex indicators (such as ROC and MACD).

Historical Background

The concept of momentum originates from the principle of “inertia” in physics — an object in motion tends to stay in motion. In financial markets, this concept dates back to at least the early 20th century in technical analysis practice. The Momentum indicator has no single identifiable inventor; it is a basic tool that naturally evolved from the technical analysis community’s long-term practice. As the most primitive measure of “rate of price change,” Momentum is the ancestor of all momentum-class indicators.

Indicator Classification

  • Type: Oscillator, displayed in a separate panel
  • Category: Momentum
  • Default Parameters: Period n=10n = 10, data source is Close price
  • Value Range: Unbounded, oscillates around the zero line
Momentum vs ROC

Momentum is an absolute difference (in price units), while ROC is a percentage change (%). Both have identical shapes, differing only in scale. For assets with large price differences (e.g., Bitcoin vs stocks), ROC is better suited for cross-comparison.


II. Mathematical Principles and Calculation

Core Formula

MOMt=CtCtnMOM_t = C_t - C_{t-n}

Where:

  • CtC_t = current closing price
  • CtnC_{t-n} = closing price nn periods ago
  • nn = lookback period (default 10)

Step-by-Step Calculation Logic

  1. Determine lookback period nn (e.g., 10)
  2. Get current closing price CtC_t
  3. Get closing price nn periods ago CtnC_{t-n}
  4. Subtract: MOM=CtCtnMOM = C_t - C_{t-n}

Mathematical Meaning

Momentum is essentially a first-order difference (discrete derivative) generalized to a larger step size:

  • First-order difference: ΔP=PtPt1\Delta P = P_t - P_{t-1} (step size of 1)
  • Momentum: MOM=PtPtnMOM = P_t - P_{t-n} (step size of nn)

It measures the net change in price over nn periods.

Value Interpretation

MOM ValueMeaning
MOM > 0Current price is above the price nn periods ago, in an upward state
MOM = 0Current price equals the price nn periods ago, no net change
MOM < 0Current price is below the price nn periods ago, in a downward state
MOM increasingUpward acceleration (or downward deceleration)
MOM decreasingUpward deceleration (or downward acceleration)
Leading Characteristic

The Momentum indicator is considered a “Leading Indicator” because changes in price momentum typically precede changes in price direction. For example, during an uptrend, momentum begins to decline from its peak before the price starts to pull back.


III. Python Implementation

import numpy as np
import pandas as pd


def momentum(close: pd.Series, period: int = 10) -> pd.Series:
    """
    Calculate the Momentum indicator

    Parameters
    ----------
    close : pd.Series
        Close price series
    period : int
        Lookback period, default 10

    Returns
    -------
    pd.Series
        Momentum values
    """
    return close - close.shift(period)


def momentum_numpy(close: np.ndarray, period: int = 10) -> np.ndarray:
    """
    Manual Momentum implementation using numpy
    """
    n = len(close)
    result = np.full(n, np.nan)
    for i in range(period, n):
        result[i] = close[i] - close[i - period]
    return result


# ========== Usage Example ==========
if __name__ == "__main__":
    np.random.seed(42)
    dates = pd.date_range("2024-01-01", periods=100, freq="D")
    price = 100 + np.cumsum(np.random.randn(100) * 1.5)

    df = pd.DataFrame({
        "date": dates,
        "open":  price + np.random.randn(100) * 0.3,
        "high":  price + np.abs(np.random.randn(100) * 0.6),
        "low":   price - np.abs(np.random.randn(100) * 0.6),
        "close": price,
        "volume": np.random.randint(1000, 10000, size=100),
    })
    df.set_index("date", inplace=True)

    # Calculate Momentum with different periods
    df["MOM_5"]  = momentum(df["close"], period=5)
    df["MOM_10"] = momentum(df["close"], period=10)
    df["MOM_20"] = momentum(df["close"], period=20)

    print("=== Momentum Results (last 15 rows) ===")
    print(df[["close", "MOM_5", "MOM_10", "MOM_20"]].tail(15).to_string())

    # Zero line crossover signals
    df["signal"] = np.where(
        (df["MOM_10"] > 0) & (df["MOM_10"].shift(1) <= 0), 1,    # Cross above zero
        np.where(
            (df["MOM_10"] < 0) & (df["MOM_10"].shift(1) >= 0), -1, 0  # Cross below zero
        )
    )

    cross_points = df[df["signal"] != 0]
    print("\n=== Zero Line Crossover Signals ===")
    print(cross_points[["close", "MOM_10", "signal"]].to_string())

    # Momentum acceleration/deceleration
    df["MOM_accel"] = df["MOM_10"].diff()  # First difference of Momentum = acceleration
    print("\n=== Momentum Acceleration (last 10 rows) ===")
    print(df[["close", "MOM_10", "MOM_accel"]].tail(10).to_string())

IV. Problems the Indicator Solves

1. Price Change Direction

The most direct use — determining whether price is rising or falling:

  • MOM > 0 — rising
  • MOM < 0 — falling

2. Zero Line Crossover Signals

SignalConditionMeaning
BuyMOM crosses above zeroPrice exceeds nn-period-ago level, momentum turns positive
SellMOM crosses below zeroPrice falls below nn-period-ago level, momentum turns negative

3. Momentum Strength Assessment

  • Larger absolute MOM — faster price change, stronger trend
  • Decreasing absolute MOM — trend decelerating, potential reversal

4. Divergence Warning

  • Bearish Divergence: Price makes new high, MOM peak declines — upward momentum exhausting
  • Bullish Divergence: Price makes new low, MOM trough rises — downward momentum exhausting

5. Momentum Ranking

In multi-asset strategies, MOM can be used for momentum ranking and stock selection: select the top N assets with the highest MOM to build a long portfolio (momentum factor strategy).

Caution

Since Momentum is an absolute difference, direct comparison across assets with different price levels is not possible. For cross-sectional comparison, use ROC (percentage form) instead.


V. Advantages, Disadvantages, and Use Cases

Advantages

AdvantageDescription
Extremely simpleOne of the simplest technical indicators, requiring just one subtraction
No parameter pollutionNo additional parameters beyond the period, avoiding overfitting
Leading characteristicMomentum turning points typically precede price turning points
Universal foundationUnderstanding Momentum is a prerequisite for understanding all momentum indicators

Disadvantages

DisadvantageDescription
NoisyNo smoothing; short-term fluctuations directly affect signals
Not normalizedAbsolute values depend on price level; cross-asset comparison impossible
Coarse signalsZero line crossover often lags behind optimal entry timing
No overbought/oversold boundsNo fixed upper/lower boundaries to define extreme conditions

Use Cases

  • Trend confirmation: As a confirmation tool for other signals (only go long when MOM > 0)
  • Momentum factor strategies: Used as a momentum ranking factor in quantitative stock selection
  • Divergence detection: Leveraging the leading characteristic of momentum to find reversal opportunities
  • Education and research: An introductory tool for understanding momentum concepts
ComparisonMomentumROCMACDRSI
FormulaC - C[n](C - C[n])/C[n] x 100EMA differenceGain/Loss ratio
NormalizedNoYes (percentage)NoYes (0-100)
SmoothingNoNoEMA smoothingWilder Smoothing
Signal richnessLowLowHighHigh
Practical Tips
  1. Pair with SMA smoothing: Applying a 10-period SMA to MOM can significantly reduce noise.
  2. Watch momentum turning points: When MOM begins declining from a positive peak (even while still positive), it is an early warning of decelerating upward movement.
  3. Multi-period comparison: Observe MOM(5), MOM(10), and MOM(20) simultaneously; signals are strongest when all periods agree on direction.
  4. Quantitative stock selection: For cross-sectional momentum strategies, use ROC rather than MOM to eliminate the influence of price levels.