Order Cancel Messages
The following trade model and set of message describe the fields and values required to successfully cancel an existing order, using the FX Professional Motif. For each of the messages below, [c] denotes that the message is sent by the client, [s] denotes that the message is sent by the server.
Architecture
For the front end client, the trade model library handles the processing of these messages. StreamLinkis used to send messages to the back end. For Order Cancellation there are two messages that the client can send:
-
the first is the message containing the order that is to be cancelled.
-
the second message is tailored for a very specific scenario. When an order cancellation is requested, the server normally takes a few seconds to confirm whether or not this was successful, sometimes however the time taken to process the request can take a much longer amount of time, in these cases the client must wait the entire duration of the timeout before being able to submit another order cancellation, or generally - interact with the blotter. The second message allows the client to send a message which will cancel the timeout, from which point onward the client can resume normal interaction with the front end again, but will need to monitor the progress of the order cancellation via the orders blotter.
For the back-end adapters, the FXIntegrationAPI consumes the client messages. The request for Order Cancellation are handled by an adapter that instantiates the FXOrdersAdapter object and registers an OrderCancellationListener (See the FX Integration API documentation for more information on Adapters). The order cancellation is handled by the FX Integration API using the CancelRequest object. The object contains the Responders and Events required to send messages from the server side, in order to transition the trade model to the final state.
Trade Model State Diagram
Blue arrows denote client messages and timeout messages, green arrows denote messages sent by the server.
Cancel Message [c]
This is the message the client sends in order to submit a request to cancel an order
Field Name | Description | Example |
---|---|---|
RequestID |
The client generated ID |
112314243333 |
MsgType |
The transition that the client wants to make in the state model |
Cancel |
OrderID |
The ID of the order that is to be cancelled |
1374143013248_2 |
ParentID |
[optional] If the order has a parent order, this is the ID of that parent order |
1374143013248 |
CancelWait Message [c]
This is the message that the client sends in order to cancel the default timeout period when waiting for a response from the server about the progress of an order cancellation.
Field Name | Value | Example |
---|---|---|
RequestID |
The request ID of the original Cancel message |
112314243333 |
MsgType |
The transition that the client wants to make in the state model |
CancelWait |
CancelAck Message [s]
This is the message that the server sends in order to acknowledge that the Cancel message has been received by the back-end adapters.
Field Name | Value | Example |
---|---|---|
RequestID |
The request ID of the original Cancel message |
112314243333 |
MsgType |
The transition that the server wants to make in the state model |
CancelAck |
CancelReject Message [s]
This is the message that the server sends which tells the client that the order cancellation request was rejected by the back-end trading system.
Field Name | Value | Example |
---|---|---|
RequestID |
The request ID of the original Cancel message |
112314243333 |
MsgType |
The transition that the server wants to make in the state model |
CancelReject |
CancelConfirm Message [s]
This is the message that the server sends which confirms that the order cancellation has been successfully executed in the back-end trading system.
Field Name | Value | Example |
---|---|---|
RequestID |
The request ID of the original Cancel message |
112314243333 |
MsgType |
The transition that the server wants to make in the state model |
CancelConfirm |
CancelPending Message [s]
This is the message that the server sends which tells the client that the order cancellation request is still being processed by the back-end trading system and may take a while.
Field Name | Value | Example |
---|---|---|
RequestID |
The request ID of the original Cancel message |
112314243333 |
MsgType |
The transition that the server wants to make in the state model |
CancelPending |
Error Message [s]
See also: