Closed noozo closed 3 years ago
Wonder if someone posted the buy order, but immediately deleted it but the event still reached my streamer. In those situations i seem to end up with one of the workers stuck. What would you do in that situation?
Hello @noozo
Thanks for raising an issue. Would you be able to point me to which branch are you using? I can see that rebuy is happening so it needs to be after the 9th chapter. Did you make any modifications? Looks like you are using the real Binance exchange(not BinanceMock)?
Hello again @noozo
It happens as you place a buy order and it gets filled instantly (you instantly get a message through WebSocket with matching buyer_order_id
), at that moment the Naive.Trader
(at line 117) tries to fetch the order from Binance but Binance hasn't had time to persist it yet.
Here's the full explanation: https://dev.binance.vision/t/faq-error-message-order-does-not-exist/46
In normal trading, this would happen at stop loss
and when using MARKET
order (buying/selling at whatever price is best)
An alternative implementation that would fix this issue would be to drop fetching completely and calculate the remaining amount inside the bot as it gets trade events. This is quite an error prone approach and requires taking into consideration fee as well as fee currency(you can pay a smaller fee(0.075%) if you have BNB tokens).
I hope that helps
Hi, thanks for sharing the code for the book.
I was doing some experiments and this happened:
Any idea in what situations the order can fail to be found?
Thanks!