◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Strategies / Golden Cross Strategy
Trend Following

Golden Cross Strategy

The Golden Cross is a classic trend-following signal that fires when a faster moving average crosses above a slower one — most commonly the 50-period crossing above the 200-period. Traders use it as a simple, rules-based way to mark a possible shift from a downtrend or range into a longer-term uptrend. It is a lagging, educational tool for reading market structure, not a prediction of future price; nothing about it is predictive, and trading carries the risk of loss.

How it works

A Golden Cross compares two simple moving averages (SMAs) of price: a shorter, faster average and a longer, slower one. The classic version uses the 50-period and 200-period SMAs, though traders apply the same idea to other lengths and timeframes.

When the faster average is below the slower one, the recent average price is weaker than the longer-run average — often read as a downtrend or weak phase. When the faster average crosses up through the slower average, recent prices have been strong enough to pull the short-term average above the long-term one. Traders interpret this crossover as a sign that momentum may be shifting toward the upside, though it confirms nothing about what price will do next.

The mirror-image event — the faster average crossing below the slower one — is called a Death Cross, and many traders use it as the corresponding exit or downtrend signal.

Because moving averages are built from past prices, the signal is inherently lagging: it describes a move that is already underway rather than calling a turn in advance. That trade-off is the point — the rule is designed to filter out short-lived noise and only flag larger, more persistent trends. It tends to produce cleaner signals in clearly trending markets and more whipsaws in choppy, sideways ranges, where the averages can cross back and forth repeatedly. Nothing about the signal is predictive, and how useful any trader finds it depends entirely on market conditions, the instrument, and the timeframe.

Entry rules

Exit rules

Risk notes

Pine v6 example

//@version=6
indicator("Golden Cross Strategy (Educational)", overlay = true)

// --- Inputs ---
fastLen = input.int(50,  "Fast SMA length", minval = 1)
slowLen = input.int(200, "Slow SMA length", minval = 1)
src     = input.source(close, "Source")

// --- Moving averages ---
fastMA = ta.sma(src, fastLen)
slowMA = ta.sma(src, slowLen)

// --- Signals (evaluated on confirmed bars) ---
goldenCross = ta.crossover(fastMA, slowMA)   // fast crosses above slow
deathCross  = ta.crossunder(fastMA, slowMA)  // fast crosses below slow

// --- Plots ---
plot(fastMA, "Fast SMA", color = color.orange, linewidth = 2)
plot(slowMA, "Slow SMA", color = color.blue,   linewidth = 2)

plotshape(goldenCross, title = "Golden Cross",
     style = shape.triangleup,   location = location.belowbar,
     color = color.green, size = size.small, text = "Golden")
plotshape(deathCross, title = "Death Cross",
     style = shape.triangledown, location = location.abovebar,
     color = color.red,   size = size.small, text = "Death")

// --- Alerts (educational; informational only, not advice) ---
alertcondition(goldenCross, "Golden Cross", "Fast SMA crossed above slow SMA")
alertcondition(deathCross,  "Death Cross",  "Fast SMA crossed below slow SMA")

Pitfalls

FAQ

What is the difference between a Golden Cross and a Death Cross?

They are mirror images. A Golden Cross is when the faster moving average (e.g. the 50-period) crosses above the slower one (e.g. the 200-period), which traders read as a possible shift toward an uptrend. A Death Cross is the opposite — the faster average crossing below the slower — often used as a downtrend or exit signal. Neither predicts price; both simply describe a crossover that has already occurred.

Which moving average lengths should I use for a Golden Cross?

The classic, widely watched version uses the 50-period and 200-period SMAs on a daily chart, but the concept works with any fast/slow pair and any timeframe. Shorter lengths react faster and produce more signals (and more whipsaws); longer lengths are slower but cleaner. There is no universally 'best' setting — it depends on the instrument, timeframe, and your tolerance for noise, and any choice should be tested rather than assumed.

Is the Golden Cross a reliable buy signal?

No signal is reliable or predictive. The Golden Cross is a rules-based way to flag a possible trend shift, not a buy recommendation. Because it is built from past prices, it lags and can whipsaw in sideways markets. It is best treated as one input into your own analysis and risk management, never as a guarantee. Trading involves the risk of loss, and past behavior does not guarantee future results.

How can I check a Golden Cross strategy is coded correctly?

Common coding traps are acting on intrabar crosses (which can repaint) and look-ahead bias from referencing future bars. ForexCodes' Strategy Validator converts a plain-English or AI-generated strategy into validated Pine Script v6 and flags repainting, look-ahead bias, and intent mismatches so the rule you described is the rule that actually runs. Try it free.

Educational & software only — not financial advice, not a recommendation to trade. Backtests are illustrative; past performance does not predict future results. Trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro