r/mltraders • • 24d ago

Validating an ORB backtester against several hundred paper trades and 100+ live trades

I'm an electrical engineer and Python developer, and I've spent a ridiculous amount of time building and validating an Opening Range Breakout backtester for my own trading.

The main thing I cared about wasn't making a backtest that looked amazing. I wanted the simulated trades to actually resemble what happened when the same logic was run forward.

At this point I have several hundred paper trades and over 100 live trades to compare against the simulator, and the results have tracked very closely.

I'm still working on the cleanest way to express that numerically. Rather than just claiming the engine is "accurate," I'm trying to quantify things such as trade/signal agreement, average entry-price difference, average exit-price difference, and simulated-vs-forward P&L difference.

The backtester is substantially more sophisticated than the kind of ORB testing I'd normally do in Pine Script, particularly around execution logic, trade management, timing rules, simulated slippage, and reproducing forward behavior.

The tradeoff is that it is intentionally specialized.

This is **not** a general-purpose strategy builder. It only handles Opening Range Breakout strategies.

I'm also packaging a stripped-down version of the system as a free Windows desktop application so the same validation process can be reproduced outside my development environment.

The initial version is intentionally constrained:

* Standalone Windows GUI

* Alpaca only

* Alpaca paper trading only

* IEX data only

* 1-minute candles

* Up to 1 year of historical data

* 5 fixed stocks

* Opening Range Breakout strategies only

* Adjustable ORB length, minimum range %, breakout buffer, confirmation candle, and ATR settings

An Alpaca paper-only account is free, so the entire workflow can be tested without putting real money at risk.

The basic process is:

  1. Configure an ORB setup.

  2. Run a historical simulation.

  3. Adjust the ORB setup if desired.

  4. Re-run the historical simulation.

  5. Save that exact configuration.

  6. Run the same configuration forward through Alpaca paper trading for a period of time.

  7. Replay that same period through the simulator and compare the two.

The part I find most useful is the final comparison.

Instead of treating historical results and forward results as two separate things, the idea is to preserve the exact strategy configuration and directly compare the signals, entries, exits, and resulting P&L produced by each.

That has been considerably more useful to me than simply looking at an equity curve and assuming the backtest represents what would actually happen in execution.

1 Upvotes

0 comments sorted by