Client project · anonymised

Backtesting & validating a pattern-recognition strategy on Interactive Brokers

Client
Investment firm (US / UAE), anonymised
Platform
Interactive Brokers
Language
Python
Scope
Research, backtesting & simulated paper trading

The client & the goal

An investment firm operating across the US and UAE brought us a pattern-recognition strategy they had developed, and wanted it turned into a rigorously tested, automated system on Interactive Brokers. The plan was deliberate: research and backtest first, prove it on a simulated (paper) IBKR account until every edge case was handled, and only then let the client take it live with real money.

What we built

A modular Python backtesting and execution engine, not a black box. Separate, auditable components for data handling, signal detection, indicators, entry, risk and exits, each emitting a full audit trail (per trade, per day, per year and per signal) so any decision the system made could be traced back and checked on the chart.

The hard parts, what actually took the work

  • A backtest built not to flatter. We engineered out the ways a backtest lies to you: no look-ahead bias, and when a single price bar could have triggered several events, the engine always resolves to the worst case for the trade rather than the most flattering one. An honest backtest is worth more than a good-looking one.
  • Hardening messy real-world data. Historical files came with mixed date formats, comma-formatted numbers, duplicate timestamps, gaps and missing fields. We built defensive data handling so those quirks are cleaned and the series stays gap-free, data problems never silently corrupt a result.
  • Realistic costs, modelled honestly. We went beyond a frictionless test and modelled real IBKR commissions and slippage, even splitting slippage by how each order actually fills (resting-limit entries versus market-order stops). And we told the client plainly these were estimates to verify against their own account, not a promise.
  • Resisting overfitting, the discipline that mattered most. The client proposed extra conditions to try to improve the system. Rather than accept whatever looked better on past data, we put each change through walk-forward validation: tune it on an earlier slice of history, then confirm it still holds on a later, untouched slice, across more than one market at once. Most proposed “improvements” looked good in-sample but failed out-of-sample, textbook overfitting, and we rejected them. Only changes that survived the untouched data were kept.
  • Stability on paper before real money. The system runs on an IBKR paper account to shake out edge cases and prove it’s stable and reliable under live conditions, the gate the client set before going live.

The strategy and every trading decision are the client’s own. We’re the engineering and validation team, we build and test to their logic, we don’t advise on what to trade, and we make no claim about how the system performs.

This is the engineering behind our custom trading software and Interactive Brokers integration.

← All case studies

start here

Tell us your market, your broker, and what you want automated.

Send us the requirement. We'll come back with the questions that turn it into a real scope, cost and timeline, usually within one working day.

Book a consultation