–Trying to CACCEL OCO order with following command
result = client.cancel_order
(symbol=TRADE_SYMBOL,orderListId=10035)
–it seems issue with orderListId argument. logs for OCO order (pasted in the last) showing orderListId=10035.
–following error received.
error from callback <function on_message at 0x0000023B2820C700>: APIError(code=-1104): Not all sent parameters were read; read ‘3’ parameter(s) but was sent ‘4’.
Folowing command used successfully in creating OCO order but unable to cancel it with orderListId (as mentioned above).
order_oco = client.create_oco_order(symbol=symbol,side=SIDE_SELL,stopLimitTimeInForce=TIME_IN_FORCE_GTC,quantity=quantity,stopPrice=stop_loss,stopLimitPrice=stop_loss,price=price1)
Output response:
{
“symbol”: “BTCUSDT”,
“orderId”: 5676213,
“orderListId”: 10035,
“clientOrderId”: “wH0PkOkJ83mxRnKDVCPGxk”,
“price”: “41845.69000000”,
“origQty”: “0.00035100”,
“executedQty”: “0.00000000”,
“cummulativeQuoteQty”: “0.00000000”,
“status”: “NEW”,
“timeInForce”: “GTC”,
“type”: “STOP_LOSS_LIMIT”,
“side”: “SELL”,
“stopPrice”: “41845.69000000”,
“icebergQty”: “0.00000000”,
“time”: 1632553383102,
“updateTime”: 1632553383102,
“isWorking”: false,
“origQuoteOrderQty”: “0.00000000”
},
{
“symbol”: “BTCUSDT”,
“orderId”: 5676214,
“orderListId”: 10035,
“clientOrderId”: “UaLXJE6SXJq50b9aR7TXZK”,
“price”: “42828.10000000”,
“origQty”: “0.00035100”,
“executedQty”: “0.00000000”,
“cummulativeQuoteQty”: “0.00000000”,
“status”: “NEW”,
“timeInForce”: “GTC”,
“type”: “LIMIT_MAKER”,
“side”: “SELL”,
“stopPrice”: “0.00000000”,
“icebergQty”: “0.00000000”,
“time”: 1632553383102,
“updateTime”: 1632553383102,
“isWorking”: true,
“origQuoteOrderQty”: “0.00000000”
}