Golden cross (50/200 SMA): backtest results
The golden cross buys when the 50-day moving average crosses above the 200-day, and sells on the death cross, when it crosses back below. It is one of the most quoted signals in trading. We ran it on real daily data for 4 stocks. It beat simply buying and holding on 1 of 4 stocks.
Results by stock
| Stock | Period | Strategy | Buy & hold | Beat it? | Worst drop | Trades | Win rate | Caution |
|---|---|---|---|---|---|---|---|---|
| Apple (AAPL) | 2016 → 2025 | +189.6% | +1038.8% | no | -31.5% | 4 | 50.0% | only 4 closed trades; includes a position still open at the end |
| Amazon (AMZN) | 2016 → 2025 | +90.3% | +613.2% | no | -30.8% | 4 | 50.0% | only 4 closed trades; includes a position still open at the end |
| Robinhood (HOOD) | 2021 → 2025 | +449.7% | +223.5% | yes | -47.1% | 4 | 25.0% | only 4 closed trades; includes a position still open at the end; fell 47% at its worst |
| Tesla (TSLA) | 2016 → 2025 | +739.5% | +2877.2% | no | -63.8% | 8 | 50.0% | only 8 closed trades; includes a position still open at the end; fell 64% at its worst |
Best: Tesla on +739.5%. One set of rules, fixed in advance, run on every stock: no tuning to make the numbers look better. A strategy with few trades or a big drop deserves less trust than its return suggests.
The exact rules
Buy Apple when the 50 day SMA crosses above the 200 day SMA. Sell when the 50 day SMA crosses below the 200 day SMA.
Paste those words into Extractor and it runs the same test, shows every trade on the chart with entry, stop loss and take profit, and compares it with buy & hold. Change a number and run it again in seconds.
Run these rules now, freeFree TradingView indicator (Pine Script v5)
Copy this into TradingView's Pine Editor and click Add to chart. It marks the buy and sell signals and draws the levels.
//@version=5
// Indicator generated by Extractor from your rules.
// Built for AAPL on the daily (1D) chart.
// Buy when: sma(50) crosses above sma(200)
// Sell when: sma(50) crosses below sma(200)
// Marks where your rules say buy and sell, and adds alerts you can turn on in TradingView.
indicator("Golden cross (50/200 SMA) signals", overlay=true)
sma50 = ta.sma(close, 50)
sma200 = ta.sma(close, 200)
cross1 = ta.crossover(sma50, sma200)
cross2 = ta.crossunder(sma50, sma200)
entrySignal = cross1
exitSignal = cross2
// Track whether the rules are in a trade, so signals don't repeat while already long.
var bool inTrade = false
var float entryPrice = na
stopHit = false
targetHit = false
buy = not inTrade and entrySignal
sell = inTrade and (exitSignal or stopHit or targetHit)
if sell
inTrade := false
entryPrice := na
else if buy
inTrade := true
entryPrice := close
// Levels stay drawn through the bar where the trade closes.
wasInTrade = inTrade or sell
levelBase = sell ? entryPrice[1] : entryPrice
plot(sma50, "SMA 50", color.orange)
plot(sma200, "SMA 200", color.aqua)
plotshape(buy, "Buy", shape.labelup, location.belowbar, color.new(color.teal, 0), text="BUY", textcolor=color.white, size=size.small)
plotshape(sell, "Sell", shape.labeldown, location.abovebar, color.new(color.red, 0), text="SELL", textcolor=color.white, size=size.small)
alertcondition(buy, "Buy signal", "Golden cross (50/200 SMA): buy signal on {{ticker}} at {{close}}")
alertcondition(sell, "Sell signal", "Golden cross (50/200 SMA): sell signal on {{ticker}} at {{close}}")
Test your own version
- Different stock, crypto or forex pair? Change the ticker in the description.
- Add a stop loss or take profit and see if it helps.
- Saw a strategy on YouTube? Paste the link and get the rules, the backtest and the indicator.