Reputation: 574
I was searching long time for a simple and out-of-the-box solution in Kucoin API.
Python
with ccxt.kucoinfutures
)My previous solution was creating the opposition position to the main one (STOP LIMIT order - it activates when the price reaches original position price, but it will be unfulfilled until the price reaches SL level):
order = self.exchange.create_stop_limit_order(
symbol=symbol,
side=side,
amount=amount,
price=price,
stopPrice=stopPrice,
)
But unfortunately this leads to complexity (storing more values, orderIds etc.) and the problem with handling the stop losses, because what if the original order is never fulfilled? Or when the original order creation failed?
Now I'm thinking about using: https://www.kucoin.com/docs/rest/futures-trading/orders/get-untriggered-stop-order-list
Within my solution, but I'm wondering, really there is no option to set SL for STOP orders? But okay, it it is so, what about checking every half hour if the position with given orderId
is fulfilled (completed) and if it is, set SL value?
I appreciate your help, thanks.
Upvotes: 0
Views: 84