Log Pose

Broker trade reconstruction

How to Rebuild a Trade from Orders and Fills

Reconstruct positions from orders and fills without confusing order intent, executions, average price, partial exits, or open inventory.

Editorial illustration of order tickets becoming individual fills and then one reconstructed position
The order expresses intent. The fills determine the position.

Orders and fills are different records#

An order says what you asked the broker to do. A fill says what executed. One order can have zero, one, or many fills. A canceled order may have executed partially before cancellation. Reconstructing from order quantity or final order status can therefore create inventory that never existed.

Use the most granular execution record available. At minimum, preserve a stable fill identifier, account, symbol, side, absolute quantity, price, execution timestamp, fees, and source order identifier.

Normalize before matching#

Broker feeds do not always encode direction the same way. Some provide side = SELL with a positive quantity; others may expose a negative unit count. Convert every fill to a signed position delta once: buys positive and sells negative. Do not apply the sign twice. Validate the normalized record against a known sell before processing the whole account.

Normalize symbols and timestamps too. A timestamp without its source timezone can place an after-hours execution in the wrong session or even the wrong trading day.

Walk the position ledger#

Group by account and instrument, then sort by execution time with a stable tie-breaker such as fill ID. Start with the known opening inventory for the requested history window.

For each fill:

  1. Add the signed quantity to the running position.
  2. If the prior position was zero and the new position is nonzero, open a trade.
  3. Attach fills while the position remains on the same side.
  4. If the position returns to zero, close the trade.
  5. If a fill crosses through zero, close the old trade at the crossing quantity and open a new trade with the remainder.

If the history begins while a position is already open, mark the trade incomplete unless an earlier holding snapshot supplies the opening quantity and basis.

Process showing raw fills, normalization, position ledger, trade boundary, and chart review
Position boundaries come from signed quantity, not order status labels.

Work a concrete partial-fill example#

Time Side Quantity Price Running position
10:01:02 Buy 40 $50.00 +40
10:01:05 Buy 60 $50.10 +100
10:18:22 Sell 25 $50.70 +75
10:31:40 Sell 75 $50.45 0

This is one completed long trade with four fills. The volume-weighted entry is $50.06. The exits occurred at two different times and prices. A single average exit can summarize realized P&L, but it cannot replace the execution path on the chart.

Metric cards showing three transactions and a flat ending position
Four executions can still be one trade.

Define the matching method#

For a pure round-trip review, the zero-to-zero boundary is often enough. Tax lots and realized P&L may require FIFO, specific-lot, or broker-provided accounting. Do not claim that a journal reconstruction is the account's tax record unless it uses the broker's official method and has been reconciled.

Fees must be allocated consistently. Assign each fill's fee directly or prorate an order-level fee across its fills, then record the policy.

A counterexample is a trader who owns 100 shares from last month, buys 20 intraday, then sells 20. An algorithm that ignores opening inventory may call it a completed day trade; the account actually moved from 100 to 120 and back to 100.

Detect conflicts instead of hiding them#

Stop and flag the record when a duplicate fill ID changes values, sells exceed known inventory without an allowed short position, a split interrupts the quantity series, the history lacks opening inventory, or reconstructed ending quantity differs from the broker holding.

The conflict count belongs in the review. Silently discarding an inconvenient execution makes every downstream chart and metric look more certain than the source permits.

Run a ten-trade reconciliation#

Select ten trades containing at least one partial fill, one overnight hold, and one scale-out. Reconstruct them from raw executions. Compare ending quantities, realized proceeds, fees, and timestamps with the broker statement.

Only after the quantities reconcile should you attach setup labels or calculate expectancy. The chart review starts where execution accounting stops—not the other way around.

Sources and methodology#

Product details and workflows can change. Links below are the primary references checked for this page; the analysis and operational definitions are Log Pose’s.

  1. SnapTrade account data documentation — SnapTrade
  2. Robinhood reports and statements — Robinhood

Log Pose is not affiliated with Robinhood, Inner Circle Trader, or the products discussed on this page. This material is for education and recordkeeping, not investment advice. Historical and hypothetical results do not predict future performance.