From ea5f40094a124464e1b0bfadd22095bada6634bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Mon, 24 Feb 2025 11:35:01 -0300 Subject: [PATCH] removed inactive commands --- utils/commander.py | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/utils/commander.py b/utils/commander.py index ee7dbf7..4ea4b5b 100644 --- a/utils/commander.py +++ b/utils/commander.py @@ -36,7 +36,7 @@ INSTANCE 7) mod_global_tp_level 8) global_last_call 9) edit_loop_wait_time 10) edit_call_wait_time 11) reload_markets 12) fetch_full_log 13) paused_traders 14) fetch_log 15) edit_cooldown_multiplier -16) backtests 17) get_balance +16) get_balance EARN 31) toggle_pause 32) get_step_size 33) set_step_size @@ -90,12 +90,13 @@ def select_exchange(exchanges): Selects the exchange to use ''' - selection = input("Enter exchange: (Binance, Gate.io, KuCoin, OKX) ").lower() - for item in exchanges: - if selection in item.lower(): - return item - print("Invalid input") - sys.exit() + while True: + selection = input("Enter exchange: (Binance, Gate.io, KuCoin, OKX) ").lower() + for item in exchanges: + if selection in item.lower(): + return item + print("Invalid input") + if __name__=="__main__": @@ -298,27 +299,6 @@ if __name__=="__main__": print(json.loads(requests.post(url, headers=headers, json=parameters).content)) input("Press ENTER to continue ") - elif command==16: - print("Returns backtests of the pairs available in an exchange") - broker = input("Exchange? (binance, gateio, kucoin, okx or bybit): ") - amount = input("Amount of days to consider? ") - max_rank = input("Maximum CoinMarketCap rank? ") - if not validate_int(amount): - print("The amount of days specified is invalid") - break - if not validate_int(max_rank): - print("The max_rank specified is invalid") - break - if input("Proceed? (Y/n) ") in ["Y","y",""]: - url = f"{base_url}/statistics_server/fetch_backtests?exchange_name={broker}&days={amount}&max_rank={max_rank}" - result = json.loads(requests.get(url,headers=headers).content) - #for item in result: - # print(item, round(result[item],2)) - sorted_result = {key: value for key, value in sorted(result.items(),key=lambda item: item[1])} - for item in sorted_result: - print(item, round(sorted_result[item],2)) - input("Press ENTER to continue ") - elif command==17: print("Returns the free balance of a given coin") coin = input("Input currency: ").upper()