Trade Teardown

Guide · 3 min read

Partial fills

In the Strategy Tester, an order either fills completely or not at all. In a live account, a 2-contract limit order can fill 1 contract and leave the other waiting. Then the live trade is smaller than the tester's, and the P&L gap is partly about size, not price.

How the tester fills an order

TradingView's broker emulator fills the whole order once price gets there. For a limit order, its documentation says the order fills when the market price reaches the limit, or crosses it in the favourable direction, at that price or better.

The backtest_fill_limits_assumption argument of strategy() changes that. It's the number of ticks price has to move beyond the limit before the emulator counts a fill. The default is 0, so a touch is enough.

How a live order fills

Split fill or partial fill?

They look alike in a broker file and mean different things.

Split fillPartial fill
What happenedOne order filled in full, as two or more executionsThe order filled less than its size
Example, tester size 21 at 21,000.25 and 1 at 21,000.50, same order ID1 at 21,000.25, nothing more
In the reportOne entry at the size-weighted average price, labelled as usual (Matched, Late exit…)Labelled Partial fill, with a note such as Filled 1 of 2

The report groups executions by order ID when the broker file has one (most fill and order exports do, including IBKR Flex, Tradovate, NinjaTrader Executions, ProjectX and Rithmic), so a split fill is one entry, not a duplicate.

What a partial fill does to the numbers

Take a tester trade of 2 MNQ long that gains 20 points. MNQ is $2 a point, so the tester shows $80. Live, 1 contract fills, at exactly the tester's prices:

Tester: 2 contracts × 20 points × $2$80
Live: 1 contract × 20 points × $2$40
Gap (live − tester)−$40
Price slippage0 ticks

The whole gap is the missing contract. A partial fill on a losing trade does the opposite: the live loss is smaller, and the gap looks like an improvement. That's why the report keeps the two apart.

Then the exit

If the entry filled 1 of 2 and the exit order is sent for the tester's full 2, the exit is larger than the position. Depending on the bridge and broker, the extra contract may be rejected, or may open a position in the other direction. The report adds a note when the sizes differ, such as Exit size 2 differs from entry size 1. An unintended opposite position closed later shows up as orphan fills: fills with no tester trade near them.

Seeing how much the tester leans on touch fills

Partial and missed fills tend to cluster where a limit order sits at the very edge of a move, the bar's high or low. One way to measure how much of a backtest depends on those fills: set backtest_fill_limits_assumption to 1 or 2 ticks, run the tester again, and compare the two List of trades exports. Trades that vanish are the ones that needed price to just touch the level.

Trade Teardown labels each partial fill, shows how much filled against the tester's size, and keeps size apart from price slippage, with the source line from both files, in your browser.

See a sample report