Skip to main content

Module stop

Module stop 

Source
Expand description

Stop orders: conditional orders of the exchange.

Bybit has no separate stop order method for category linear. A conditional order is an ordinary order with a triggerPrice: it waits as Untriggered and becomes a working order when the price crosses the trigger. The shared kinds map as follows.

KindOrderTrigger direction
StopLossmarketa sell waits for a fall, a buy for a rise
TakeProfitmarketa sell waits for a rise, a buy for a fall
StopLimitlimit at limit_priceas StopLoss

The take profit and stop loss that the exchange keeps on a position (/v5/position/trading-stop) are conditional orders too: they are listed here, with a made-up cid, but this connector does not create them (they need an open position and cannot carry a client order id).

Functions§

build
The request for a stop order.
snapshot
The snapshot of a conditional order.
state_of
The state of a conditional order by the status of the exchange.
trigger_direction
The trigger direction of the API: 1 when the order fires as the price rises to the trigger price, 2 when it falls to it.