minor cleanup
This commit is contained in:
parent
6c72b35b29
commit
00c6157d2e
32
main.py
32
main.py
|
|
@ -312,39 +312,17 @@ def main_loop():
|
||||||
online_pairs.append(f"{instance.base}{instance.quote}")
|
online_pairs.append(f"{instance.base}{instance.quote}")
|
||||||
pairs_to_fetch.append(instance.config.get_pair())
|
pairs_to_fetch.append(instance.config.get_pair())
|
||||||
|
|
||||||
|
#Fetch prices
|
||||||
|
price_list = broker.get_prices(pairs_to_fetch)
|
||||||
|
#Here, assign the prices to the dusters (if any)
|
||||||
|
|
||||||
|
|
||||||
for future in as_completed(futures):
|
for future in as_completed(futures):
|
||||||
try:
|
try:
|
||||||
future.result()
|
future.result()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
broker.logger.log_this(f"Error in thread - {e}")
|
broker.logger.log_this(f"Error in thread - {e}")
|
||||||
|
|
||||||
#Here, append the dusters' pairs to pairs_to_fetch, if missing.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
#Start the trader threads
|
|
||||||
# for t in threads:
|
|
||||||
# try:
|
|
||||||
# t.start()
|
|
||||||
# except Exception as e:
|
|
||||||
# broker.logger.log_this(f"Error starting thread - {e}")
|
|
||||||
|
|
||||||
# #Wait for the trader threads to complete
|
|
||||||
# for t in threads:
|
|
||||||
# try:
|
|
||||||
# t.join()
|
|
||||||
# except Exception as e:
|
|
||||||
# broker.logger.log_this(f"Error joining thread: {e}")
|
|
||||||
# threads.clear()
|
|
||||||
|
|
||||||
#Fetch prices
|
|
||||||
price_list = broker.get_prices(pairs_to_fetch)
|
|
||||||
|
|
||||||
#Here, assign the prices to the dusters (if any)
|
|
||||||
|
|
||||||
curr = 0
|
curr = 0
|
||||||
top = 0
|
top = 0
|
||||||
for instance in running_traders:
|
for instance in running_traders:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue