AAIYUGBeta
LeaderboardRaceWall of FameLitepaperBlogNews
AAIYUG

A skill-based trading competition platform.

✉ hello@aiyug.com

Dubai, United Arab Emirates

PRE-LAUNCH · REGISTRATION IN PROGRESS
Platform
LeaderboardLive raceWall of FameHow it worksLitepaperBlogMarkets newsJoin free
Legal
Terms & ConditionsPrivacy PolicyCompetition RulesRisk Disclaimer

Simulated trading only. No real money is traded. AIYUG is not financial advice and is not a regulated financial service. Read the full risk disclaimer →

© 2026 AIYUG. All rights reserved.

LeadersRaceFameBlogNews
Blog
Strategy· 13 August 2026 · 6 min read

Practical Moving Average Crossover Trading Strategy

A step-by-step guide to moving average crossover trading strategy, including formulas, a worked example, and how to use 50-day vs 200-day golden cross/death cross signals.

A
AIYUG Desk
Content & education team

How the moving average crossover trading strategy works

Moving average crossovers are one of the clearest mechanical trend-following tools for retail traders. The idea: compare a shorter-period moving average (MA) that reacts quickly to price, with a longer-period MA that smooths noise. When the short MA crosses above the long MA, momentum may be shifting higher; when it crosses below, momentum may be shifting lower.

Two phrases you’ll see often are golden cross death cross and 50 day vs 200 day moving average. The classic “golden cross” is when the 50-day MA crosses above the 200-day MA — a long-term bullish signal. The mirror is the “death cross”: the 50-day crossing below the 200-day, which many treat as a bearish signal.

This article gives practical mechanics, formulas, risk-management rules, and a concrete worked example you can replicate in a spreadsheet or a platform.

The formulas (simple moving average and crossover signal)

  • Simple Moving Average (SMA):
  • SMA_n = (P_t + P_{t-1} + ... + P_{t-n+1}) / n where P_i are closing prices and n is the window length.

  • Crossover signal (basic):
  • - Bullish entry: SMA_short(t) > SMA_long(t) AND SMA_short(t-1) <= SMA_long(t-1) - Bearish entry (short or exit long): SMA_short(t) < SMA_long(t) AND SMA_short(t-1) >= SMA_long(t-1)

These are boolean conditions that create a discrete entry when the short MA crosses through the long MA from the previous bar to the current bar.

Common parameter choices and why

  • 50 day vs 200 day moving average: widely used to filter long-term trend. It’s slow and reduces false signals but can lag.
  • 10/20, 20/50, or 20/100: popular shorter-term pairs for swing trading.

Shorter MA windows give quicker signals (more trades, more noise). Longer windows give fewer signals with more confirmation but larger lag. Choose the pair that fits your time horizon and capacity to monitor trades.

Step-by-step trading rules (mechanical)

  1. Choose time frame and MA lengths (e.g., daily bars, SMA50 and SMA200 for position trades).
  2. Compute SMA_short and SMA_long each bar using the SMA formula.
  3. Entry rule: go long on the first bar where SMA_short crosses above SMA_long.
  4. Exit rule: exit long (or enter short) on the first bar where SMA_short crosses below SMA_long.
  5. Position sizing: risk a fixed % of equity per trade (e.g., 1% risk). Use ATR or a fixed volatility multiple for stop distance.
  6. Stop-loss: place a stop based on volatility (e.g., 2 ATR below entry) or a recent swing low.
  7. Risk/reward: target either a multiple of ATR, trailing stop, or wait for opposite crossover.

Keep entries and exits strictly mechanical to avoid emotion-based deviation.

Worked example (illustrative numbers)

We’ll use a shortened example to demonstrate mechanics: a 5-day SMA vs 20-day SMA on daily bars. This lets us compute by hand for a small set of prices.

Assume closing prices (most recent t = day 20 down to day 1): Day 16: 101, 17: 102, 18: 103, 19: 104, 20: 105 (these are the last 5 days used for SMA5) Other earlier days for SMA20 are not shown explicitly; assume the SMA20 yesterday was 100.5 and the SMA5 yesterday was 100.0.

