From 31cd136e94bca43778ebd0dd235d4a9c9a2372dd Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Sat, 10 Jul 2021 21:20:06 -0600 Subject: [PATCH] Flake8 --- freqtrade/commands/arguments.py | 4 ++-- freqtrade/commands/build_config_commands.py | 5 +++-- freqtrade/commands/cli_options.py | 2 +- freqtrade/commands/deploy_commands.py | 21 +++++++++++---------- freqtrade/commands/hyperopt_commands.py | 10 +++++----- freqtrade/commands/list_commands.py | 2 +- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/freqtrade/commands/arguments.py b/freqtrade/commands/arguments.py index 163d9b018..bc8827f54 100644 --- a/freqtrade/commands/arguments.py +++ b/freqtrade/commands/arguments.py @@ -14,7 +14,7 @@ ARGS_COMMON = ["verbosity", "logfile", "version", "config", "datadir", "user_dat ARGS_STRATEGY = ["strategy", "strategy_path"] -ARGS_TRADE = ["db_url", "sd_notify", "dry_run", "dry_run_wallet", "fee"] #TODO: leverage? +ARGS_TRADE = ["db_url", "sd_notify", "dry_run", "dry_run_wallet", "fee"] # TODO-mg: leverage? ARGS_COMMON_OPTIMIZE = ["timeframe", "timerange", "dataformat_ohlcv", "max_open_trades", "stake_amount", "fee", "pairs"] @@ -58,7 +58,7 @@ ARGS_BUILD_HYPEROPT = ["user_data_dir", "hyperopt", "template"] ARGS_CONVERT_DATA = ["pairs", "format_from", "format_to", "erase"] ARGS_CONVERT_DATA_OHLCV = ARGS_CONVERT_DATA + ["timeframes"] -ARGS_LIST_DATA = ["exchange", "dataformat_ohlcv", "pairs"] #TODO: Leverage? +ARGS_LIST_DATA = ["exchange", "dataformat_ohlcv", "pairs"] # TODO-mg: Leverage? ARGS_DOWNLOAD_DATA = ["pairs", "pairs_file", "days", "new_pairs_days", "timerange", "download_trades", "exchange", "timeframes", "erase", "dataformat_ohlcv", diff --git a/freqtrade/commands/build_config_commands.py b/freqtrade/commands/build_config_commands.py index b3fdbab09..146a6f8f2 100644 --- a/freqtrade/commands/build_config_commands.py +++ b/freqtrade/commands/build_config_commands.py @@ -167,7 +167,8 @@ def ask_user_config() -> Dict[str, Any]: "when": lambda x: x['api_server'] }, ] - #TODO: Enable short trading, trade with leverage + + # TODO-mg: Enable short trading, trade with leverage answers = prompt(questions) if not answers: @@ -194,7 +195,7 @@ def deploy_new_config(config_path: Path, selections: Dict[str, Any]) -> None: selections['exchange'] = render_template( templatefile=f"subtemplates/exchange_{exchange_template}.j2", arguments=selections - ) + ) except TemplateNotFound: selections['exchange'] = render_template( templatefile="subtemplates/exchange_generic.j2", diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index b6f326559..a2953adab 100644 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -548,7 +548,7 @@ AVAILABLE_CLI_OPTIONS = { help='Do not print epoch details header.', action='store_true', ), - #TODO: Set up these options + # TODO-mg: Set up these options # "leverage": Arg( # '-L', '--leverage', # help='Leverage applied for margin and futures trading.', diff --git a/freqtrade/commands/deploy_commands.py b/freqtrade/commands/deploy_commands.py index 758b8500a..95fff615e 100644 --- a/freqtrade/commands/deploy_commands.py +++ b/freqtrade/commands/deploy_commands.py @@ -38,15 +38,15 @@ def deploy_new_strategy(strategy_name: str, strategy_path: Path, subtemplate: st indicators = render_template_with_fallback( templatefile=f"subtemplates/indicators_{subtemplate}.j2", templatefallbackfile=f"subtemplates/indicators_{fallback}.j2", - ) + ) buy_trend = render_template_with_fallback( templatefile=f"subtemplates/buy_trend_{subtemplate}.j2", templatefallbackfile=f"subtemplates/buy_trend_{fallback}.j2", - ) + ) sell_trend = render_template_with_fallback( templatefile=f"subtemplates/sell_trend_{subtemplate}.j2", templatefallbackfile=f"subtemplates/sell_trend_{fallback}.j2", - ) + ) plot_config = render_template_with_fallback( templatefile=f"subtemplates/plot_config_{subtemplate}.j2", templatefallbackfile=f"subtemplates/plot_config_{fallback}.j2", @@ -55,7 +55,7 @@ def deploy_new_strategy(strategy_name: str, strategy_path: Path, subtemplate: st templatefile=f"subtemplates/strategy_methods_{subtemplate}.j2", templatefallbackfile="subtemplates/strategy_methods_empty.j2", ) - #TODO: Short Trend, Exit short trend + # TODO-mg: Short Trend, Exit short trend strategy_text = render_template(templatefile='base_strategy.py.j2', arguments={"strategy": strategy_name, @@ -98,20 +98,20 @@ def deploy_new_hyperopt(hyperopt_name: str, hyperopt_path: Path, subtemplate: st buy_guards = render_template_with_fallback( templatefile=f"subtemplates/hyperopt_buy_guards_{subtemplate}.j2", templatefallbackfile=f"subtemplates/hyperopt_buy_guards_{fallback}.j2", - ) + ) sell_guards = render_template_with_fallback( templatefile=f"subtemplates/hyperopt_sell_guards_{subtemplate}.j2", templatefallbackfile=f"subtemplates/hyperopt_sell_guards_{fallback}.j2", - ) + ) buy_space = render_template_with_fallback( templatefile=f"subtemplates/hyperopt_buy_space_{subtemplate}.j2", templatefallbackfile=f"subtemplates/hyperopt_buy_space_{fallback}.j2", - ) + ) sell_space = render_template_with_fallback( templatefile=f"subtemplates/hyperopt_sell_space_{subtemplate}.j2", templatefallbackfile=f"subtemplates/hyperopt_sell_space_{fallback}.j2", - ) - #TODO: short_guards, exit_short_guards, short_space, exit_short_space + ) + # TODO-mg: short_guards, exit_short_guards, short_space, exit_short_space strategy_text = render_template(templatefile='base_hyperopt.py.j2', arguments={"hyperopt": hyperopt_name, @@ -119,7 +119,8 @@ def deploy_new_hyperopt(hyperopt_name: str, hyperopt_path: Path, subtemplate: st "sell_guards": sell_guards, "buy_space": buy_space, "sell_space": sell_space, - }) #TODO: short_guards, exit_short_guards, short_space, exit_short_space + }) + # TODO-mg: short_guards, exit_short_guards, short_space, exit_short_space logger.info(f"Writing hyperopt to `{hyperopt_path}`.") hyperopt_path.write_text(strategy_text) diff --git a/freqtrade/commands/hyperopt_commands.py b/freqtrade/commands/hyperopt_commands.py index 86c1b6098..dda72f8f8 100755 --- a/freqtrade/commands/hyperopt_commands.py +++ b/freqtrade/commands/hyperopt_commands.py @@ -187,7 +187,7 @@ def _hyperopt_filter_epochs_trade_count(epochs: List, filteroptions: dict) -> Li x for x in epochs if x['results_metrics'].get( 'trade_count', x['results_metrics'].get('total_trades') - ) < filteroptions['filter_max_trades'] + ) < filteroptions['filter_max_trades'] ] return epochs @@ -239,7 +239,7 @@ def _hyperopt_filter_epochs_profit(epochs: List, filteroptions: dict) -> List: x for x in epochs if x['results_metrics'].get( 'avg_profit', x['results_metrics'].get('profit_mean', 0) * 100 - ) < filteroptions['filter_max_avg_profit'] + ) < filteroptions['filter_max_avg_profit'] ] if filteroptions['filter_min_total_profit'] is not None: epochs = _hyperopt_filter_epochs_trade(epochs, 0) @@ -247,7 +247,7 @@ def _hyperopt_filter_epochs_profit(epochs: List, filteroptions: dict) -> List: x for x in epochs if x['results_metrics'].get( 'profit', x['results_metrics'].get('profit_total_abs', 0) - ) > filteroptions['filter_min_total_profit'] + ) > filteroptions['filter_min_total_profit'] ] if filteroptions['filter_max_total_profit'] is not None: epochs = _hyperopt_filter_epochs_trade(epochs, 0) @@ -255,7 +255,7 @@ def _hyperopt_filter_epochs_profit(epochs: List, filteroptions: dict) -> List: x for x in epochs if x['results_metrics'].get( 'profit', x['results_metrics'].get('profit_total_abs', 0) - ) < filteroptions['filter_max_total_profit'] + ) < filteroptions['filter_max_total_profit'] ] return epochs @@ -273,4 +273,4 @@ def _hyperopt_filter_epochs_objective(epochs: List, filteroptions: dict) -> List return epochs -#TODO: Hyperopt optimal leverage \ No newline at end of file +# TODO-mg: Hyperopt optimal leverage diff --git a/freqtrade/commands/list_commands.py b/freqtrade/commands/list_commands.py index a67de14c2..3fa0b5de7 100644 --- a/freqtrade/commands/list_commands.py +++ b/freqtrade/commands/list_commands.py @@ -148,7 +148,7 @@ def start_list_markets(args: Dict[str, Any], pairs_only: bool = False) -> None: quote_currencies = args.get('quote_currencies', []) try: - #TODO: Add leverage amount to get markets that support a certain leverage + # TODO-mg: Add leverage amount to get markets that support a certain leverage pairs = exchange.get_markets(base_currencies=base_currencies, quote_currencies=quote_currencies, pairs_only=pairs_only,