ATR Trend Follow for US500 (S&P 500)
Volatility-adjusted trend following — trail stops by ATR multiples.
Indicators
EMA 21, ATR 14
Recommended Timeframes
1h, 4h, 1d
Symbol Volatility
medium
Trading Sessions
New York (Mon–Fri, with extended hours)
Why ATR Trend Follow Works on US500
A simple EMA trend with ATR-based exits. Stop and trailing stop scale with the asset's realised volatility, so the same code works on quiet EUR/USD and wild Bitcoin. ATR multipliers (typically 2-3×) are the only parameter you need to tune per market.
The S&P 500 (US500) is the global benchmark equity index. Strong long-term uptrend with regime shifts; momentum and trend bots dominate, mean-reversion works in QE periods only.
Equity indices reflect aggregate corporate earnings, sentiment, and Fed policy. They trend more cleanly than individual stocks and gap less than commodities.
Best For
- • Cross-asset deployment
- • Volatile markets
Avoid In
- • Low-ATR ranges
Pine Script Source
Copy this into PineForge — backtest on US500 or any supported symbol, then deploy as a live bot.
//@version=5
strategy("ATR Trend Follow", overlay=true)
ema_len = input.int(21, "EMA Length")
atr_len = input.int(14, "ATR Length")
atr_mult = input.float(2.5, "ATR Multiplier")
ema = ta.ema(close, ema_len)
atr = ta.atr(atr_len)
long_stop = close - atr * atr_mult
if close > ema and close[1] <= ema[1]
strategy.entry("Long", strategy.long)
if strategy.position_size > 0
strategy.exit("Trail", from_entry="Long", stop=long_stop)Backtest ATR Trend Follow on US500 in 30 seconds
Sign up for PineForge, paste this Pine Script, and run a 1-year backtest on real US500 data — no credit card required.