Skip to main content
Moving Averages

Choosing a Moving Average Period: Framework and Testing

Pomegra Learn

Choosing a Moving Average Period

Choosing the right period for a moving average is one of the most consequential decisions a technical trader makes, yet it is often done arbitrarily. A trader reads that "professional traders use the 200-day moving average" and immediately plots it on their chart without testing whether a 200-day window fits their market, their time frame, or their strategy. The result is frequently a moving average that either lags so much it generates entries long after a move has started, or one so short it whipsaws through sideways markets generating losses. The period you choose determines everything: how responsive the moving average is, how much noise it filters, and whether it acts as a meaningful support or resistance level. In this article, we provide a framework for thinking about period selection, methods for testing candidate periods, and guidance on the most common periods used by professional traders.

Quick definition: The period of a moving average is the number of closing prices (or bars) included in the calculation; longer periods smooth more aggressively and lag more, while shorter periods respond faster but filter less noise.

Key takeaways

  • Period selection depends on your time frame (intraday, daily, weekly) and whether you trade short-term swings or long-term trends
  • Popular periods are not universal; a 50-day SMA that works on daily charts for swing traders does not necessarily work on hourly charts or weekly charts
  • Back-testing is essential: a period that fits historical data may fail in the future, so test out-of-sample when possible
  • The relationship between period and time frame matters: a 20-period SMA on a daily chart covers roughly 4 weeks; the same period on a 1-hour chart covers only 4 trading days
  • Visual inspection combined with quantitative testing (counting bounces, measuring win rate of signals) yields better period selection than either approach alone

The relationship between time frame and period

Before choosing a period, clarify your time frame. Are you:

  • An intraday trader? You hold positions for minutes to hours. You trade on 5-minute, 15-minute, or hourly charts. Use moving averages with short periods: 5-period, 9-period, 12-period, 20-period.
  • A swing trader? You hold for days to a few weeks. You trade on daily charts. Use moving averages with medium periods: 20-period, 50-period, 100-period.
  • A position trader? You hold for weeks to months. You look at daily charts, sometimes weekly. Use longer periods: 100-period, 200-period, or even 300-period.
  • A long-term investor? You hold for months to years. Weekly or monthly charts are your primary focus. Use very long periods: 200-period on weekly charts, 100-period on monthly charts.

The same period number on different time frames represents very different calendar time. A 20-period moving average on a 1-minute chart covers only 20 minutes of data. A 20-period moving average on a daily chart covers roughly 4 weeks of data (20 trading days × 1 day per bar). A 20-period moving average on a weekly chart covers roughly 4 months of data. This matters because trend strength varies by market structure.

Common periods and their use cases

5-period: Very short; responsive to immediate momentum. Used by intraday traders, scalpers, and day traders on fast-moving assets like crypto or forex. Generates many false signals in choppy markets.

9-period and 12-period: Short but slightly less choppy than 5-period. Popular on intraday charts. The 12-period is specifically used in MACD calculations.

20-period: Medium-short. Covers roughly 1 month of trading data (20 days). Popular on daily charts for swing traders. Often called the "first support" because it is watched heavily.

50-period: Medium. Covers roughly 2.5 months of trading data. Often acts as a major support/resistance zone. Widely watched; price frequently bounces off the 50-period moving average.

100-period: Medium-long. Covers roughly 5 months of trading data. Less commonly quoted but used by some traders who want responsiveness without excessive lag.

200-period: Long. Covers roughly 40 weeks (10 months) of trading data. One of the most widely watched levels in global markets. Used by institutions and individual traders alike. Often acts as a major support during bull markets.

Not all periods are equally useful. The ones listed above are chosen because they have become market standard. A majority of traders are watching them, which creates a self-fulfilling prophecy: price bounces off these levels frequently because so many traders are placing orders there.

Testing a candidate period: the visual method

