SMA-200 Trend + 15% Trailing Stop on Alpaca
Enter when price is above the 200-day average; exit only when a 15% trailing stop is hit. Deployed to your own Alpaca account — no code, your assets never leave the broker.
Setup on Alpaca
- Connect Alpaca with your API keys — paper and live accounts are both supported.
- Validate any strategy against Alpaca paper first: same rules, simulated money, live data.
- Promote to the live account when paper behavior matches the backtest.
- Each deployed strategy runs in its own sleeve with independent cash.
- Guardrails check every order: price bands, notional caps, and a global pause.
The strategy
- WHEN the market opens · IF not invested AND yesterday's close > SMA(200) · THEN buy with 98% of the sleeve
- WHILE invested · a managed trailing stop follows 15% below the position's high-water mark
Good for: long trends with tolerable pullbacks; the 15% trail is wide enough to survive normal corrections.
Watch out: a 15% giveback from every peak is the tuition this strategy always pays; on choppy assets it re-enters above the 200-day repeatedly after each stop-out.
Strongest backtests for this strategy
| ETF | CAGR | max DD | trades |
|---|---|---|---|
| TQQQ | 22.1% | −37.5% | 28 |
| SOXL | 19.5% | −69.7% | 88 |
| CLSE | 19.3% | −14.5% | 1 |
| SOXX | 19.1% | −36.4% | 13 |
| QLD | 15.5% | −40.2% | 17 |
| IAU | 15.2% | −24.7% | 4 |
| ROM | 13.7% | −41.3% | 21 |
| XLK | 10.7% | −32.4% | 6 |
Top-8 by CAGR shown of 59 tested — hindsight selection; see the full table including the losers.
Build it from blocks (or type it in English), backtest it on 5.5 years of minute data in seconds, tweak any parameter, then paper trade it on live data. No card, no broker needed to start.
Frequently asked questions
How do I automate trend + trailing stop on Alpaca?
Connect Alpaca to DeployQuant (trade & read permissions only), pick the SMA-200 Trend + 15% Trailing Stop template or describe it in English, backtest it on your chosen ETF, allocate cash, and confirm live trading. The strategy then runs every session in its own sleeve inside your Alpaca account.
Why 15% rather than 10%?
Wider trails survive routine corrections in exchange for a bigger giveback at the end. Both numbers are one-field edits in DeployQuant — backtest both and compare.
Backtests are hypothetical, computed by DeployQuant's engine on minute-resolution consolidated US market data (2021-01-04 to 2026-07-17, $10,000 starting capital, no margin, fees and slippage not modeled) and do not guarantee future results. Nothing on this page is investment advice. Live trading involves risk of loss.