Cryptocurrency-Trading-Bots-Python-Beginner-Advance icon indicating copy to clipboard operation
Cryptocurrency-Trading-Bots-Python-Beginner-Advance copied to clipboard

Getting: list index out of range FAILURE INITIALIZE Restarting

Open clickbrain opened this issue 5 years ago • 7 comments

list index out of range FAILURE INITIALIZE Restarting

What do I need to do to fix this?

clickbrain avatar Feb 05 '19 21:02 clickbrain

Here is everything before the messages above:

Binance Arbitrage Function Data Collection - Running

List of Arbitrage Symbols: ['BNBBTC', 'BATBNB', 'BATBTC'] Currency Pair: BNBBTC Exchange Rate: 0.00225430 Currency Pair: BATBNB Exchange Rate: 0.01359000 Currency Pair: BATBTC Exchange Rate: 0.00003056 [0.0022543, 0.01359, 3.056e-05, datetime.datetime(2019, 2, 5, 16, 53, 52, 694700)] Buy: 0.0022543 Sell: 0.002248712288447388 No Arbitrage Possibility

ARBITRAGE FUNCTIONALITY SUCCESSFUL - Data of Exchange Rates Collected

Binance Arbitrage Function Data Collection - Running

List of Arbitrage Symbols: ['BNBBTC', 'BCCBNB', 'BCCBTC'] Currency Pair: BNBBTC Exchange Rate: 0.00225470 list index out of range

FAILURE INITIALIZE

Restarting

clickbrain avatar Feb 05 '19 21:02 clickbrain

I tried to edit out the try-except as you stated in the YouTube comments, but I am not a python coder:

while 1:

try:

        initialize_arb()

except:

print("Restarting\n\n")

Here is what I got the next time I ran it.

List of Arbitrage Symbols: ['BNBBTC', 'BCCBNB', 'BCCBTC'] Currency Pair: BNBBTC Exchange Rate: 0.00227100 list index out of range Traceback (most recent call last):

FAILURE INITIALIZE

File "/Users/bradnickel/Documents/python-binance-master/examples/BinanceTriArbTrader.py", line 1059, in run() File "/Users/bradnickel/Documents/python-binance-master/examples/BinanceTriArbTrader.py", line 72, in run initialize_arb() File "/Users/bradnickel/Documents/python-binance-master/examples/BinanceTriArbTrader.py", line 519, in initialize_arb calc_profit_list.append(arbitrage_bin(arb_market, tickers, portfolio, 1, 1)) File "/Users/bradnickel/Documents/python-binance-master/examples/BinanceTriArbTrader.py", line 666, in arbitrage_bin price2 = float(depth['asks'][0][0]) IndexError: list index out of range

Process finished with exit code 1

clickbrain avatar Feb 05 '19 22:02 clickbrain

The reason you are receiving that error is because 'BCC' , 'BCH' and a few other bitcoin forks get de-listed from binance or their code changes.

Additionally, the try-except should look like this:

try: code except Exception as e: print(e) print('RESTARTING\n\n')

Roibal avatar Feb 12 '19 00:02 Roibal

You can see the updated 'try-except' code on line 554-556 of BinanceTriArbTrader.py

This block of code will print out the raised error which helps greatly with debugging.

Roibal avatar Feb 12 '19 00:02 Roibal

The reason you are receiving that error is because 'BCC' , 'BCH' and a few other bitcoin forks get de-listed from binance or their code changes.

Neither am I a programmer, but I'm trying to figure out: if it's just a code issue, if I replace BCC with its fork BCHABC, it should work? Why does it return the same error?

elmahico86 avatar May 08 '19 16:05 elmahico86

Roibal,

Is there an updated list for the list_of_symbols ?

Thanks, Ben

bexstrom avatar Jun 06 '20 04:06 bexstrom

In my github you have creator of list for every exchanges Plin Martinez

⁣Obtener BlueMail para Android ​

En 6 jun. 2020 6:04, en 6:04, bexstrom [email protected] escribió:

Roibal,

Is there an updated list for the list_of_symbols ?

Thanks, Ben

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/Roibal/Cryptocurrency-Trading-Bots-Python-Beginner-Advance/issues/28#issuecomment-639975315

PlinMartinez avatar Jun 06 '20 08:06 PlinMartinez