Module order
Expand description
Order and execution mapping.
Constants§
- LIST_
STATUS_ ACTIVE - Order status of the list: 3 = active.
- PLAIN_
LIST_ TYPES - Order types of the order LIST (
POST /orders/search) that are plain orders: 1 market, 2 limit, 3 iceberg, 10 limit for 30 days. Types 4..7 and 11 are conditional (stop) orders. - STOP_
LIST_ TYPES - Order types of the list that are conditional orders: 4 stop-limit, 5 and 11 take-profit, 6 stop-loss, 7 take-profit and stop-loss.
Functions§
- map_
order_ ack - Builds an [
OrderAck] for a client order id and the broker’s order id. The ack carries the local receive time only, the broker gives no time with it. - map_
order_ record - A plain order of the list.
cidis what the caller knows about this order (the list does not carry ourclientOrderId). - map_
order_ status - Maps an order status answer to an
Event::Order.Nonewhen the client order id is not a UUID or the answer has no report. - map_
place_ response - Maps the plain answer of a place request (
status: OK) to anEvent::Orderthat says “acknowledged”. - map_
state_ list - The latest report of an answer with a
datalist (GET /orders,/orders*/sync) as a snapshot.known_cidis the cid the caller asked about (a status answer is about that order); without it the ids of the answer are used. - map_
stop_ record - A conditional order of the list as one or two stop snapshots (two for type 7, a take-profit and
stop-loss pair: the pair is one order at the broker, shown as its two legs with the same ids).
Nonefor plain orders. - map_
ws_ order_ message - Maps a message of the order events WebSocket to an
Event::Order. - message_
cid - The cid of the order an
orders/events/wsmessage is about. - rejection_
reason truewhen the report says the broker refused the order (orderStatus8), with its reason.