Sub topic 6
The trade is done: execution reports and confirmations
This chapter assumes you know what a limit order is and how price-time priority matches orders, which the matching chapter covered. It also assumes you can read short Python. When the book matches your order, three separate records get produced. They have different audiences, different timing, and different legal weight. Mixing them up is the most common mistake people make at this stage.
Three records, three audiences
A fill is a single execution of part or all of your order. It triggers three things.
| Record | Who produces it | Who receives it | Typical timing | Purpose |
|---|---|---|---|---|
| Execution report | The venue, then your broker | Your broker, then your app | Milliseconds to seconds | Tells you the state of your order |
| Trade report (the tape) | The venue or the reporting facility | The public, regulators, data vendors | Seconds | Publishes price and size with no names attached |
| Trade confirmation | Your broker | You | By the end of trade date or the next business day in practice | Written legal record of the transaction |
The execution report is operational, the tape is public, and the confirmation is the formal record you keep for tax and disputes. None of them means you own the share yet. Ownership transfers at settlement, which later chapters cover.
The execution report
When a venue matches your order, it tells the sender what happened. In the US and most other markets, brokers and venues exchange these messages using the FIX protocol (Financial Information eXchange). The message is called an ExecutionReport, and it is the same message type for acknowledgements, fills, cancels, and rejections. Your broker translates it into what you see in the app.
The fields that matter most for a fill are these:
- LastQty and LastPx: the size and price of this single fill.
- CumQty: the total shares filled so far on the order.
- LeavesQty: the shares still open and working.
- AvgPx: the volume-weighted average price across all fills so far.
- OrdStatus: the order's overall state, such as New, Partially Filled, Filled, Canceled, or Rejected.
One order can produce many reports. Suppose you buy 120 shares at a limit of 10.02. The book from the matching chapter fills 50 at 10.01 and then 70 at 10.02. That is two fills and two reports. After the first, the order is Partially Filled. After the second, it is Filled.
Order states
| OrdStatus | Meaning | Can it change again? |
|---|---|---|
| New | The venue accepted the order and it is resting or working | Yes |
| Partially Filled | Some shares executed, some remain | Yes |
| Filled | All shares executed | No |
| Canceled | The remaining shares were canceled, by you or by a rule such as end of day | No |
| Rejected | The venue or broker refused the order, for example for a bad price or lack of buying power | No |
A canceled order can still have fills. If 50 of 200 shares filled before you canceled, you own a 50-share trade, and the confirmation covers 50 shares.
Computing the report yourself
The code below keeps the running totals that a broker's system keeps. It uses Decimal because binary floating point cannot represent prices like 10.01 exactly, and money code should not accumulate that error.
from dataclasses import dataclass
from decimal import Decimal, ROUND_HALF_UP
FOUR_PLACES = Decimal("0.0001")
@dataclass
class OrderState:
order_qty: int
cum_qty: int = 0
notional: Decimal = Decimal("0")
canceled: bool = False
@property
def leaves_qty(self) -> int:
return 0 if self.canceled else self.order_qty - self.cum_qty
@property
def avg_px(self) -> Decimal:
if self.cum_qty == 0:
return Decimal("0")
return (self.notional / self.cum_qty).quantize(FOUR_PLACES, ROUND_HALF_UP)
@property
def status(self) -> str:
if self.canceled:
return "CANCELED"
if self.cum_qty == 0:
return "NEW"
if self.cum_qty < self.order_qty:
return "PARTIALLY_FILLED"
return "FILLED"
def apply_fill(self, last_qty: int, last_px: str) -> dict:
if last_qty <= 0 or last_qty > self.leaves_qty:
raise ValueError("fill quantity exceeds open quantity")
self.cum_qty += last_qty
self.notional += Decimal(last_px) * last_qty
return self.report(last_qty, last_px)
def report(self, last_qty: int = 0, last_px: str = "0") -> dict:
return {
"status": self.status,
"last": f"{last_qty}@{last_px}",
"cum_qty": self.cum_qty,
"leaves_qty": self.leaves_qty,
"avg_px": str(self.avg_px),
}
order = OrderState(order_qty=120)
print(order.apply_fill(50, "10.01"))
print(order.apply_fill(70, "10.02"))
print("total cost:", order.notional)
partial = OrderState(order_qty=200)
partial.apply_fill(50, "10.01")
partial.canceled = True
print(partial.report())Running it prints:
{'status': 'PARTIALLY_FILLED', 'last': '[email protected]', 'cum_qty': 50, 'leaves_qty': 70, 'avg_px': '10.0100'}
{'status': 'FILLED', 'last': '[email protected]', 'cum_qty': 120, 'leaves_qty': 0, 'avg_px': '10.0158'}
total cost: 1201.90
{'status': 'CANCELED', 'last': '0@0', 'cum_qty': 50, 'leaves_qty': 0, 'avg_px': '10.0100'}Your limit was 10.02, but the average price was 10.0158. The 50 shares that filled at 10.01 were better than your limit, because execution happens at the resting order's price. The average price in the app is a calculated figure and does not correspond to any single print on the tape.
Trade reporting: the public record
Each execution is also published to the public. This is called trade reporting, and it serves a different purpose from your execution report. It shows the market what traded, so that prices are visible to everyone and not only to the participants.
In the US, the path depends on where the trade happened:
- Exchange trades are sent by the exchange to the consolidated tape, which is the shared public feed of trades across US exchanges. Data vendors and your broker's quote screens read from it.
- Off-exchange trades, such as those executed by a market maker or on an alternative trading system, must be reported to a FINRA Trade Reporting Facility. FINRA's rule gives firms 10 seconds from execution to report. The facility then forwards the print to the consolidated tape.
The public print shows the symbol, price, size, time, and venue. It does not show who bought or sold. Regulators separately receive the identities through the Consolidated Audit Trail, a regulatory database that tracks each order from receipt through execution. Your tax records and your account statement do not come from the tape.
The trade confirmation
The confirmation is the formal, written record. In the US, SEC Rule 10b-10 requires a broker-dealer to give the customer written notice of the transaction at or before its completion. In practice, brokers send it electronically, on or shortly after trade date. It must disclose, among other things:
- the trade date, and the time of execution, or a statement that the time will be provided on request;
- the identity and number of shares of the security;
- the price, and the total amount paid or received;
- the broker's capacity, either as an agent for you or as a principal trading from its own inventory;
- the commission or other charges, and, when relevant, the markup or markdown if the broker acted as principal;
- the settlement date.
Many retail brokers now offer electronic delivery by default. They also send an end-of-month or quarterly account statement. The statement lists holdings and activity. It is not a replacement for the confirmation, which is the document tied to a single trade.
Confirmations for retail investors list a single line for the order, even when there were multiple fills. The price shown is the average price. Some brokers also include the individual fills on request.
The settlement date appears on the confirmation
The confirmation's settlement date is the trade date plus the settlement cycle. In the US, the cycle has been one business day (T+1) since May 28, 2024. A Friday, November 20, 2026 trade settles on Monday, November 23, 2026. A Wednesday, November 18 trade settles on Thursday, November 19. The settlement chapter explains the mechanics. For now, the confirmation date is the one to check, because a market holiday shifts it by a day. A weekday-only calculation, like the one in the settlement example, does not know about holidays.
Errors, corrections, and cancellations
Reports are not always final.
- Order rejected. The fill never happened, so nothing is owed. A common cause is insufficient buying power or an invalid limit price.
- Trade canceled by the venue. A trade can be broken or canceled after the fact. Exchanges have rules for clearly erroneous executions, where a print is far outside a reference price, often after a malfunction. The confirmation is then canceled or corrected.
- Broker error. If your broker made a mistake, such as sending a wrong quantity, the broker usually corrects it and sends a corrected confirmation. Compare every confirmation against what you intended.
- Duplicate or late reports. FIX systems may resend a message. Well-built systems detect duplicates and do not apply the same fill twice. The code above refuses a fill larger than the open quantity, but a real system also tracks unique execution identifiers.
What to check on your confirmation
- The symbol, quantity, and side match your order.
- The price is at or better than your limit, if you set one.
- Fees match your broker's schedule, and the capacity (agent or principal) is what you expect.
- The settlement date is the trade date plus one business day, allowing for holidays.
- The fill count and average price agree with the app's order history.
If any of these are wrong, contact the broker promptly and in writing, citing the order's reference number.
Exercise
You place a limit order to buy 300 shares at 25.00. The book fills 100 at 24.98, then 150 at 24.99, and the remaining 50 shares stay open. What are CumQty, LeavesQty, AvgPx, and OrdStatus after the second fill?
Show answer
CumQty is 250 and LeavesQty is 50. The cost is 100 x 24.98 + 150 x 24.99 = 2498.00 + 3748.50 = 6246.50. AvgPx is 6246.50 / 250 = 24.986. OrdStatus is Partially Filled, because shares remain open.
Exercise
Name the three records produced by a fill, and say which one the public sees and which one you keep for your own records.
Show answer
The execution report goes to your broker and then your app, and it describes the state of your order. The trade report on the tape is the public one, showing price and size but no names. The written trade confirmation is the one you keep, because it is the formal record of the trade, including price, capacity, fees, and settlement date.
Exercise
Your 200-share limit order filled 80 shares and you then canceled it. How many shares will your confirmation cover, and does the trade settle?
Show answer
The confirmation covers 80 shares, since only filled shares are a trade. The 80 shares settle on the normal cycle, so one business day after trade date under T+1. The canceled 120 shares never traded and have no settlement.