20-Day Momentum + Trailing Stop on Alpaca
Buy after a +10% four-week burst and let a 10% trailing stop manage the exit. 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 the 20-day return > +10% · THEN buy with 98% of the sleeve
- WHILE invested · a managed trailing stop follows 10% below the position's high-water mark
Good for: high-momentum assets where trends extend — semiconductor and leveraged tech ETFs show the archetype.
Watch out: buying strength means buying high; when a burst immediately reverses, the trail exits about 10% below the entry.
Strongest backtests for this strategy
| ETF | CAGR | max DD | trades |
|---|---|---|---|
| SOXL | 23.9% | −67.3% | 134 |
| QLD | 21.7% | −20.1% | 20 |
| SPUU | 16.7% | −17.6% | 12 |
| SOXX | 15.2% | −30.2% | 18 |
| SSO | 14.8% | −24.2% | 13 |
| ROM | 12.2% | −36.2% | 32 |
| XLK | 12.1% | −26.1% | 9 |
| TECL | 11.0% | −48.5% | 62 |
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 momentum breakout on Alpaca?
Connect Alpaca to DeployQuant (trade & read permissions only), pick the 20-Day Momentum + 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.
How does the trailing stop work when deployed live?
DeployQuant maintains it as a managed order: it ratchets up as the position makes new highs and triggers a market exit when price falls through it. It never widens.
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.