bybit-exchange / pybit

Official Python3 API connector for Bybit's HTTP and WebSockets APIs.
Other
385 stars 129 forks source link

Conditional order is placed as regular order 🤔 #156

Closed jcianci12 closed 1 year ago

jcianci12 commented 1 year ago

When I place an order like this:

print(get_session(TEST).place_order(
    category="spot",
    symbol="BTCUSDT",
    side="Sell",
    orderType="Market",
    qty="0.000401",
    triggerPrice="29000",
    triggerDirection=0
))

the order is registered as a regular order instead of a conditional order as the documentation states at the v5 documentation:

How to create conditional order: When submitting an order, if triggerPrice is set, the order will be automatically converted into a conditional order. In addition, the conditional order does not occupy the margin. If the margin is insufficient after the conditional order is triggered, the order will be cancelled.

Any help would be much appreciated 🙏

dextertd commented 1 year ago

Please check orderFilter param in the documentation for how to place a TP/SL order for spot. Spot API does not support conditional orders, only TP/SL orders. https://bybit-exchange.github.io/docs/v5/order/create-order