From 96081e20fe5e13a4fe9c1908290b2ca06211f6f0 Mon Sep 17 00:00:00 2001 From: seansan Date: Sun, 14 Jan 2018 11:51:25 +0100 Subject: [PATCH 1/3] Remove delisted to-be coins from sanitized arr (dont buy) --- freqtrade/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/freqtrade/main.py b/freqtrade/main.py index c404d6c11..6f3854af2 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -48,7 +48,14 @@ def refresh_whitelist(whitelist: List[str]) -> List[str]: 'Ignoring %s from whitelist (reason: %s).', pair, status.get('Notice') or 'wallet is not active' ) - + # Wallet will be delisted soon (and cause a loss) + if "delisted" in status['Notice']: + sanitized_whitelist.remove(pair) + logger.info( + 'Ignoring %s from whitelist (reason: %s).', + pair, status.get('Notice') or 'wallet will be delisted soon' + ) + # We need to remove pairs that are unknown final_list = [x for x in sanitized_whitelist if x in known_pairs] return final_list From 0a67334e779cad8fab12497c703e718d8b403760 Mon Sep 17 00:00:00 2001 From: seansan Date: Sun, 14 Jan 2018 12:47:03 +0100 Subject: [PATCH 2/3] Fix NoneType --- freqtrade/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/main.py b/freqtrade/main.py index 6f3854af2..a26538393 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -48,13 +48,15 @@ def refresh_whitelist(whitelist: List[str]) -> List[str]: 'Ignoring %s from whitelist (reason: %s).', pair, status.get('Notice') or 'wallet is not active' ) - # Wallet will be delisted soon (and cause a loss) - if "delisted" in status['Notice']: + # Wallet is going to be delisted (and cause a loss) + delisted = 'delisted' + if delisted in str(status['Notice']): sanitized_whitelist.remove(pair) logger.info( 'Ignoring %s from whitelist (reason: %s).', pair, status.get('Notice') or 'wallet will be delisted soon' ) + # We need to remove pairs that are unknown final_list = [x for x in sanitized_whitelist if x in known_pairs] From 476c54cd9b204bbc795d6d1d6cad531157286fb9 Mon Sep 17 00:00:00 2001 From: seansan Date: Mon, 29 Jan 2018 13:48:00 +0100 Subject: [PATCH 3/3] added str.lower check If someone can TEST my code quickly we can accept it and go --- freqtrade/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/freqtrade/main.py b/freqtrade/main.py index a26538393..28fe260ea 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -48,15 +48,13 @@ def refresh_whitelist(whitelist: List[str]) -> List[str]: 'Ignoring %s from whitelist (reason: %s).', pair, status.get('Notice') or 'wallet is not active' ) - # Wallet is going to be delisted (and cause a loss) - delisted = 'delisted' - if delisted in str(status['Notice']): + # Wallet will be delisted soon (and cause a loss) + if 'delisted' in str(status['Notice']).lower(): sanitized_whitelist.remove(pair) logger.info( 'Ignoring %s from whitelist (reason: %s).', pair, status.get('Notice') or 'wallet will be delisted soon' ) - # We need to remove pairs that are unknown final_list = [x for x in sanitized_whitelist if x in known_pairs]