Open rrm1991 opened 2 years ago
Many thanks!
Can I just implement your solution into the current bot? Bit of a python noob here
The last option I posted, to get only the first coin and ignore the rest on a multi coin announcement is safe to implement. You can just copy this code and replace the original get_last_coin() method.
The other one needs a bit of tweaking, which I am testing right now. Until we get another multi-coin announcement I will not be 100% sure it works.
This is my code from the new_listings_scraper. How would i edit it to be the equivalent of what rrm1991 mentioned above to only get the first coin of a multi-coin listing? I'm a rookie, so I couldn't interpret what rrm1991 said to do and apply it to my code. Any help would be appreciated, thanks.
def get_last_coin(): """ Returns new Symbol when appropriate """
latest_announcement = get_announcement()
# enable Kucoin Announcements if True in config
if config['TRADE_OPTIONS']['KUCOIN_ANNOUNCEMENTS']:
logger.info('Kucoin announcements enabled, look for new Kucoin coins...')
kucoin_announcement = get_kucoin_announcement()
kucoin_coin = re.findall('\(([^)]+)', kucoin_announcement)
found_coin = re.findall('\(([^)]+)', latest_announcement)
uppers = None
# returns nothing if it's an old coin or it's not an actual coin listing
if 'Will List' not in latest_announcement or found_coin[0] == globals.latest_listing or \
found_coin[0] in previously_found_coins:
# if the latest Binance announcement is not a new coin listing, or the listing has already been returned, check kucoin
if config['TRADE_OPTIONS']['KUCOIN_ANNOUNCEMENTS'] and 'Gets Listed' in kucoin_announcement\
and kucoin_coin[0] != globals.latest_listing and kucoin_coin[0] not in previously_found_coins:
if len(kucoin_coin) == 1:
uppers = kucoin_coin[0]
previously_found_coins.add(uppers)
logger.info('New Kucoin coin detected: ' + uppers)
if len(kucoin_coin) != 1:
uppers = None
else:
if len(found_coin) == 1:
uppers = found_coin[0]
previously_found_coins.add(uppers)
logger.info('New coin detected: ' + uppers)
if len(found_coin) != 1:
uppers = None
return uppers
I've created a new Draft PR to tackle this issue. The first step would be to just grab the first coin similar to @rrm1991's implementation.
See here: #150
In the future we might implement a solution that would monitor and buy/sell all mentioned coins simultaneously. But there are some problems with that as well which we do need to discuss then.
Last listing: "Binance Will List Amp (AMP) and PlayDapp (PLA)"
Didn't work because the method get_last_coin() from new_listings_scraper.py only gets a new coin if there is just one on the listing title. Check the if statements at the end of get_last_coin() method:
If we want to get all coins from that same listing message, I would suggest using this method, that will grab the first coin the first time the listing message is passed, the second coin the second time... etc:
If you just want to grab the first coin and ignore the second one cause it might cause problems with buying/selling orders (I haven't read the trading code so much) : the method can easily be modified like this:
Hope it helps!