← All guides

How to Use Moving Average Crossovers in a Trading Strategy

A moving average crossover strategy generates a signal when one moving average crosses another, typically a faster, shorter-period average crossing a slower, longer-period one. It is one of the simplest systematic strategies to understand, and also one of the easiest to build incorrectly.

The basic mechanics

A common setup uses two moving averages, such as a 13-period and a 50-period. When the faster average crosses above the slower one, it is read as a bullish signal. When it crosses below, it is read as bearish. Some strategies add a third, longer average as a broader trend filter.

Why simple crossovers often underperform in choppy markets

Moving average crossovers are trend-following by nature, and trend-following systems tend to struggle in sideways, range-bound markets, where price repeatedly crosses back and forth across the averages without establishing a real trend. Each of those crossings can generate a losing signal, a pattern often called whipsaw.

Adding a trend filter

A common refinement is to only take crossover signals in the direction of a longer-term trend, for example only taking bullish crossovers when price is above a 200-period average. This does not eliminate whipsaw entirely, but it filters out signals that go directly against the broader trend.

Choosing the periods

There is no universally correct pair of moving average lengths. Shorter periods react faster but generate more false signals. Longer periods are smoother but react more slowly and can give up more profit before signaling an exit. The right lengths depend on the instrument, the timeframe, and testing, not a fixed rule.

Why testing matters more than the concept

The general idea of a moving average crossover is well known enough that the concept alone provides little edge. What matters is the specific combination of periods, filters, and risk management applied on top of it, and whether that specific combination actually holds up when tested on real, forward-moving data rather than just a historical backtest.

Forward testing your own version

If you have built a moving average crossover strategy in Pine Script, Chart Grader's automated agents can connect to it directly and forward test the exact rules you have written, tracking real win rate and risk to reward over time instead of relying on a backtest alone.

Want your TradingView strategy journaled and AI-graded automatically? Chart Grader's automated agents connect directly to a webhook like the one in this guide.

Set up an automated strategy →

More guides

How to Review Your Trades Weekly for Improvement
A simple, repeatable process for reviewing your trades on a weekly basis to actually identify and act on patterns.
Rule Based vs Discretionary Trading: Which Fits You
An honest comparison of rule-based and discretionary trading approaches, their tradeoffs, and how to tell which one actually fits how you trade.
How to Set Stop Loss and Take Profit Levels
A practical guide to placing stop loss and take profit levels based on market structure rather than arbitrary distances.