Skip to content

How to Tell If a Backtesting Engine Gives Realistic Results

A backtesting engine gives realistic results when its settings for fills (the price and size each order gets), costs and timing match how the strategy trades. Most engines fill every order in full by default, so ask for the settings behind any backtest, a test on past prices.

A backtest is evidence of a hypothesis; proof only arrives with live capital. Start with a clean backtest, and choose a relevant time period.

What is a backtesting engine?

A backtesting engine is software that replays past market data through a strategy’s rules, simulates the resulting orders, and reports the profit and loss. Its fill model, cost settings and timing rules decide what counts as a trade, so two engines can report different results for the same strategy.

There are two ways to build one. An event-driven backtesting engine steps through the data one bar at a time (a bar is one minute, one hour or one day of prices) and reacts the way a live system would. Backtrader, Zipline, QuantConnect’s LEAN and NautilusTrader all work like this.

A vectorized engine, such as vectorbt, computes the whole history at once. It is much faster when you want to screen many ideas, and it makes it easier to use a price in a decision before that price was known.

Three words get mixed up:

  • the backtesting engine is the part that simulates the trades
  • a framework or library, such as Backtrader or Backtesting.py, is the code package you write the strategy in
  • a platform such as QuantConnect adds data, broker connections and hosting, and that choice is covered under choosing an algorithmic trading platform

Which open source backtesting software is the most realistic?

Zipline-reloaded has the most realistic default fills and costs of seven open source backtesting engines we checked in October 2026: it caps each fill at 10% of volume and worsens every price by 0.05%. Backtrader, LEAN, NautilusTrader, Backtesting.py and hftbacktest fill every order in full.

What each backtesting engine assumes if you change nothing

Slippage in the table is the gap between the price a strategy expects and the price it gets.

EngineA market order fills atBy defaultSame code trades live?
BacktraderNext bar’s open; one switch (cheat-on-close) fills at the close of the bar that gave the signalEvery order filled in full; no slippage, no commissionYes: Interactive Brokers, Oanda, VisualChart
Zipline-reloadedThe next bar’s close price, as in its tutorialEach fill capped at 10% of the bar’s volume; 0.05% slippage, $0.001 a shareNo live trading documented
QuantConnect LEANThe best price sellers offer (for buys) or buyers bid (for sells)“The pre-built fill models assume orders completely fill”; no slippage, Interactive Brokers fees on stocksYes
vectorbt (open source)A price the user chooses; no documented defaultNo slippage, no feesNo: “for educational purposes only”
NautilusTraderOn bar data, the price at the bar’s closeEvery order filled in full on bar data; a limit order (one at a set price or better) fills whenever the price touches it; no slippageYes: “no code changes” from research to production
Backtesting.pyNext bar’s open; one switch (trade_on_close) fills at the close of the bar that gave the signalEvery order filled in full; no spread, no commissionNo live trading documented
hftbacktestEvery trade and price change in order, including the order’s place in line and network delayEvery order filled in full unless partial fills are switched onYes: Binance Futures and Bybit

Read on 25 October 2026 in each project’s own documentation and release page: Backtrader broker, Zipline slippage model, QuantConnect trade fills, vectorbt settings, NautilusTrader fill models, Backtesting.py API, hftbacktest order fill. Defaults can change with each release.

Those are the defaults, and every engine lets the developer change them. So ask for the settings by name: the fill model, the share of volume each order may take, the commission and the slippage.

Delisted stocks are a separate question. LEAN’s user guide explains what happens when a stock you hold is delisted, and Zipline closes such a position at its last price. Whether the test includes the companies that disappeared still depends entirely on the data loaded into it.

Backtrader, vectorbt, Zipline, LEAN and NautilusTrader compared

  • Backtrader vs vectorbt. Backtrader steps through bars and connects to brokers such as Interactive Brokers. vectorbt computes in arrays, leaves the fill price to you and is built for research.
  • Backtrader vs Zipline: both step through bars, but Zipline caps each fill at 10% of volume and adds 0.05% slippage by default, while Backtrader fills everything at once at zero cost.
  • What about Backtrader vs Backtesting.py? Both fill at the next bar’s open by default, both charge nothing and neither models partial fills, so when their results differ, compare the settings and the data first.
  • LEAN explains delistings best in its own guide, and it still fills every order completely with zero slippage until you change it.
  • NautilusTrader runs the same code from backtest to live, and its starting fill settings let a limit order fill every time the price touches it.

What should you check in a backtest you are shown?

