Skip to content

Commit

Permalink
[GB] retry on non existing check order, see askmike#2518
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Sep 22, 2018
1 parent 22fca69 commit d676a6e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions exchange/wrappers/binance.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ Trader.prototype.handleResponse = function(funcName, callback) {
}

if(funcName === 'checkOrder' && error.message.includes('Order does not exist.')) {
// order got filled in full before it could be
// cancelled, meaning it was NOT cancelled.
return callback(false, {filled: true});
console.log(new Date, 'Binance doesnt know this order, retrying up to 10 times..');
error.retry = 10;
}

if(funcName === 'addOrder' && error.message.includes('Account has insufficient balance')) {
Expand Down Expand Up @@ -284,7 +283,6 @@ Trader.prototype.isValidPrice = function(price) {
}

Trader.prototype.isValidLot = function(price, amount) {
console.log('isValidLot', this.market.minimalOrder.order, amount * price >= this.market.minimalOrder.order)
return amount * price >= this.market.minimalOrder.order;
}

Expand Down Expand Up @@ -464,8 +462,6 @@ Trader.prototype.cancelOrder = function(order, callback) {
this.oldOrder = order;

if(err) {
if(err.message.contains(''))

return callback(err);
}

Expand Down

0 comments on commit d676a6e

Please sign in to comment.