Strategies / S05
SMA 20/50 Cross
The classic moving-average cross on simple averages.
Results
| Market class | Return | Holding | Sharpe | Max DD | Win rate | Trades |
|---|---|---|---|---|---|---|
| Crypto, 1d | +172% | +602% | 0.56 | -61.8% | 34.2% | 506 |
| Stocks, 1d | +2,891% | +28K% | 0.98 | -26.4% | 47.8% | 647 |
| Forex, 1d | +4.5% | +3.1% | 0.06 | -20.6% | 37.3% | 413 |
| Commodities, 1d | +455% | +1,833% | 0.53 | -31.2% | 41.7% | 362 |
| Indices, 1d | +237% | +878% | 0.51 | -29.6% | 45.9% | 355 |
The exact rule
- Go long when SMA(20) crosses above SMA(50).
- Exit the long when SMA(20) crosses below SMA(50).
- Declared timeframe: 1d.
Explain it with Ask AI (Premium, on a desktop)
Watch it trade
This runs the same engine in your browser on the latest candles, with your own costs. Press Replay to watch every entry and exit arrive bar by bar.
Download
Pine ScriptFor TradingView
Paper botRuns on the Bot API, no real money
Python backtestOne file, no dependencies
READMEThe rule in plain words
Want it to run by itself? Read the automate guide, and use paper money first.
Related strategies
Price Above SMA 50Long while price closes above the 50-day average.Price Above SMA 200The simplest trend filter there is: above the 200-day average or in cash.EMA Ribbon 8/21/50Long only while three averages are stacked in order.
Research, not advice. Past results do not predict future ones. Results run to 2026-10-31.