The Backtest Engine

How AlgoLift replays years of tick data in minutes, what assumptions the fill model makes, and how to configure a backtest you can actually trust.

Updated 2026-05-24
11 min read
beginner

TL;DR. The Backtest Engine replays historical tick data through your strategy graph and reports what would have happened. It runs on a cloud cluster, so a 10-year MES backtest finishes in minutes instead of hours — and the fill model is strict enough that the equity curve you see closely matches what you'll see live.

What you'll be able to do

  • Configure a backtest (symbol, timeframe, date range, commission, slippage assumption) that produces results you can defend.
  • Understand exactly what the engine simulates and what it doesn't, so you know which numbers to trust.
  • Know when to leave "Simulate Fills" off for fast iteration and when to turn it on before you deploy capital.
Placeholder · Screenshot

Backtest configuration — a real MES 5m test ready to run

Author hint: The backtest configuration panel with realistic values filled in: symbol MES, timeframe 5m, date range 2018-01-01 to 2024-06-30, $0.62 commission, slippage mode set to 'Realistic'. Dark theme. Save to /public/images/guide/features/backtest-engine/hero.png.

What it lets you do

The Backtest Engine answers one question: "If I had been running this strategy from date X to date Y, what would have happened?" Everything else — the optimizer, the portfolio builder, the forward tester — is built on top of this answer.

Three things make the engine worth the page you're reading:

  1. Tick replay, not bar interpolation. The engine replays every print in the historical tape, not just the open/high/low/close of each bar. This matters because the order in which the high and low formed inside a bar determines whether your stop or your target hit first. Bar-only engines guess; this one knows.
  2. Honest fill modeling. When you submit a market order at the bid/ask, you get the bid/ask — plus slippage if the size at the touch wasn't enough to fill you. Limit orders sit in the queue and only fill once the historical volume cleared the orders ahead of yours. The order types & fills page covers the rules in detail.
  3. Cloud parallelization. A backtest gets split into monthly chunks that run on separate machines in parallel. A 10-year MES test that would take ~3 hours on a laptop finishes in roughly two minutes here. That speed is what makes parameter optimization practical at scale.

Where to find it

From any strategy in the Visual Builder, click Run Backtest in the top toolbar. The configuration panel slides out from the right.

Placeholder · Screenshot

Run Backtest — entry point from the Visual Builder

Author hint: Screenshot showing the 'Run Backtest' button highlighted in the Visual Builder toolbar, with the config panel open beside it. Save to /public/images/guide/features/backtest-engine/palette.png.

Step-by-step — configuring a backtest

1. Pick the symbol and timeframe

Your strategy graph already declares what data series it needs (each indicator node has a source series). The backtest panel inherits those — your job here is to pick the primary series's symbol and the bar size for that series.

If your graph also uses a higher-timeframe filter or a second instrument, those auto-fill from the graph. You don't enter them twice.

Placeholder · Screenshot

Symbol and timeframe selection

Author hint: The symbol+timeframe section of the config panel. Show MES selected, 5m bar size, and a secondary 60m series auto-inherited from the graph. Save to /public/images/guide/features/backtest-engine/setup-01.png.

2. Pick the date range

Default ranges are anchored to the contract or symbol's data availability. For futures with continuous contracts (MES, ES, NQ, GC, CL), data goes back ~10+ years. For newer products, less.

Two rules of thumb:

  • Use at least 5 years for any strategy you intend to deploy. The 2018 Q4 selloff, the 2020 COVID crash, the 2022 rate-hike cycle, and the 2023 yen-carry unwind all behaved very differently — a strategy that hasn't seen multiple regimes hasn't been tested.
  • Reserve the last 6–12 months as out-of-sample. Set the in-sample end date to ~12 months before today, optimize on that, then run the unchanged strategy on the held-out period. The avoiding curve-fit page explains why this is the single highest-leverage habit in systematic trading.

3. Set commission and slippage

Two numbers, both load-bearing.

Commission. Use your actual broker's round-trip rate. For MES at most retail brokers this is $0.62–$1.74 per contract round-trip. Don't leave it at zero — the slippage and execution page shows what happens to strategies that look profitable at zero cost and break-even at realistic cost.

Slippage model. Three options:

ModeWhat it doesUse when
NoneFills at the trigger price exactlyNever, except during the first ten seconds of debugging a graph.
Fixed ticksAdds n ticks of slippage to every market-order fillPrototyping, where you want to see how sensitive results are to a flat penalty.
RealisticWalks the book: if your order size exceeds the top-of-book quote, fills walk to the next level until filledThe default for any test you'd cite in a decision.

