The order during it’s life goes through the following states:
- None - the order has been created in the algorithm and has not been sent to the registration.
- Pending - the order has been sent to the registration
(IConnectorRegisterOrder(Order)) and the
IConnectorNewOrders event for it has been called.
The confirmation of the order acceptance from the exchange is expected. If successful, the IConnectorOrdersChanged,
event will be called and the order will be changed to the Active state.
Also the OrderId and OrderTime
properties will be initialized. In the case of the order rejection the IConnectorOrdersRegisterFailed
event with the error description will be called and the order will be changed to the Failed state.
- Active - the order is active on exchange. Such order will be active as long as all of the order
OrderVolume volume is matched, or it will be forcibly cancelled through
If the order matched partially the IConnectorNewMyTrades
events about new trades on issued order have been called, as well as the IConnectorOrdersChanged
event, which the OrderBalance notification about the order balance change passed.
The latest event will be arised in the case of the order cancellation.
- Done - the order is no longer active on the exchange (been fully matched
- Failed - the order has not been aссepted by the exchange (or intermediate
system, such as the broker server) for any reason.
To find out the order trading state (what volume is matched, whether the order fully matched, and so on) the
GetMatchedVolume(Order, IConnector, Boolean)
methods should be used:
Order order = ....