Skip to main content

Module stop

Module stop 

Source
Expand description

Stop orders: core requests <-> StopOrdersService messages.

Units as for plain orders: the domain request counts in units of the instrument and the wire counts in lots, so the functions here take or read the lot size. Prices are per one instrument.

Functions§

build_post
Builds the PostStopOrder request for account from a domain request. lots is the quantity in lots (the request is in units, the caller converts with the lot size of the instrument).
same_as_request
true when the broker stop order o is what req asks for: the same instrument, side, kind, number of lots (lots), stop price and limit price. Nothing else is compared: the broker does not return the cid, so this is how a stop order whose placement got no clear answer is recognised.
snapshot
Core snapshot of a broker stop order. cid comes from what this connector registered at place_stop (the broker’s StopOrder does not carry the idempotency key). lot is the lot size of the instrument: the quantity of the snapshot is in units.
validate
Checks that need no network. Run before any quota is spent or anything is registered.