EMA 12/26 Trend on Alpaca
Hold while the 12-day exponential average is above the 26-day — the MACD's skeleton as a position switch. 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 EMA(12) > EMA(26) · THEN buy with 98% of the sleeve
- WHEN the market opens · IF invested AND EMA(12) < EMA(26) · THEN sell the whole position
Good for: traders who like MACD logic but want it expressed as a simple, testable long/flat rule.
Watch out: faster reaction means more trades and more whipsaws than a 50/200 cross; check the trade count on each backtest page.
Strongest backtests for this strategy
| ETF | CAGR | max DD | trades |
|---|---|---|---|
| SOXL | 25.4% | −65.4% | 22 |
| TECL | 21.3% | −53.5% | 22 |
| SPUU | 20.0% | −22.9% | 19 |
| SSO | 19.2% | −22.9% | 19 |
| TQQQ | 17.6% | −50.0% | 22 |
| SOXX | 17.5% | −34.0% | 22 |
| ROM | 16.3% | −42.5% | 23 |
| CLSE | 15.5% | −10.2% | 17 |
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 EMA 12/26 trend on Alpaca?
Connect Alpaca to DeployQuant (trade & read permissions only), pick the EMA 12/26 Trend 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.
Is this the same as trading MACD signals?
It's the MACD's underlying trend component. Classic MACD trades the signal-line crossover of the 12/26 spread; this template trades the spread's sign directly — simpler, and fully expressible in blocks.
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.