How to Backtest a Momentum Strategy (and Dual Momentum)
July 25, 2026 · Agenttrading · Last updated July 2026
- 1 THESIS
- 2 EVIDENCE
- 3 BACKTEST
- 4 RISK
- 5 VERDICT
02 EVIDENCE · FUNDAMENTALS
04 RISK · IN PLAIN ENGLISH
Past performance does not guarantee future results. Educational analysis only, not financial advice.
To backtest a momentum strategy, write the rule as one explicit sentence (ticker, lookback window, rebalance frequency, signal threshold, and what you hold when the signal is negative), run it on split- and dividend-adjusted daily history, charge about 0.1% per trade because momentum turns over constantly, force the window through the March to May 2009 reversal, and compare the result against buying and holding the same ticker. The benchmark and the turnover are the two numbers that decide whether the rule was ever real.
Momentum is the most documented anomaly in finance and the most awkward one to actually live with. It works on average over long samples and it fails violently at exactly the moments that hurt most, which means a short backtest will make almost any momentum rule look like a discovery. The whole point of testing one properly is to see the bad stretch before your own money is in it.
Why momentum backtests go wrong more often than other backtests
Three things make momentum unusually easy to fool yourself with. The first is turnover. A rule that checks itself monthly and switches between an asset and cash will fire dozens of round trips over twenty years, so a test that assumes free trading is not measuring the same strategy you would run. The second is parameter sensitivity: the lookback window is a dial, and a dial with twenty settings will always have one setting that looks brilliant on any fixed sample.
The third is regime dependence, and it is the one people skip. Momentum makes its money in trending markets and gives a chunk of it back at sharp inflection points, when the assets that fell hardest bounce hardest. If your test window happens to contain a long trend and no violent reversal, the rule will look far steadier than it is. This is the same overfitting problem described in walk-forward analysis, just with a strategy family that is especially prone to it.
How do you backtest a momentum strategy?
Specify the five inputs, run them on long adjusted history with honest costs, and benchmark against buy-and-hold. Most of the work is the specification, because anything you leave unstated gets silently resolved in the strategy's favor. These are the choices that determine the answer:
| Input | What to specify | Why it changes the answer |
|---|---|---|
| Lookback window | The period used to measure momentum, for example 3, 6, or 12 months | Shorter windows react faster and trade far more; longer windows are steadier and exit late. This is the single most curve-fitted parameter in the family. |
| Skip-month | Whether the most recent month is excluded from the measurement | Short-horizon returns tend to reverse, so including the last month adds noise. The academic convention excludes it, and the two versions can disagree materially. |
| Rebalance frequency | Daily, weekly, monthly, or quarterly checks | Checking daily multiplies whipsaws and costs without necessarily improving the signal. Monthly is the standard in the literature for a reason. |
| Signal threshold | Positive return, above a moving average, or beating Treasury bills | A threshold of "above cash" is a far more defensive rule than "above zero" and behaves very differently in a high-rate environment. |
| Where the money sits when out | Cash, short-term Treasuries, or bonds | A rule parked in bonds during a bond bull market looks superb for reasons that have nothing to do with your momentum signal. |
Once those are pinned down, the mechanics are the same as any strategy test: a long enough window, real costs, and a benchmark. Twenty years or more is the target because it drags the rule through 2008, the 2009 reversal, 2020, and the 2022 drawdown, and momentum behaves differently in each. The reasoning behind that window length is set out in how long you should backtest a trading strategy.
Does momentum investing work?
On long samples, yes, and the evidence is unusually broad. Moskowitz, Ooi and Pedersen documented time-series momentum across 58 liquid futures markets from 1985 to 2009 using a 12-month lookback and a one-month holding period, and found positive results in nearly every asset class. Cross-sectional momentum, ranking assets against each other, goes back to Jegadeesh and Titman's 1993 work and has been replicated across decades and countries. It is not a fragile curiosity.
What the headline finding hides is the shape of the failure. Momentum crashes, and it crashes at turning points. From March to May 2009 the decile of past losers rose roughly 163% while the decile of past winners gained about 8%, wiping out years of accumulated gains for anyone running the classic long-winners, short-losers version. Researchers describe this as momentum's negative skew: many modest gains punctuated by rare, brutal losses. That is why the drawdown line matters more here than the average annual return, and why a test that stops in 2007 or starts in 2010 tells you almost nothing.
Does dual momentum work?
Dual momentum, popularized by Gary Antonacci, combines two signals: relative momentum, which picks the strongest of two or more assets, and absolute momentum, which only stays invested if that asset is also beating Treasury bills. The absolute filter is the part doing the defensive work, because it is what moves you to cash in a sustained decline rather than merely rotating you into whichever asset is falling least.
Backtests of the published versions look strong, and the honest caveat is that they are sensitive to the exact lookback and the exact asset pair. A rule built on a 12-month lookback across US equities, international equities, and bonds can look excellent on one twenty-year window and ordinary on another, partly because the bond leg benefited from a forty-year decline in interest rates that will not repeat in the same way. Test the neighboring variants rather than trusting one published table. If the result only survives at one precise setting, you found an artifact.
What is the best momentum indicator?
There is no single best one, and the honest answer depends on how much trading you are willing to do. Each choice implies a different turnover, and turnover is a cost you pay with certainty in exchange for a signal you only get on average.
| Indicator | Typical signal | Trade-off |
|---|---|---|
| Total return over a lookback | Hold while the trailing 12-month return is positive | The version the academic literature uses and the hardest to overfit. Slow to exit a top. |
| 200-day moving average | Hold above the average, cash below it | The simplest trend switch, few signals per decade, but it whipsaws badly in a choppy sideways market. |
| Moving average crossover | Buy when a fast average crosses above a slow one | More responsive than a single average and more prone to false crosses. Covered in the moving average crossover strategy. |
| RSI or MACD | Momentum inferred from short-term oscillators | Fastest to react, highest turnover, and the easiest to torture into a good-looking result. See the RSI trading strategy. |
The useful method is not to pick a winner on reputation but to test two or three on the same ticker and window and read the spread. If they all land in the same neighborhood, the underlying trend is real and you can choose on comfort and cost. If the answer swings wildly depending on which indicator you used, the edge belongs to the indicator's parameters rather than to the market.
What lookback period should a momentum backtest use?
Start at 12 months excluding the most recent month, because that is the convention the research is built on, then test the neighbors. Windows of 3 to 6 months react faster, catch turns earlier, and pay for it in trades and false starts. Windows of 12 months and longer are calmer and hold through shallow corrections but give back more at a real top.
The reason to test the neighbors is diagnostic rather than optimizing. A robust rule degrades gracefully: 9, 12, and 15 months all produce broadly similar results, and you pick one and move on. A fragile rule spikes at one setting and collapses on either side, which tells you the sample contained a lucky alignment. Reporting the whole neighborhood instead of the best cell is the difference between research and marketing.
Do momentum ETFs work as well as your backtest suggests?
Usually not exactly, and the gap is worth understanding before you decide to run a rule yourself. A large-cap momentum factor ETF rebalances on a fixed published schedule, holds a broad basket, caps position sizes, and charges an expense ratio, so it delivers a smoothed and slightly delayed version of the raw factor. Your own concentrated rule will typically show bigger swings in both directions.
That makes the fund a genuinely useful benchmark. Test your rule, then compare it against the relevant momentum ETF over the same window, and ask whether the extra turnover, tax friction, and attention bought anything. Quite often the honest answer is that the fund captured most of the effect for a few basis points and no effort, which is a perfectly good outcome for a test to hand you. It is also worth remembering that a momentum signal is silent on whether the underlying company is any good, which is why traders who hold single names usually pair the rule with a look at the fundamentals behind the ticker before they size a position.
The traps that make momentum backtests lie
- Zero trading costs. Momentum's turnover is its defining feature. Free trading assumptions have flipped losing rules into winners on paper more often in this family than any other.
- A window with no reversal. A test that misses March 2009, or any sharp V-bottom, never measures the one condition momentum is worst at.
- Optimizing the lookback and reporting only the winner. Twenty lookbacks tried, one shown, is a lottery ticket presented as evidence.
- A flattering parking asset. If your out-of-market position sat in long bonds during their bull market, you measured the bonds, not the signal.
- Unadjusted prices. Splits invent phantom momentum signals and missing dividends understate both the rule and the benchmark.
- Too few signals. A rule that fired nine times in twenty years has a sample of nine, however smooth the equity curve looks.
- Survivorship in single names. Testing a momentum rule only on today's winners builds the conclusion into the data before the test starts.
Backtest a momentum rule without writing Python
Done by hand, this is a data pipeline, a rolling-return calculation, a rebalance loop, a cost model, and a benchmark series, with an off-by-one error hiding in the lookback. That is the work a momentum backtest on Agenttrading compresses. Describe the rule in plain English, such as "hold QQQ while its 12-month return is positive, otherwise cash, checked monthly" or "buy NVDA above its 200-day moving average and exit below it", and the bench restates the rule as an explicit card before anything runs, so you can see exactly what it understood.
It then tests the rule on 20+ years of split- and dividend-adjusted daily history with a 0.1% cost per trade charged by default, prints the assumptions strip covering the lookback, the rebalance schedule, and the skip-month handling, shades the worst drawdown along with its recovery time, plots the result against buy-and-hold on the same ticker, and stamps an honest verdict: HELD UP, MIXED, or UNDERPERFORMED. That last verdict stays as prominent as the first, because a bench that cannot tell you your trend rule underperformed sitting still is not analysis.
The opposite premise, buying weakness rather than strength, is tested the same way and explained in mean reversion trading. Momentum rules applied to funds instead of single names belong on ETF backtesting, the adjusted record every run uses is described under historical stock data, and the drawdown a trend rule still leaves you holding is explained in investment risk analysis. If you want to rank an entire universe of ETFs against each other every month and reallocate a whole portfolio automatically, a portfolio rotation tool is the right instrument and we say so on the momentum backtest page.
Agenttrading executes no trades and connects to no brokerage. It shows you what the record says about your momentum rule, including the parts you would rather not see. What you do with that is your call.
Past performance does not guarantee future results. For educational and informational purposes only. Not financial advice. Consult a licensed advisor.
Put it on the bench
Ideas are cheap. Verdicts take a bench.
Agenttrading restates your idea as a testable rule, backtests it on 20+ years of adjusted daily data, and explains the risks in plain English. Honest verdicts, even when the idea loses.
Past performance does not guarantee future results. For educational and informational purposes only. Not financial advice. Consult a licensed advisor.