IndexError: list index out of range
See original GitHub issue ETHUSDT has gained 21.425% in the last 5 minutes, calculating volume in USDT
preparing to buy 0.26192 ETHUSDT
Traceback (most recent call last):
File "/Users/miguelstevens/Desktop/bot/Binance Detect Moonings.py", line 299, in <module>
update_porfolio(orders, last_price, volume)
File "/Users/miguelstevens/Desktop/bot/Binance Detect Moonings.py", line 267, in update_porfolio
'symbol': orders[coin][0]['symbol'],
IndexError: list index out of range
Received this error, the console has been open for about an hour, all default settings are there, using testnet as well.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
List Index Out of Range – Python Error Message Solved
You'll get the Indexerror: list index out of range error when iterating through a list and trying to access an item that doesn't...
Read more >Indexerror: list Index Out of Range in Python - STechies
In python “list index out of range” error occurs when we try to access an undefined element from the list. List index out...
Read more >Index Error: list index out of range (Python) - Stack Overflow
Generally it means that you are providing an index for which a list element does not exist. E.g, if your list was [1,...
Read more >Python IndexError: List Index Out of Range [Easy Fix] - Finxter
The error “list index out of range” arises if you access invalid indices in your ...
Read more >How to debug list index out of range error in python? - Flexiple
To foolproof your loop of such instances, the range() function along with len() would return the length of the list dynamically. Subsequently ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe I have found a fix for this as well as the cause of the issue. Binance seems to take a while (sometimes up to 3 seconds until it returns the results of a live order). I have added a while block that will keep on calling the API once every second it returns the order. The output will look something like this
Binance is being slow in returning the order, again the API again... Binance is being slow in returning the order, again the API again... Binance is being slow in returning the order, again the API again... Order returned, saving order to file preparing to buy 110.0 DOCKUSDT
I will shortly commit the changes to the main branch
New commit pushed, this should fix the issue above, feel free to re-open the issue in case it doesn’t