Start with the evidence
A popular MIT-licensed GitHub repository offered eleven skills for an AI agent to day trade an Opening Range Breakout strategy. It looked serious, but it did not show whether the strategy actually made money. Before putting a dollar behind it, I rebuilt the engine and tested the claim.
A negative result is still a result
Across eighteen months of five-minute bars, with costs included, the strategy lost an average of 0.09 times the risk taken per trade. None of the 36 tested variants was positive. Even without costs, the return was statistically indistinguishable from zero; over the same period, the S&P 500 gained 25%. The point was not to find a parameter set that looked good, but to find out whether the original idea held up.
Testing five ideas without moving the goalposts
I then moved to multi-day strategies. Before looking at the data, I preregistered five hypotheses and locked the final test period in the database, using the logic of a scientific study. Only trend following produced a modest but genuine result: slightly better risk-adjusted returns than the S&P 500 and an 8% maximum drawdown versus 34%. The other four hypotheses did not meet their criteria.
From research to a usable tool
The bilingual web application has a trading-terminal feel and compares any portfolio with the S&P 500 over ten years of real data. It reports returns, worst drawdown, volatility and Sharpe ratio over both three years and the full period, with indicators, monthly heatmaps and direct comparisons. It can also connect to an Alpaca account: a target allocation becomes a calculated rebalancing plan and, when authorized, executable orders. Eleven Agent Skills work with Claude Code, Codex and Grok so an agent can analyze, propose and rebalance.
Safety is part of the architecture
Risk limits are written into the code rather than exposed as editable settings: no leverage, no short selling, market hours only, order plans that expire after fifteen minutes, an emergency stop and idempotency keys that prevent a duplicate order. With real money, each plan requires a six-digit code shown only in the user’s terminal. An AI can prepare a plan, but it cannot approve it. Paper-account execution was validated, and 145 automated tests cover the rest.
What the project demonstrates
APtrade is an exercise in rigor, safe-system design and full-product delivery: a backtesting engine, a web application, documentation and a tutorial released as open source. Its results are presented as research, not a promise: past performance does not predict future results.