Skip to main content

Module order

Module order 

Source
Expand description

Orders: Finam OrderState <-> core snapshots, requests.

Functions§

build_place_order
Builds the PlaceOrder request. Quantity is in pieces (шт.), as in the Finam API.
cid_from_comment
Cid carried by an order echo: the comment (lossless) wins.
is_active
Order is still working at the broker (unknown statuses count as working, never hidden).
map_order_state
Core snapshot of a Finam order. cid is resolved by the caller (see OrderIndex).
map_status
Finam status -> core state. filled/left come from executed/remaining quantity.
order_instrument
Instrument of an order echo.
order_type_from_pb
Stop and multi-leg orders have no core equivalent: shown as the nearest plain type.
rejection_of
Rejection coming back as an order status in the PlaceOrder response.
side_from_pb
Finam side -> core side. An unspecified side reads as Buy: check the source of a value before you trust it on an order that is not yours.