diff --git a/config_handler.py b/config_handler.py index b4c61a2..4243999 100644 --- a/config_handler.py +++ b/config_handler.py @@ -44,7 +44,7 @@ class ConfigHandler: self.config_dictionary["generated_at"] = int(time()) self.save_to_file() if config_dict is not None: - self.config_dictionary = {**self.config_dictionary, **config_dict} + self.config_dictionary.update(config_dict) self.save_to_file() diff --git a/exchange_wrapper.py b/exchange_wrapper.py index 1e7c1d0..09b5302 100755 --- a/exchange_wrapper.py +++ b/exchange_wrapper.py @@ -1058,7 +1058,7 @@ class Logger: self.tg_credentials = credentials.get_credentials("telegram") self.log_list_max_length = 10 self.log_list = collections.deque(maxlen=self.log_list_max_length) - self.log_list = self.preload_logs() + self.preload_logs() def preload_logs(self): @@ -1066,12 +1066,10 @@ class Logger: with open(f"logs/{self.exchange_name}.log","r") as f: for line in f: self.log_list.append(line.rstrip("\n")) - # self.log_list = f.readlines() - #return self.log_list[-self.log_list_max_length:] - return list(self.log_list) + return 0 except Exception as e: print(e) - return [] + return 1 def set_log_list_max_length(self, amount): @@ -1080,7 +1078,7 @@ class Logger: def get_log_list(self): - return self.log_list + return list(self.log_list) def set_telegram_notifications(self, toggle): diff --git a/main.py b/main.py index 6c21d67..65eb396 100644 --- a/main.py +++ b/main.py @@ -316,7 +316,10 @@ def main_routine(): futures.append(future) online_pairs.append(f"{instance.base}{instance.quote}") pairs_to_fetch.append(instance.config.get_pair()) - + + #Delete no longer used data + del open_orders + #Fetch prices price_list = broker.get_prices(pairs_to_fetch) #Here, assign the prices to the dusters (if any) @@ -353,6 +356,8 @@ def main_routine(): global_status["paused_traders"].append(instance.config.get_pair()) paused_traders_status_strings.append(f"{cyan}Paused pairs: {list(global_status['paused_traders'])}{white}") + #Delete no longer used data + del price_list #Append worker data to screen buffer, shorts first. screen_buffer.extend(short_traders_status_strings + long_traders_status_strings) diff --git a/status_handler.py b/status_handler.py index 6b1f6ee..d9d5d20 100644 --- a/status_handler.py +++ b/status_handler.py @@ -24,7 +24,6 @@ class StatusHandler: "base_bought": 0.0, "so_amount": 0, "no_of_safety_orders": "", - "take_profit_price": "", "safety_price_table": [], "deal_uptime": 0.0, "total_uptime": 0.0, @@ -44,11 +43,11 @@ class StatusHandler: "deal_order_history": [] } self.status_file_path = f"status/{base}{quote}.status" - self.status_dictionary = self.default_status_dictionary.copy() - - if status_dict is not None: - self.status_dictionary = {**self.status_dictionary, **status_dict} - self.save_to_file() + + self.status_dictionary = {k: v for k, v in self.default_status_dictionary.items()} + if status_dict: + self.status_dictionary.update(status_dict) + self.save_to_file() def get_pair(self): return self.status_dictionary["pair"]