How do I entry cross margin short with a take profit and stop loss with it? Like borrow to short then place a tp and sl to repay

Hi, I’m working on a strategy that requires shorting with a take profit and stop loss based on the entry price, and when one triggers it cancel the other limit order. But the problem is Binance margin API doesn’t allow to place both in 1 request, how do I do this in python?

Hi @Lamaproinfinite, placing TP/SL order simultaneously is not a API feature at the moment.
However you could try to produce similar behavior by using WS events.
The logic can be seen in How to implement OTOCO(TP/SL) orders using API - #2 by MJW, but instead of for Futures, do it for Spot Margin.