The Distributed Quantitative Intelligence Network
← All posts

November 11, 2026 · Michael Shane

How to Test a Moving Average Crossover Before You Trust It

Moving average crossovers are the first strategy most traders try. Here's how they work, why they often look better than they are, and how to test one honestly.

Ask almost any AI for a simple trading strategy and there's a good chance you'll get a moving average crossover. Buy when the fast average crosses above the slow one. Sell when it crosses back below. It's clean, it's easy to code, and on the right chart it looks brilliant.

That last part is the trap. This guide explains how a crossover works, why it often looks better than it is, and how to test one before you trust it. It fits with How to Backtest Without Fooling Yourself and What Is RSI and How to Test It.

What a moving average crossover is

A moving average is the average price over the last N candles. A 20-period average on hourly candles is the average of the last 20 hourly closes. It smooths out the noise, but it always lags behind the price.

A crossover uses two of them:

  • a fast average (short, like 10 or 20 periods), which reacts quickly, and
  • a slow average (long, like 50 or 200 periods), which reacts slowly.

When the fast one crosses above the slow one, the price has been rising lately, so you buy. When it crosses back below, you sell. The famous 50/200 version on daily charts is often called the "golden cross" and "death cross."

Why it looks so good on a chart

Crossovers catch big trends. If you look at a chart with one huge move, the crossover gets in near the start and out near the end, and it looks like magic.

What the chart hides:

  • Sideways markets. When price chops up and down, the averages cross again and again. Each cross is a small loss plus fees.
  • The lag. You buy after the move has started and sell after it has turned. You never catch the top or the bottom.
  • The settings were picked after the fact. Someone tried many pairs of numbers and showed you the one that fit that chart best.

A quick simulation

We ran a simple test. We made 100 random price series of 2,000 hourly candles each, with no built-in trend edge, so any crossover "edge" is luck. We tested four common settings, buying on the candle after the cross (no peeking), and charged 0.10% per side for fees and slippage.

All numbers below are simulated, not real trading results.

  • 5/20: 31 of 100 runs net positive (45 of 100 before costs), about 62 round trips per run.
  • 10/30: 30 of 100 net positive (49 of 100 before costs), about 38 round trips.
  • 20/50: 35 of 100 net positive (41 of 100 before costs), about 22 round trips.
  • 50/200: 45 of 100 net positive (47 of 100 before costs), about 6 round trips.

Two things stand out. First, the faster settings trade more, so costs hurt them more. More on that in How Fees and Slippage Change a Backtest. Second, none of them did reliably well. On data with no real pattern, a crossover is roughly a coin flip before costs and worse after.

Then we did what most people do: try all four settings on a backtest, keep the best one, and run it on new data. The chosen setting was net positive in 59 of 100 backtests. On new data, the same setting was net positive in 37 of 100 (simulated). Picking the best-looking setting made the backtest look better without making the idea better.

How to test a crossover, step by step

1. Write the rules down first

Fast length, slow length, candle size, which coin, whether you go short or only long, and how you exit. Decide before you look at results. If the rules change after you see the chart, you're fitting the past.

2. Act on the next candle

The cross is only known when a candle closes. Buy or sell at the next candle's open, not at the close of the candle that crossed. See How to Avoid Look-Ahead Bias.

3. Charge real costs on both sides

Use your exchange's real fee for your order type, plus some slippage. Faster settings trade much more, so check how many trades you made.

4. Compare it to doing nothing clever

Compare the crossover to simply holding the coin over the same period. If it can't beat that after costs, it isn't adding much.

5. Count how many settings you tried

If you tried 20 pairs of numbers, the best one will look good by chance. Write down how many you tested. See Backtest Overfitting Signs and Deflated Sharpe Ratio.

6. Check nearby settings

If 20/50 works but 18/50 and 22/50 don't, you've found noise, not a pattern. A real effect should hold up across a range of settings.

7. Test on data it has never seen

Split your data, or better, watch it forward in paper trading. See In-Sample vs Out-of-Sample Testing and Walk-Forward Analysis Explained.

Ways a crossover can fool you

  • One great trend. A single big move can make the whole backtest look good. Check results with that move removed.
  • Win rate looks bad, average looks fine, or the reverse. Crossovers often lose small many times and win big a few times. Look at win rate vs expectancy, not just one number.
  • Long drawdowns. In choppy markets a crossover can bleed for months. Check the maximum drawdown and ask if you'd really sit through it.
  • Adding filters until it works. Each extra rule (RSI filter, volume filter, time filter) is another setting to overfit.

Where AI fits

AI tools like ChatGPT, Claude, Grok or Cursor can write a crossover backtest in seconds. Ask yours: did you trade on the next candle? What fees did you charge? How many settings did you try? How did it do on data you didn't tune on? If it can't answer, the result isn't ready to trust.

How Pickled Lizard tests ideas like this

Pickled Lizard is an AI trading and research platform. You bring the idea, or your own AI does, and we test it the same way every time:

  1. Backtest on the full data set we have, with fees and next-candle timing.
  2. Paper forward testing on new market data, with real fees and timestamps. The idea shows as "still collecting" while it builds a record.
  3. Verified only when its forward results reach 80% of its own backtest trade rate and 80% of its backtest win rate.

Results show on the public paper trading leaderboard. Pickled Lizard isn't an exchange and doesn't hold your money. It's a non-custodial aggregator that connects to your own exchange accounts. Our servers are in Europe. The beta is free, and live trading is off during the beta.

Test it free at pickledlizardz.com/join

Quick recap

  • A crossover buys when a fast average crosses above a slow one, and sells when it crosses back.
  • It catches big trends but loses in choppy markets, and it always lags.
  • On random prices, four common settings were net positive in 30 to 45 of 100 runs after costs (simulated).
  • Picking the best setting on a backtest took it from 59 of 100 net positive to 37 of 100 on new data (simulated).
  • Fix the rules first, trade on the next candle, charge real costs, and confirm on new data.

New here? Start with How to Test an AI Trading Strategy Before You Use Real Money.