Momentum trading strategy: rules, the edge and the cost

Momentum trading buys what is going up and sells what is going down — and it is one of the most robustly documented edges in finance, surviving across decades and asset classes. But it pays for that edge with painful whipsaws and sudden crashes. This guide explains the two flavours, the rules, and the honest risks.

On this page
  1. The momentum edge
  2. Two flavours
  3. Entry and exit rules
  4. The code
  5. FAQ

Why momentum is a documented edge

Decades of academic research — most famously Jegadeesh and Titman's work on relative-strength portfolios — found that assets that outperformed over the past 3–12 months tended to keep outperforming over the next few months. The effect appears across stocks, currencies, commodities and crypto. It is not a guarantee; it is a statistical tilt that pays off on average while losing on plenty of individual trades. That is the opposite profile of mean reversion.

equitytime steady compoundingdeep drawdown
A smooth equity curve compounds; a volatile one with deep drawdowns risks ruin even at the same average return.

Two flavours of momentum

Entry and exit rules

A simple bot ranks assets by their N-period return (say 90 days), buys the top performers, and rebalances monthly. Exits matter as much as entries: momentum strategies suffer "momentum crashes" during sharp reversals, so a volatility-scaled position size and a trailing stop soften the worst drawdowns. The whipsaw cost is real — you re-enter near tops and exit near bottoms during choppy regimes.

The code

python · momentum.pydef ret(closes, n=90): return closes[-1]/closes[-n] - 1
ranked = sorted(universe, key=lambda s: ret(prices[s]), reverse=True)
longs = ranked[:3]   # hold the strongest, rebalance monthly

Backtest momentum across a full cycle — including a crash and recovery — in the backtester, because its risk lives in the rare reversal, not the calm trend.

Not financial advice. This content is educational. Automated and algorithmic trading carries a real risk of financial loss. Never trade money you cannot afford to lose. Review the SEC investor.gov and CFTC resources before trading.

Frequently asked questions

Does momentum trading actually work?

Momentum is one of the most robustly documented anomalies in finance, persisting across markets and decades. It is a statistical edge, not a sure thing — it loses on many individual trades and suffers sharp 'momentum crashes' during reversals.

What lookback period is best for momentum?

Research commonly uses 3 to 12 months for the lookback. Shorter windows react faster but whipsaw more. The robust choice performs across a range of lookbacks rather than relying on one tuned value.

How is momentum different from trend following?

They overlap heavily. Trend following usually trades each asset against its own history (time-series momentum), while the classic momentum factor ranks a basket and holds the strongest (cross-sectional). Both buy strength and sell weakness.

What is a momentum crash?

It is a sharp loss that momentum strategies suffer when a beaten-down market violently rebounds — the previously weak assets the strategy avoided or shorted surge. Volatility scaling and stops reduce, but do not eliminate, this risk.

MB

Mustafa Bilgic

Algorithmic trading practitioner · Founder, AITradingBot.us

Mustafa builds and backtests automated trading systems and writes about them without the hype. Every tool on this site is free and runs entirely in your browser.