edeng23 / binance-trade-bot

Automated cryptocurrency trading bot
GNU General Public License v3.0
7.78k stars 2.18k forks source link

Make Error Message Explicit - APIError(code=-2103) When Waiting for Binance #57

Open GamerClassN7 opened 3 years ago

GamerClassN7 commented 3 years ago

Hi am getting this error in log all the times. 2021-02-16 11:37:53,993 - crypto_trader_logger - INFO - APIError(code=-2013): Order does not exist.

can anybody help me ?

denniskis commented 3 years ago

https://dev.binance.vision/t/faq-error-message-order-does-not-exist/46/2

remriel commented 3 years ago

As long as the bot continues, you can ignore this error. Sometimes the order is not filled immediately, but the bot keeps trying until it is.

rbarbazz commented 3 years ago

Would it be useful to log the retries? Or maybe make the message more explicit.

rel-s commented 3 years ago

This error is normal when Binance doesn't complete the order immediately. Making the message more insightful is probably a good idea.

luponata commented 3 years ago

This error is normal when Binance doesn't complete the order immediately. Making the message more insightful is probably a good idea.

Yep, if the bot is waiting for the order filling, and because it know that is still on the book, a simple "waiting for filling" message would be good idea.

something like:

def father_function(foo, bar):
    order_api_call > get order id

    while order_id not onbook:
        self.logger.info(exception) -- > "APIError(code=-2013): Order does not exist"

    while executed_qty != order_qty:
        self.logger.info('Waiting order filling')

    self.logger.info('Order filled')

(please ignore obvious semantic errors :D)

Will try to work on this on my spare time

ghost commented 3 years ago

When an order is placed, you have to pause the code for a 250ms because it takes that long for the placed order to appear in the order status. I would pause a full second as it sometimes take slightly longer or shorter than 250ms.