Start by plotting a candidate period on your chart and observing:

  1. How many times has price bounced off this moving average in the last 50 bars? If it is 7–10 times, this is likely a meaningful level. If it is only 1–2 times, the period may be too short or too long for your market.

  2. When price crosses the moving average, how often is a genuine trend change following within 3–5 bars? In a strong trending market, the moving average should correctly call the broad direction at least 70% of the time (this is not 100% because the moving average lags and cannot call precise reversals).

  3. In a sideways market, does this moving average whipsaw constantly or does it stay relatively stable? If a moving average is chopping up and down constantly in sideways conditions, the period may be too short. If it sits perfectly still and becomes useless, the period may be too long.

  4. Does this moving average sit close enough to price to serve as a useful entry/exit level, or is it so far away that bounces off it do not feel meaningful? A moving average that is always 20% away from price is too far to act as a practical support level.

This visual inspection, conducted on 50–100 bars of historical data, gives you intuition about whether a period is in the right range. It is not scientific, but it is invaluable before committing to a period.

Testing a candidate period: quantitative back-testing

After visual inspection, test the period quantitatively. Here is a simple back-test framework:

1. Define a simple trading rule. For example: "Buy when price closes above the 20-period SMA. Sell when price closes below the 20-period SMA."

2. Run the rule on 1–2 years of historical data for your target market (or more if available).

3. Count the wins and losses. How many times did this rule enter a trade and price subsequently moved in your favor by at least 2%? How many times did price immediately reverse and hit your stop loss?

4. Calculate the win rate: Win rate = Wins / (Wins + Losses)

If a 20-period SMA has a 65% win rate on your market, that is useful information. If it has a 45% win rate, this period is not good for this strategy.

5. Compare periods. Test 10-period, 15-period, 20-period, and 25-period on the same rule and the same historical data. Which period has the highest win rate and the best average win size relative to average loss size?

6. Walk-forward test (optional but recommended). After choosing a period based on 2020–2022 data, test it on 2023 data that was not used in the original test. If win rate drops from 65% to 50%, the period may have been over-optimized to past conditions.

Real-world example: S&P 500 (SPY) period selection

In early 2024, a trader wanted to use a moving average to catch swings on the daily SPY chart. They tested three periods over the data from January 2023 to December 2023 using a simple rule: "Buy when price closes above the moving average. Sell when price closes below."

20-period SMA: 14 trades, 10 wins, 4 losses. Win rate = 71%. Entries felt fast; sometimes entered too early before moves were confirmed.

50-period SMA: 8 trades, 6 wins, 2 losses. Win rate = 75%. Fewer trades but higher quality. Entries were slightly later but more reliable.

100-period SMA: 5 trades, 4 wins, 1 loss. Win rate = 80%. Very few trades. Entries were late but almost always correct. Exiting too late sometimes cost money on reversals.

The trader chose the 50-period SMA as a balance: good win rate, reasonable number of trades, entries that felt neither too early nor too late. A different trader, comfortable taking more trades and accepting more whipsaws to catch more moves, would have chosen the 20-period. A very conservative trader would have chosen the 100-period and accepted fewer trading opportunities in exchange for higher reliability.

Multiple periods on the same chart

Many successful traders use two or three moving averages simultaneously on the same chart:

Trend confirmation: A longer period (like 200-day) shows the primary trend direction.

Entry timing: A shorter period (like 20-day or 50-day) provides more responsive entry and exit signals.

Intermediate check: A medium period (like 50-day) bridges the gap, confirming whether the intermediate trend agrees with the longer-term trend.

For example, on a daily SPY chart, a trader might overlay:

  • 50-period SMA (for entries and exits)
  • 100-period SMA (intermediate trend)
  • 200-period SMA (primary trend)

If all three are rising and price is above all three, the trader has high confidence in longs. If the 50-period is below the 100-period, which is below the 200-period, and all are falling, the trader has high confidence in shorts. This layered approach reduces false signals.

Market-specific period selection

Different markets have different characteristics that influence optimal period selection:

Stocks: Longer periods (50, 100, 200) tend to work well because institutional investors trade on these levels, creating self-fulfilling prophecies. The 50-day and 200-day are heavily watched.

Cryptocurrencies: Shorter periods (9, 12, 20, 50) often work better because crypto moves faster and intraday volatility is extreme. The lag from a 200-period moving average may be too long.

