Closed 343N closed 3 years ago
Not the original coder and I'm not familiar with Python, but in NodeJs there's this concept of async/await for things like this. I did a quick google and I think this might be similar: https://docs.python.org/3/library/asyncio-task.html
For now, I just put a 100 millisecond time.sleep
before it gets all orders from the binance client, it seems to have fixed it, though it's just a workaround for now.
edit: Nevermind, I still got the issue, I may have just gotten lucky before, or 100 milliseconds wasn't enough. changed it to 500ms. it could be a completely different issue though, i'm not too familiar with how python-binance works on the backend
I haven't been able to replicate your issue, but I did push a new commit. Can you verify that your issue is gone?
I have the same issue all the time in live aswell. Tried changing all requests to await using async functions from binance library, but same result. It's a big problem because it creates the orders, crashes before it puts it in the JSON and the orders are stuck in limbo until you manually sell them back to USDT on binance
I have the same issue all the time in live aswell. Tried changing all requests to await using async functions from binance library, but same result. It's a big problem because it creates the orders, crashes before it puts it in the JSON and the orders are stuck in limbo until you manually sell them back to USDT on binance
What could the problem be then? Did you change it to await client.create_order
? Surely that means it can't finish before it populates the orders
dict? I'm having the same problem. I'll try using await and/or a sleep to see if that fixes things for me.
It's getting pretty difficult to test as the market isn't going up right now...
The last commit should now fix this issue :)
When update_portfolio is called, I very often get a
list index out of range
error and the program crashes.Using my debugger, it looks like some currencies that the bot tries to buy are in the orders dict, but some don't end up going in there and are just empty.
I'm guessing it's an issue where the client is retrieving orders too quickly before they place on Binance's end?