CyberPunkMetalHead / binance-trading-bot-new-coins

This Binance trading bot detects new coins as soon as they are listed on the Binance exchange and automatically places sell and buy orders. It comes with trailing stop loss and other features. If you like this project please consider donating via Brave.
MIT License
1.46k stars 268 forks source link

list index out of range #73

Open DawoodKMasood opened 2 years ago

DawoodKMasood commented 2 years ago

I am getting this error for some reason:

user@instance-3:~/binance-trading-bot-new-coins$ python3 main.py
working...
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/home/tkcartofficial/binance-trading-bot-new-coins/new_listings_scraper.py", line 70, in search_and_update
    latest_coin = get_last_coin()
  File "/home/tkcartofficial/binance-trading-bot-new-coins/new_listings_scraper.py", line 34, in get_last_coin
    uppers = ''.join(item[1] for item in enum if item[1].isupper() and (enum[enum.index(item)+1][1].isupper() or enum[enum.index(item)+1][1]==' ' or enum[enum.index(item)+1][1]==')') )
  File "/home/tkcartofficial/binance-trading-bot-new-coins/new_listings_scraper.py", line 34, in <genexpr>
    uppers = ''.join(item[1] for item in enum if item[1].isupper() and (enum[enum.index(item)+1][1].isupper() or enum[enum.index(item)+1][1]==' ' or enum[enum.index(item)+1][1]==')') )
IndexError: list index out of range
sbhadade commented 2 years ago

i got the same issues . can anyone helps ?

oularrea commented 2 years ago

Any solution for this issue?

Thanks

mmehrle commented 2 years ago

Same here - running it on OS X with python 3.10

ericlighthofmann commented 2 years ago

Hi - I rewrote get it working and be a little simpler/cleaner. It looks for all caps letters between parenthesis - let me know if this helps:

    symbols = re.findall('\(.*?\)', latest_announcement)
    uppers = []
    for symbol in symbols:
        symbol_without_parentheses = symbol.replace('(', '').replace(')', '')
        if symbol_without_parentheses.isupper():
            uppers.append(symbol_without_parentheses + 'USDT')

    return uppers