Order Entry
StreamOrders RPC provides a bidirectional streaming interface for sending Add, Modify, and Cancel order requests and receiving responses.
Example Requests
Add Order
Cancel Order
You can cancel an order in two ways: 1. By order_id
: Cancels the single
order matching that unique identifier. 2. By client_order_id
: Cancels
all orders for your account that share the same client_order_id. Uniqueness
is not enforced, so multiple orders may be cancelled at once.
Modify Order
You can only modify orders by orderId
.
This is to prevent modifications of inflight orders. If you must modify an order before receiving an ACK, cancel the order and re-add it.
You cannot modify an order that has been partially filled.
Full Example Code
Example Response
This response is for an Add Order request. For Modify and Cancel requests, the response will be the same but with the status
field set to MODIFIED
or CANCELLED
respectively. If any field returns the default value, it will not be printed to console.