Guide · 4 min read
Why your TradingView backtest doesn't match your IBKR fills
The Strategy Tester shows one equity curve and your Interactive Brokers statement shows another. The gap is rarely one big thing. It's usually several small, measurable ones, and each leaves a trace in the two export files.
This guide lists the usual causes, what each one looks like in the data, and how to tell them apart. It describes what happens. It doesn't say what to change in a strategy.
1. The tester fills at a price you didn't get
By default, TradingView's broker emulator fills a market order at the open of the bar after the one where the strategy placed it. With process_orders_on_close, it fills at the close of the same bar. Either way, it fills the whole quantity at exactly that price. A live market order fills at whatever the book offers when it arrives, which is often a tick or two worse in fast markets.
The strategy's slippage setting (in ticks) is 0 unless the script or the Properties tab sets it, so by default the tester assumes none.
In the data: the fill price differs from the tester price on matched trades. Converted to dollars (ticks × tick value × contracts), it's usually the steadiest part of the gap.
2. Limit orders that the tester fills and the market doesn't
The tester fills a limit order once price trades at the limit. A real limit order waits in a queue, so a touch of the price doesn't mean it filled. Pine's backtest_fill_limits_assumption setting can require price to trade a few ticks through the limit first; it's 0 by default.
In the data: a tester trade with no broker fill near its entry time, a missed entry. These trades often look like the best ones in the tester, because price touched the level and turned.
3. Alert and relay delay
A live strategy usually runs through an alert: the condition triggers, TradingView sends the alert (with "once per bar close", that's after the bar closes), a webhook relay receives it and sends an order to IBKR. Each step takes time, and price moves in the meantime.
In the data: the gap between the tester's bar time and the broker's execution time. With the alert log as well, that delay splits into "the alert was late" and "the order was late after the alert". Delays that cluster at one bar length usually mean bar-close alerts (more on alert delay).
4. Commission the tester didn't charge
A strategy's commission is 0 unless it's set in the script or in Properties. IBKR charges every fill. On micro futures, round-trip commission can be a large share of the average trade.
In the data: the IBKR file's commission column, summed per trade. Commission is a separate number from slippage, so it doesn't hide inside "the fills were bad" (a worked example of costs).
5. Duplicate orders
A relay that retries after a timeout, an alert that fires twice, or two alerts pointing at the same account can each send the same order twice. The tester traded once and the account traded twice.
In the data: extra fills on the same side near one tester entry that aren't part of the same order. Split fills of one order (several executions under one order ID) are normal and aren't duplicates.
6. Orphan fills
A manual trade, a stop left over from an earlier position, or an order from another strategy on the same account all show up in the broker file with no matching tester trade.
In the data: broker fills that don't line up with any tester entry or exit.
7. Late or missing exits
If an exit alert is missed, rejected or delayed, the live position stays open after the tester has closed it. That changes the trade's result more than any amount of entry slippage.
In the data: an exit fill long after the tester's exit time, or none at all before the next signal. A few late exits can account for most of a gap.
8. Contract rolls and partial fills
A continuous chart such as MNQ1! switches to the next contract on its own roll date, which may not be the day your live orders switched. A limit order can also fill only part of its size, so the live trade is smaller than the tester's.
In the data: fills in a different contract month than the chart was on that day, and trades where the filled quantity is less than the tester's.
More detail: MNQ1! and futures rolls and Partial fills.
Is the gap real, or just noise?
After 20 trades, a gap of a few dollars per trade can be chance. Line up the same trades on both sides (only trades that filled on both entry and exit), take the live minus tester result for each, and bootstrap a range for the average. If that range still includes zero, the honest answer is "can't tell yet". The number of trades that would settle it gives a sense of how long that is.
Always report how many trades a number is based on. "$4 a trade worse" means little without "n = 23".
How to check your own trades
- Export the List of trades from the Strategy Tester (what's in that file).
- Export your executions for the same dates from IBKR with a Flex Query (step by step).
- Line them up trade by trade: match each tester entry to the nearest fill on the same side within a couple of minutes, then each exit. Then classify what's left as missed, duplicate, orphan or late.
Trade Teardown does that matching in your browser and shows each cause above in its own column, with the source line from both files on every row. Your files aren't uploaded.