Compute SMA5 at day 20: SMA5 = (101 + 102 + 103 + 104 + 105) / 5 = 515 / 5 = 103.0

We were given SMA5 yesterday = 100.0 and SMA20 yesterday = 100.5. Let’s say SMA20 today computes to 101.8.

Cross-check the crossover condition:

  • Yesterday: SMA5(19) = 100.0 <= SMA20(19) = 100.5 (no bullish)
  • Today: SMA5(20) = 103.0 > SMA20(20) = 101.8 (bullish crossover)

Signal: Bullish entry at the current close (or next open per your rules).

Position sizing and stops (example):

  • Account size: $10,000
  • Risk per trade: 1% = $100
  • Entry price: assume next bar open = $106
  • Choose stop: 2 ATR below entry. If ATR = $2, stop = $106 - 2*2 = $102
  • Risk per share = $106 - $102 = $4
  • Shares to buy = $100 / $4 = 25 shares (rounded down)
  • Position size = 25 * $106 = $2,650 (~26.5% of account)

Exit: if SMA5 crosses back below SMA20, exit at the close or next open, or the stop is hit earlier.

This small example shows the math and trade sizing. For 50-day vs 200-day signals, the computation is identical but uses longer lookbacks (SMA50 and SMA200), and the signals will be less frequent with greater lag.

Avoiding common pitfalls

  • Lag and whipsaws: MAs lag price. Use filters (volume, volatility thresholds, or confirming indicators like ADX) to reduce false signals.
  • Overfitting: don’t tune MA lengths to historical data until you validate on out-of-sample periods.
  • Position sizing: never allocate a disproportionate share of your capital to a single crossover signal.
  • Time frame mismatch: golden cross on daily charts means different things than on hourly charts. Keep your time frame consistent with your trading horizon.

Combining with risk management and confirmation

A robust approach pairs crossovers with volatility-based stops, maximum drawdown limits, and trade frequency caps. Some traders require the price to be above both MAs (trend confirmation) or that volume increases on the crossover bar.

Practice the rules mechanically, track metrics (win rate, average win/loss, drawdown), and iterate.

You can try this technique risk-free in AIYUG's free paper-trading race at https://aiyug.trading/race. Remember: historical signals do not guarantee future outcomes, and this content is educational, not investment advice.

FAQ

What is the difference between a golden cross and a death cross?

A golden cross occurs when a shorter-term moving average (commonly the 50-day SMA) crosses above a longer-term moving average (commonly the 200-day SMA), suggesting a longer-term bullish shift. A death cross is the opposite: the shorter MA crosses below the longer MA, suggesting a bearish shift.

Do moving average crossovers work in all market conditions?

No. Crossovers are trend-following signals and perform best in directional markets. They produce more false signals in choppy, sideways markets because the MAs will cross frequently without a sustained trend.

Should I use simple moving averages (SMA) or exponential moving averages (EMA)?

Both have uses. SMA gives equal weight to all prices in the window and smooths more; EMA gives more weight to recent prices and responds faster. Choose based on your trading horizon and test both on historical and out-of-sample data.

StrategySMA Crossover

Put it into practice — free

Join this week’s AIYUG race: virtual capital, real market data, real recognition from investors. No deposit, no KYC.

Keep reading
Strategy · 25 Aug 2026 · 6 min

How to Backtest a Trading Strategy Step by Step

A practical, step-by-step guide to backtesting: data, rules, metrics, common mistakes, and a worked example you can run in a spreadsheet.

Strategy · 24 Aug 2026 · 6 min

Stop-Loss Strategies Explained for Practical Traders

Clear, practical stop-loss strategies explained: hard vs mental stops, trailing stop loss mechanics, formulas, and a worked example to manage risk.

Strategy · 19 Aug 2026 · 7 min

How to Calculate Risk-Reward Ratio for Trading

Learn the formula and step-by-step method to calculate risk-reward ratio, set stop loss and take profit levels, and see a worked example for position sizing.