Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting: list index out of range FAILURE INITIALIZE Restarting #28

Open
clickbrain opened this issue Feb 5, 2019 · 7 comments
Open

Comments

@clickbrain
Copy link

list index out of range
FAILURE INITIALIZE
Restarting

What do I need to do to fix this?

@clickbrain
Copy link
Author

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
Copy link
Author

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

@Roibal
Copy link
Owner

Roibal commented Feb 12, 2019

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
Copy link
Owner

Roibal commented Feb 12, 2019

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.

@elmahico86
Copy link

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?

@bexstrom
Copy link

bexstrom commented Jun 6, 2020

Roibal,

Is there an updated list for the list_of_symbols ?

Thanks,
Ben

@PlinMartinez
Copy link

PlinMartinez commented Jun 6, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants