From API documentation (https://binance-docs.github.io/apidocs/spot/en/#new-oco-trade) I understand that OCO orders can be created in spot account only. But in this link (https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-order-trade) mentioned that OCO orders can be canceled in margin account. So the question is: is it possible to create OCO orders in the margin account? How can I create them?
Hi. Thanks for checking the document carefully.
That was implemented like that in order to reuse the code as much as possible. Let me show you another example here ( https://binance-docs.github.io/apidocs/spot/en/#new-order-trade ). This is the spot API for placing a non-OCO order. Its return object also includes the same "orderListId": -1
.
So placing OCO orders for margin account is not supported?
Correct, it’s not supported.