My Masterpiece · Built in 23 Days

The Algorithmic Trading System

It invented 9,300 trading strategies, ran 486,000 trials, and tried to kill every single one. The one that survived crushed buy-and-hold.

The Champion

15.2%

a year.

Out-of-sample, against 1.1% a year for buying and holding the sector’s five largest stocks, July 2024 to May 2026.

9,300

Strategy designs generated and screened

486,000

Parameter trials

1

Champion left standing

1,335

Automated tests

The Idea

Most trading bots are one idea and a pretty backtest. Mine is the opposite.

A backtest that looks great is easy to build and usually means nothing. The hard part is knowing which results are real.

So I built a research machine that generates strategies by the thousand and then attacks every one of them. It runs the whole pipeline, from market data to strategy search to validation to live orders on a brokerage paper account, reconciled to the penny.

The Results

The champion that survived everything

A breakout strategy on the energy sector. It buys when a stock breaks its 20-day high, holds up to 10 days, and protects itself with a trailing stop that adapts to volatility.

Out-of-sample test

15.2% /yr

Against 1.1% a year for buy-and-hold, on market data it was never tuned on. 170 trades, July 2024 to May 2026.

Harshest cost stress

2.5% /yr

Triple the slippage and per-share commissions together, and it still came out ahead of the benchmark.

First live paper run

+1.20%

Against +0.37% for the energy sector index fund, May 14 to 26, 2026. Every position reconciled to the broker to the penny.

The Gauntlet

9,300 strategies in. One champion out.

Every strategy combines an entry signal, a filter, a way of combining them, an exit rule, and a market hypothesis. The system builds every combination, throws out the duplicates and the nonsense, and then makes each survivor prove itself again and again.

  1. 9,300

    The design matrix

    17 entry signals, 17 filters, 4 combiners, 5 exits, and 5 hypotheses make 28,900 combinations. De-duplicated and rule-checked, 9,300 remain.

  2. 1,945

    The smoke test

    Beat buying and holding, and clear a 12% annual return, over 2022 to 2024. Most designs die here.

  3. 457

    Cross-validation

    250 tuned trials per strategy, scored across five separate time periods with a buffer between them, run in parallel across 23 processor cores. It has to win in most periods, keep its losses in check, and trade often enough to mean something.

  4. 44

    Out-of-sample

    Now prove it on market data it was never tuned on.

  5. 9

    Cost stress

    Still beat the benchmark with triple the slippage, per-share commissions, and both at once.

  6. 1

    The champion

    A final review of the nine survivors crowns the cleanest, most robust design.

Why the Number Holds Up

Engineered like being wrong costs money

No peeking at the future

Signals are computed at the close and filled at the next open, and every calculation looks only backward. Date windows are checked automatically, so testing never leaks into research.

What trades is exactly what was tested

The live decision logic is checked against the backtest engine by automated tests, and again before every single order. If they disagree, nothing is submitted.

Reproducible to the trade

Seeded searches, fixed ordering, and frozen reference results mean any run repeats exactly. Any change in behavior gets caught.

It protects the account first

A soft halt at 10% below peak, a hard halt at 20%, a daily loss limit, and a guard against every position riding the same bet.

Caught a double-count before it cost a cent

A manual catch-up run risked counting one trading day twice. I traced it, corrected the positions, and added a guard that refuses to process any day twice.

Every decision on the record

The champion choice, its backup, and the reasons live in an append-only log. Every live day produces a reconciliation, a replay, and an audit file.

One Developer

Built in 23 days

68,000

Lines of code

25,800

Lines of tests

1,335

Automated tests

2,114

Commits

More test code than application code, because that’s what software that handles money deserves. AI tools sped up the typing; every research design, every gate, and every acceptance decision was mine.

This is how I build when it’s for me. Imagine what I’ll build for you.

Checks that verify themselves, records that reconcile, and nothing shipped on a hunch. The same discipline runs an insurance agency’s carrier audit, which re-checks every change before it writes a thing.

A private system I run locally on a brokerage paper account for my own research. It isn’t offered as a service or as investment advice, and the code stays private.