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 269 forks source link

Change to buy first found coin #27

Closed bpraznik closed 2 years ago

bpraznik commented 2 years ago

Change the get_new_coins function to return the first coin found. Since it is unlikely that more then one coin will appear in a single execution this might shave some time by not needing to loop trough all N coins. Could possibly also put this behind a operation flag.

CyberPunkMetalHead commented 2 years ago

It's a good idea but this won't work. When a new coin is listed, the returned result is a list of dicts containing multiple pairing options for a single coin, for example: [{'symbol':'FORUSDT', 'price':0.001}, {'symbol':'FORBUSD', 'price':0.001}, {'symbol':'FORBTC', 'price':0.0000001}]

Checking for the first symbol would make it impossible to ensure that you're using your desired pairing option.