Closed mikecheung closed 2 years ago
I am trying to create a futures STOP_LOSS_LIMIT order.
I have tried to do so with this code:
tradeType = 'STOP_LOSS_LIMIT'; options = { closePosition : true, stopPrice : stopPrice, type : tradeType, timeInForce : 'GTC', priceProtect : true, }; if ( position.toLowerCase() === 'short' ) { orderRes = await binance.futuresBuy( symbol, trade_quantity, tradePrice, options ); } else { orderRes = await binance.futuresSell( symbol, trade_quantity, tradePrice, options ); }
Whenever I try this, i get the the error [Object: null prototype] { code: -1116, msg: 'Invalid orderType.' }
[Object: null prototype] { code: -1116, msg: 'Invalid orderType.' }
I have also tried to create it using binance.futuresMultipleOrders( orders ) and this has also returned an invalid orderType error.
Checking https://github.com/jaggedsoft/node-binance-api/blob/master/node-binance-api.js line 488, it does not seem to take STOP_LOSS_LIMIT as a order type for futures orders. Am I doing something wrong or have I hit a deadend?
Found my answer. Instead of STOP_LOSS_LIMIT, i have to just use STOP and specify a stopPrice. Also can't include closePosition in the call.
I am trying to create a futures STOP_LOSS_LIMIT order.
I have tried to do so with this code:
Whenever I try this, i get the the error
[Object: null prototype] { code: -1116, msg: 'Invalid orderType.' }
I have also tried to create it using binance.futuresMultipleOrders( orders ) and this has also returned an invalid orderType error.
Checking https://github.com/jaggedsoft/node-binance-api/blob/master/node-binance-api.js line 488, it does not seem to take STOP_LOSS_LIMIT as a order type for futures orders. Am I doing something wrong or have I hit a deadend?