Check three things in any backtest you are shown: how orders were filled, which securities the test could trade, and when each signal became known. Ask for the fill and cost settings, proof that delisted stocks were included, and the price each order was filled at.

Fills: did every order trade at the price the test assumed?

QuantConnect says it plainly in its own documentation: in backtests, its pre-built fill models assume orders completely fill. Backtrader does the same unless the developer adds a filler, a setting that limits each fill to the volume available.

For a small order in a liquid market that is close enough. For an order that is large against the day’s volume, it makes the result look better than it would have been.

Ask which backtesting engine, fill model and slippage setting produced the numbers, and what share of the day’s volume the orders take. How slippage is set and checked is covered in how slippage is measured in trading.

Universe: were the companies that failed still in the test?

Survivorship bias means testing only on companies that still exist today, which leaves out the ones that failed. Ask whether the test universe includes stocks that were later delisted, and which data vendor and which version of the data were used.

Even the data underneath moves. When CRSP, the standard database of US stock returns, changed its format in January 2025, about one in ten historical monthly returns changed: 9.62% moved by more than 0.01 percentage points, a study in the Journal of Financial and Quantitative Analysis found in March 2026.

The authors found the averages that research relies on largely unaffected. For a single backtest, you want to know which version it ran on.

Timing: did the strategy use information it could not have had?

Look-ahead bias means a decision uses information that did not exist yet when it was made. The simplest version is filling an order at the same closing price that triggered it. Backtrader and Backtesting.py each do exactly this with one switch, cheat-on-close and trade_on_close.

Strategies that use AI models add a new version. In a 2025 study, GPT-4o was told to use only data up to 2010 and still called the direction of later US GDP growth correctly 98.0% of the time; on the same task for periods after its real training cutoff, it was right only 40% of the time (Lopez-Lira, Tang and Zhu). The model remembered what happened.

A backtest of an AI strategy over years the model was trained on tells you very little. Ask when each signal became known, and at what price the order would really have filled. Strategies written with AI tools have their own page: backtesting a strategy written with ChatGPT.

Does a backtest use the same code as live trading?

Not always: a backtest uses the same code as live trading only when the backtesting engine runs strategies both ways, as NautilusTrader, LEAN, hftbacktest and Backtrader do; vectorbt is for research only. Ask the manager which engine was used, and for every change since the backtest.

NautilusTrader says on its release page that strategies “deploy from research to production with no code changes”. Backtrader connects to Interactive Brokers and Oanda directly. vectorbt describes itself as “for educational purposes only”, so a strategy tested in vectorbt has to be rewritten before it can trade.

The same code is a must, and it is still not enough. NautilusTrader’s own documentation says live trading adds things a simulation may not reproduce, such as the exchange’s own rules, timing, and matching your records with the broker’s. The code also keeps changing after the backtest has run.

What happened · January 2025
  • Between November 2021 and August 2023, one Two Sigma modeler changed settings in fourteen models used in live trading, in many cases setting them to zero, without approval.
  • Staff had unrestricted read and write access to where those parameters were stored. The weakness was known in or before March 2019 and fixed from August 2023.
  • Some funds gained more than $400 million and others lost about $165 million. Two Sigma voluntarily repaid $165 million and paid $90 million in penalties.

The parameters are part of the strategy. A backtest without a change log describes a strategy that may no longer be the one running your money. When we review a strategy, we check whether its settings stayed stable and whether every change was logged and approved: how the Algotrader.ch Review scores change management.

What should you ask a manager for besides the backtest?

Besides the backtest, ask a manager for at least 24 months of live results, the assumptions behind the backtest, the change log for the live period, and records that tie live trades to the broker’s statements. US rules already require advisers who show backtests to explain their assumptions.

The rules already treat a backtest as something that needs explaining:

  • United States. The SEC’s Marketing Rule calls a backtest “hypothetical performance”, and an adviser who shows one must also show its risks and limitations.
  • A case: in December 2024 the SEC fined Atlas Financial Advisors $175,000. Its backtests covered years before its strategies started trading in 2015, and its website cited “Morningstar back-tested returns” it could not back up.
  • European Union. A simulated track record must be built from the real past prices of the same or very similar instruments, and it must carry a clear warning that past results do not reliably predict future ones (Delegated Regulation 2017/565, Article 44).
  • GIPS, the global standards for reporting investment performance: managers who claim to follow them may not join a backtest onto their live track record. Ask where the live record starts.

For firms under the EU rules for algorithmic trading (MiFID II RTS 6, in force since January 2018), the change log already exists: Article 5 has them record when each change was made, who made it, who approved it and what changed. Such a manager has no reason to refuse it.

