When an order gets a fill then the
OrderFill event is raised. This occurs once only per fill:
' Event raised when the order has received a fill.
Private Sub moOrder_OrderFill(ByVal poOrder As T4.API.Order, ByVal poTrade As T4.API.Order.Trade) Handles moOrder.OrderFill
' Display some of the fill details.
Trace.WriteLine("OrderUpdate: " & poOrder.UniqueID & _
", Fill: " & poTrade.Volume & "@" & _
poOrder.Market.ConvertTicksDisplay(poTrade.Ticks))
End Sub
If you are not connected when the fill occurs then the fill event will not be raised when you reconnect. You would need to check your orders for fills after the AccountComplete event has fired on reconnection.
The fills or trades of an order are kept in the Order's
Trades property. The
TradeData has trade lists for the following:
| Trades | List of every individual fill received for this order. The newest fill is the highest index in the list. The combination of the order's UniqueID property and the index of the Trade in this list is unique. You can also Use the TradeID property as a unique identifier. |
| Aggregates | List of Trades grouped by price so that multiple Trades at the same price have a single combined entry. |
| TradeLegs | List of the individual leg fills received for this order. This is only populated for strategy markets where the exchange supplies leg fill information. The newest fill is the highest index in the list. |
Some example filled orders:
| Order | Trades | Aggegates | Legs |
| Corn Dec12, 1 fill | 1@6732 | 1@6732 | |
| Corn Dec12, 2 fills at same price | 1@6732 1@6732 | 2@6732 | |
| Corn Dec12, 2 fills at different price | 1@6732 1@6734 | 1@6732 1@6734 | |
| Corn Dec12-Mar13, 1 fill | 1@-76 | 1@-76 | dec12 1@6556 mar13 1@6564 |
| Corn Dec12-Mar13, 2 fills | 1@-76 1@-74 | 1@-76 1@-74 | dec12 1@6556 mar13 1@6564 dec12 1@6556 mar13 1@6562 |
Soybean Aug12-2Sep12-Nov12 Butterfly, 1 fill | 1@90 | 1@90 | Aug12 1@15326 Sep12 2@15004 Nov12 1@14772 |
Soybean Aug12-2Sep12-Nov12 Butterfly, 1 fill | 1@90 | 1@90 | Aug12 1@15326 Sep12 1@15004 Sep12 1@15004 Nov12 1@14772 |
Corn Dec12, 1 filled and then busted | 1@6732 -1@6732 | 0@6732 | |