Forex (currency pairs): Medium periods (20, 50) often work well. Currency pairs are highly liquid and tend to trend strongly, so a responsive moving average captures moves without too much whipsaw.

Commodities (crude oil, gold, natural gas): Highly volatile. Medium to longer periods (50, 100) filter the noise better. A 20-period moving average might bounce around too much.

Bonds: Generally less volatile than stocks. Longer periods (100, 200) are preferred. Bond trends are more persistent, so the moving average lag is less damaging.

Back-test moving average periods on your specific market before deploying real money.

The danger of over-optimization

A common mistake is testing 30 different periods (10, 11, 12, 13, ... 40) and choosing the one with the highest historical win rate. This is over-optimization. The period that worked best from 2020–2022 may not work in 2023 because market structure evolves, volatility patterns change, and correlations shift.

Instead:

  1. Choose 3–4 candidate periods based on theory (your time frame, the market structure, popular levels traders watch).
  2. Test all of them on 1–2 years of data.
  3. Choose the one that balances win rate, number of opportunities, and ease of execution.
  4. Accept that it will underperform historical back-tests in future live trading.
  5. If it stops working, test again and adjust, but do not test every single day or you will change periods too frequently.

A period should be held for at least 3–6 months of live trading before you judge it a failure.

Common mistakes in period selection

Copying a period from a book without testing. A finance book says "use the 50-day moving average" so you use it on a 5-minute intraday chart and wonder why it is useless.

Over-optimizing to past data. You test 50 periods and choose the best performer, only to find it fails in new market conditions.

Changing periods too frequently. You use a 50-period SMA for 3 weeks, switch to 20-period because 50 generated a loss, then switch back after 1 week. This whipsaw prevents any strategy from working.

Ignoring the time frame mismatch. Using a 200-day period on a 1-hour chart (which covers only 200 hours, roughly 25 days of trading) leads to over-smoothing and a moving average that barely moves.

Treating the chosen period as permanent. Markets evolve. A period that worked for 5 years may stop working. Re-test every 12–18 months.

FAQ

Q: Is there a "universal best" moving average period? A: No. The best period depends on your time frame, the market you are trading, and your specific strategy. Test your candidates rather than assuming.

Q: Should I use the same period on all time frames? A: No. A 20-period on a daily chart (roughly 1 month of data) is not equivalent to a 20-period on a 1-hour chart (roughly 4 trading days). Choose periods that represent similar calendar time or test each time frame separately.

Q: Why do so many traders use the 50-day and 200-day? A: Because these are market standards that institutions and hedge funds watch. When enough traders are watching a level, price tends to bounce off it, creating a self-fulfilling prophecy.

Q: Can I find the perfect period by testing every number from 1 to 500? A: Mathematically, yes. You will find one that performs best on historical data. But that period is almost certainly over-optimized and will disappoint in the future. Test a handful of candidate periods and choose pragmatically.

Q: How often should I re-test my period choice? A: At least once per year. If you find that your chosen period has stopped working in recent months, run a new back-test and consider switching.

Q: Should I use a different period on different markets with the same moving average type? A: Yes. Test each market separately. A 50-period SMA may be ideal for crude oil but suboptimal for wheat futures.

Q: Can I use a 20-period EMA and a 50-period SMA on the same chart? A: Yes, many traders do. The 20-period EMA provides faster signals, while the 50-period SMA provides a stability check. Just document which one you use for entries and which you use for confirmation.

Summary

Choosing a moving average period is a critical decision that depends on your time frame, the market you are trading, and your strategy. Popular periods like 20, 50, and 200 are not arbitrary; they have become standards because institutions watch them, creating self-reinforcing support and resistance zones. Always test candidate periods on historical data and walk-forward test to ensure you are not over-optimizing. A period that works for intraday trading (5–20 period) will not work for position trading (100–200+ period). Choose one period, trade it consistently for 3–6 months, and only change if data supports the change.

Next steps

The 50-Day Moving Average: Explore one of the most widely watched moving averages used by traders worldwide.