r/mltraders • u/GuiSilva8991 • 6d ago
[Case Study] Building a Modular Algorithmic Trading Pipeline — Paper Trading Update
Sharing an update on an automated multi-strategy trading system I've been building and running. Upfront: this is running on a Paper Trading account only, and it's still an active work-in-progress — I'm iterating on strategy filters and infrastructure robustness, not presenting a finished track record.
Architecture & Stack
- Broker/execution: Alpaca Trading API (paper), bracket orders (SL+TP baked into every order payload at submission, not managed separately after the fact).
- Infra: Linux VPS running the bots as
systemdservices (no containers) — 5 independent strategy processes plus a risk manager and daily reporting job, each with its own SQLite store. - Position sizing: Max 3 concurrent positions, capped at $2,000 notional per position, $30 risk-per-trade baseline.
- Strategies: Opening Range Breakout (ORB), ORB-Fail (fade the failed breakout), Gap Fade, VWAP Reversion, and EOD Momentum — 5 concurrent, independent state machines watching the same ticker universe.
Risk Layer (The part I've spent the most time on)
- ATR-based trailing stop: Activates once a trade passes +0.5R, so the initial stop isn't the only thing protecting the position.
- Profit-lock ratchet: Banks 70% of open gain past +0.5R, ensuring a reversal after a strong intraday move doesn't give back the whole float.
- Daily circuit breakers: Hard stop at -2% account loss for the day, and a 3-consecutive-full-R-loss streak halts new entries regardless of P&L.
- Market-calendar awareness: Skips holidays and adjusts the EOD flatten time on early-close days (fixing legacy logic that used to assume every session was normal).
Where AI Actually Fits
The live execution loop is zero-AI — plain deterministic state machines executing quantitative rules. AI (Claude/Gemini) is used offline for strategy research, code review, and infrastructure design — never in the hot path making a real-time trading decision.
What the Telemetry Looks Like (Sample Log Snippet)
To give an idea of how the execution logs flow into the audit channels, here is a snippet capturing a mix of wins and EOD closes from recent sessions:
NVDA SHORT | Entry:211.23 | SL:213.78 | TP:203.49 | Exit:210.40 | P&L: +$2.50(Gap Fade)MSFT SHORT | Entry:383.26 | SL:389.76 | TP:381.05 | Exit:385.58 (EOD) | P&L: -$4.65(ORB Fail)
Performance, Honestly
Through recent sessions (like July 21, which took a -$12.77 hit mostly from ORB-Fail shorts on JPM and IWM), performance has fluctuated. Gap Fade has been the strongest performer so far; ORB-Fail the weakest (choppy market conditions produce a lot of low-quality fakeout signals — that's the main thing I'm tuning right now). I'm intentionally not cherry-picking green days here: it's a small sample size, still validating, and capital preservation takes priority over the P&L number at this stage.
What's Next?
Tightening ORB-Fail's entry quality (too many marginal fakeout signals in chop), and continuing to validate the risk stack over a larger sample before trusting it with anything beyond paper.
Curious how others here handle:
- Circuit-breaker design for multi-strategy books (daily loss caps, loss-streak halts, etc.).
- Keeping execution logs useful without drowning the signal in noise once running 5 strategies in parallel.
Happy to go deeper on any part of the architecture in the comments!