4. Choose "Simulate Fills" — off or on

This is the strictness toggle:

  • Off. The engine fills your order the moment the trigger price prints in the tape. Fast, generous, perfect for "does this signal even produce profit?" iteration.
  • On. Limit orders only fill when the historical volume after your price level cleared the orders that were ahead of yours. Market orders pay realistic slippage. This is the mode for any backtest whose result you're about to act on.

A typical research loop: 10–30 iterations with Simulate Fills off (find the rough idea), 1–3 final tests with it on (decide whether to deploy).

What the engine does and doesn't simulate

It does simulate: every tick of price and size, every bid/ask spread change, realistic queue position for limit orders, walking the book on market orders larger than top-of-book, contract roll-over for continuous futures, exchange fees (where the broker passes them through), commission, and partial fills.

It does not simulate: exchange-side outages, broker-side latency variance, the impact your own orders would have had on the book in low-liquidity instruments, or news events that halted trading. The simulation realism page covers each of these and how to bound the error.

How the engine runs

When you press Run, the engine:

  1. Splits the request into monthly jobs (one EC2 worker per month, in parallel) — unless the strategy carries positions across month boundaries, in which case it runs sequentially on a single worker to keep equity tracking exact.
  2. Streams ticks from the historical store to each worker, in chronological order, and feeds them through your graph one event at a time.
  3. Records every signal evaluation — not just trades. You can later inspect what a comparison node returned at any historical timestamp.
  4. Returns a result packet to the Analytics view: trade list, equity curve, per-bar indicator values, summary metrics (CAGR, Sharpe, Sortino, max drawdown, win rate, profit factor, expectancy — see trading metrics for definitions).

A typical 5-year MES 5m backtest runs in 30–90 seconds. A 10-year multi-instrument test runs in 2–4 minutes.

Placeholder · Screenshot

Parallel month-chunk execution in progress

Author hint: The running-state UI showing parallel month chunks (e.g. progress bars per month). Save to /public/images/guide/features/backtest-engine/setup-02.png.

Configuration reference

SettingDefaultWhat it controls
Primary symbol(inherited from graph)The instrument the strategy's execution clock runs on.
Primary timeframe(inherited)Bar size for the primary series.
Start / End dateLast 5 yearsRange of historical data to replay.
Starting equity$100,000The account balance the engine assumes on day one.
Commission per round-trip$0.00Cost in dollars per contract or share, round-trip. Set this to your broker's real rate.
Slippage modelNoneNone / Fixed ticks / Realistic. Use Realistic for any decision-grade test.
Simulate FillsOffWhen on, enforces strict queue and liquidity rules.
Contract roll methodCalendarHow continuous-contract futures handle the roll (calendar, OI-based, volume-based).

Tips and pitfalls

  • Don't test on too small a window. A 6-month "looks great" test usually means you stumbled onto a single regime. Five years minimum for anything you'd run.
  • Don't optimize on the full window. Use walk-forward optimization — it builds the out-of-sample habit into the workflow automatically.
  • Don't ignore the trade list. The summary metrics can hide ugly things (one giant trade carrying the equity curve, or one bad week wrecking everything). Open the trade list in Analytics and skim the worst 10 trades — that's where the real lessons live.
  • Don't compare two backtests with different slippage settings. Lock the settings, change the strategy. Otherwise you're measuring two things at once.
Common Misconception
Myth
A higher Sharpe ratio in the backtest means a better strategy.
Reality
A higher Sharpe in the *out-of-sample* window means a better strategy. A higher Sharpe in the in-sample window often means a better-fit curve — and curve-fit strategies don't survive contact with live markets. The discipline that matters is splitting your data, not raising one number.
Pro pattern: pin the config

Once you've decided on commission and slippage values for a given symbol, save them as a named config in the panel. Every future backtest of any strategy on that symbol inherits them. This single habit eliminates the most common source of meaningless backtest comparisons in a personal research log.

How this fits the workflow

You design in the Visual Builder. You run here. You interpret in Analytics. When the results justify it, you stress-test the parameters in the Optimization tools and combine the strategy with others in the Portfolio Builder. Before any of that lands on real capital, you forward-test on live data.

Key Takeaway

The backtest engine is only as honest as its fill assumptions. Run prototype iterations with Simulate Fills off; run every decision-grade test with it on, realistic slippage, and your broker's actual commission. Anything less is a chart you can't act on.