binance-exchange/node-binance-api

No response object on STOP_LOSS_LIMIT order

evancaldwell opened this issue · 4 comments

I'm trying to place a STOP_LOSS_LIMIT order with a callback but the response object is empty. Here's the code I'm using:

let entryData = {
  currencyPair: 'BTCUSDT',
  purchasePrice: 9480,
  lastPrice: 9480,
  stopPrice: 9580,
  qty: 0.01
};

binance.sell(entryData.currencyPair, entryData.qty, entryData.lastPrice, {stopPrice: entryData.stopPrice, type: 'STOP_LOSS_LIMIT'}, (error, response) => {
  if (error) {
    console.log('stop_loss error: ', error.body);
  } else {
    console.log('after initialStop: ', response);
  }
});

and the console output is:
after initialStop: {}

If there is an error it seems to output the error just fine.

Just double checking. You don't by any chance have the options.test flag set to true? This will always get an empty {} object returned from Binance. Test mode is to make sure you have no errors in your order request, and gives you an idea of how long Binance will take to process your request, so you can squeeze your recvWindow as low as possible.

Ah, I see. I do have test set to true. I'll try it without and let you know then.

I have the same issue. Wouldn't it be better to return some dummy response with the same structure? Don't think it is a good idea to spend real coins for testing :)

This is up to Binance, unfortunately they are no longer willing to listen to suggestions or improvements so it's all on us as the community to implement our own solutions
Tell Binance your thoughts directly @ https://t.me/binance_api_english