I want to develop a trading bot that executes orders on binance futures.
I am trying to create LONG and SHORT orders when the price goes up 5% in an specific ammount of time. But every time I try to create an order, I have to make three API calls:
LONG - BUY
LIMIT - SELL
STOP_MARKET - SELL
It has happenned multiple times that the first one (LONG - BUY) works but the others fail for different reasons all the time:
APIError(code=-2021): Order would immediately trigger.
APIError(code=-4016): Limit price can’t be higher than 0.82313
…
Is there any way I can create an order with Take Profit and Srop Loss or just LIMIT and Stop Loss without having to worry that one has been fulfilled and the others havent?
Has anyone ever been able to create a futures OTOCO order using the API? Is there any way of doing so?
I am using Python