The UK regulator made the same point in August 2025: firms need “clear, formalised procedures for deploying trading algorithms”.

How to check those 24 months is set out in how to check a verified track record.

We follow the same rule ourselves. The gold strategy in the Algotrader.ch Review has traded live since June 2024, and in October 2026 it started on a fourth PAMM account, a managed account traded on the investor’s behalf. Those live accounts are what we track. If you are still choosing whom to ask, start with the quant managers investors can access.

How do you build backtest code that is safe to trade live?

Backtest code is safe to trade live when it runs the same logic in backtest and live, decides only on data known at the time, fills conservatively, survives a restart, never sends an order twice, reconciles with the broker daily, logs every change and can be stopped instantly.

Each of the eight comes with something an investor can ask to see, so building it in also makes the strategy easier to check.

  • One code path. Run the same strategy code in the backtest and live, on a backtesting engine that supports both. Put the version tag of the code in both reports.
  • Only data known at the time. Test for look-ahead on purpose. The lookahead analysis in Freqtrade, an open source crypto trading bot, for example, “chains backtests and pokes at the strategy to provoke it to show lookahead bias”. Use point-in-time data, which keeps every value as it was known on each date.
  • Conservative fills: set partial fills and slippage yourself, because most engines start with every order filled in full and no slippage.
  • Survive a restart. At startup, compare your own order and position records with the broker’s before the strategy trades. Interactive Brokers’ open-order request does not return cancelled or fully filled orders, so fetch the executions separately.
  • Never send an order twice. Give every order its own client order ID. Binance rejects a repeated one with “Duplicate order sent.”, and Interactive Brokers wants each new order ID higher than the last.
  • Reconcile every day. Interactive Brokers warns that “often there are duplicate orderStatus messages”, so match fills against the broker’s execution reports and keep the daily report.
  • Log every change: when, who, who approved it and what changed. FINRA’s 2015 guidance on algorithmic trading asks for a change management process “that tracks the development of new trading code” (Regulatory Notice 15-09).
  • A kill switch you have tested. The code should cancel every open order at once, and it should enforce limits on price, order size and messages per second, as RTS 6 requires in Articles 12 and 15. Investors can ask who owns the switch and when it was last tested.

Check what your system does when its prices stop updating. On 29 October 2024 an automated system run by DV Trading on ICE Futures US traded on a stale data feed, and after repeated redeploys it kept sending orders that were not genuine for the rest of the trading session.

DV agreed to pay $40,000 in May 2026. A rule that stops trading when the data goes stale, tested before every release, prevents exactly this.

Clean code tells you the backtest ran the way it says. Whether its result is real is a statistics question, covered under backtest overfitting.

What a backtest should come with

Submit a strategy with its backtest settings and live record

Very few strategies sent to us arrive with what this page describes: the fill and cost settings behind the backtest, a change log for the live period, and a daily reconciliation with the broker. We check those once a strategy has passed our risk management checks, and the few strategies that survive the whole review are also tested with our own money.

For strategy teams
Submit your strategy →

Send us an algo or quant strategy with its backtest settings and at least 24 months of live results, and we will tell you whether it qualifies for review.

Common questions about backtesting engines

Is Backtrader still maintained?
Backtrader has had no new release on PyPI, the Python package index, since 2023, when version 1.9.78.123 appeared, and the project has published no statement on its status. Anyone using it for live trading takes on the maintenance and broker updates themselves.
Do professional traders backtest?
Professional traders backtest, and in the EU a firm that trades with algorithms must test each one before it goes live, keep that testing apart from live trading, and write down every important change. Those records are what an investor can ask to see.
What is the best backtesting tool?
The best backtesting tool is the one whose fill, cost and timing assumptions match how the strategy will trade. Small orders in liquid markets suffer least from simplified fills; large orders and limit orders, which trade only at a set price or better, need partial fills modelled.
What is the difference between a vectorized and an event-driven backtest?
A vectorized backtest computes signals and returns for the whole history at once, which is fast for screening ideas. An event-driven backtest steps through prices one bar (a minute, an hour, a day) or one trade at a time, as a live system would, which makes timing errors rarer.
Why do two backtesting engines give different results for the same strategy?
Two backtesting engines give different results for the same strategy because they assume different fills, costs and timing by default. One fills at the next bar’s open, another at the close that triggered it; one caps fills at a share of volume, another fills everything at zero cost.

By the Algotrader.ch editorial team · Algotrader.ch · Last updated 25 October 2026