Rename command to backtesting-show
This commit is contained in:
parent
20904f1ca4
commit
c15f73aa1f
@ -586,7 +586,7 @@ Adding `--show-pair-list` outputs a sorted pair list you can easily copy/paste i
|
|||||||
Only using winning pairs can lead to an overfitted strategy, which will not work well on future data. Make sure to extensively test your strategy in dry-run before risking real money.
|
Only using winning pairs can lead to an overfitted strategy, which will not work well on future data. Make sure to extensively test your strategy in dry-run before risking real money.
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade backtest-show [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
usage: freqtrade backtesting-show [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
[-d PATH] [--userdir PATH]
|
[-d PATH] [--userdir PATH]
|
||||||
[--export-filename PATH] [--show-pair-list]
|
[--export-filename PATH] [--show-pair-list]
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ from freqtrade.commands.hyperopt_commands import start_hyperopt_list, start_hype
|
|||||||
from freqtrade.commands.list_commands import (start_list_exchanges, start_list_markets,
|
from freqtrade.commands.list_commands import (start_list_exchanges, start_list_markets,
|
||||||
start_list_strategies, start_list_timeframes,
|
start_list_strategies, start_list_timeframes,
|
||||||
start_show_trades)
|
start_show_trades)
|
||||||
from freqtrade.commands.optimize_commands import (start_backtest_show, start_backtesting,
|
from freqtrade.commands.optimize_commands import (start_backtesting, start_backtesting_show,
|
||||||
start_edge, start_hyperopt)
|
start_edge, start_hyperopt)
|
||||||
from freqtrade.commands.pairlist_commands import start_test_pairlist
|
from freqtrade.commands.pairlist_commands import start_test_pairlist
|
||||||
from freqtrade.commands.plot_commands import start_plot_dataframe, start_plot_profit
|
from freqtrade.commands.plot_commands import start_plot_dataframe, start_plot_profit
|
||||||
|
@ -175,15 +175,15 @@ class Arguments:
|
|||||||
self.parser = argparse.ArgumentParser(description='Free, open source crypto trading bot')
|
self.parser = argparse.ArgumentParser(description='Free, open source crypto trading bot')
|
||||||
self._build_args(optionlist=['version'], parser=self.parser)
|
self._build_args(optionlist=['version'], parser=self.parser)
|
||||||
|
|
||||||
from freqtrade.commands import (start_backtest_show, start_backtesting, start_convert_data,
|
from freqtrade.commands import (start_backtesting, start_backtesting_show,
|
||||||
start_convert_trades, start_create_userdir,
|
start_convert_data, start_convert_trades,
|
||||||
start_download_data, start_edge, start_hyperopt,
|
start_create_userdir, start_download_data, start_edge,
|
||||||
start_hyperopt_list, start_hyperopt_show, start_install_ui,
|
start_hyperopt, start_hyperopt_list, start_hyperopt_show,
|
||||||
start_list_data, start_list_exchanges, start_list_markets,
|
start_install_ui, start_list_data, start_list_exchanges,
|
||||||
start_list_strategies, start_list_timeframes,
|
start_list_markets, start_list_strategies,
|
||||||
start_new_config, start_new_strategy, start_plot_dataframe,
|
start_list_timeframes, start_new_config, start_new_strategy,
|
||||||
start_plot_profit, start_show_trades, start_test_pairlist,
|
start_plot_dataframe, start_plot_profit, start_show_trades,
|
||||||
start_trading, start_webserver)
|
start_test_pairlist, start_trading, start_webserver)
|
||||||
|
|
||||||
subparsers = self.parser.add_subparsers(dest='command',
|
subparsers = self.parser.add_subparsers(dest='command',
|
||||||
# Use custom message when no subhandler is added
|
# Use custom message when no subhandler is added
|
||||||
@ -267,14 +267,14 @@ class Arguments:
|
|||||||
backtesting_cmd.set_defaults(func=start_backtesting)
|
backtesting_cmd.set_defaults(func=start_backtesting)
|
||||||
self._build_args(optionlist=ARGS_BACKTEST, parser=backtesting_cmd)
|
self._build_args(optionlist=ARGS_BACKTEST, parser=backtesting_cmd)
|
||||||
|
|
||||||
# Add backtest-show subcommand
|
# Add backtesting-show subcommand
|
||||||
backtest_show_cmd = subparsers.add_parser(
|
backtesting_show_cmd = subparsers.add_parser(
|
||||||
'backtest-show',
|
'backtesting-show',
|
||||||
help='Show past Backtest results',
|
help='Show past Backtest results',
|
||||||
parents=[_common_parser],
|
parents=[_common_parser],
|
||||||
)
|
)
|
||||||
backtest_show_cmd.set_defaults(func=start_backtest_show)
|
backtesting_show_cmd.set_defaults(func=start_backtesting_show)
|
||||||
self._build_args(optionlist=ARGS_BACKTEST_SHOW, parser=backtest_show_cmd)
|
self._build_args(optionlist=ARGS_BACKTEST_SHOW, parser=backtesting_show_cmd)
|
||||||
|
|
||||||
# Add edge subcommand
|
# Add edge subcommand
|
||||||
edge_cmd = subparsers.add_parser('edge', help='Edge module.',
|
edge_cmd = subparsers.add_parser('edge', help='Edge module.',
|
||||||
|
@ -54,15 +54,15 @@ def start_backtesting(args: Dict[str, Any]) -> None:
|
|||||||
backtesting.start()
|
backtesting.start()
|
||||||
|
|
||||||
|
|
||||||
def start_backtest_show(args: Dict[str, Any]) -> None:
|
def start_backtesting_show(args: Dict[str, Any]) -> None:
|
||||||
"""
|
"""
|
||||||
Show previous backtest result
|
Show previous backtest result
|
||||||
"""
|
"""
|
||||||
|
|
||||||
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
from freqtrade.optimize.optimize_reports import show_backtest_results, show_sorted_pairlist
|
|
||||||
from freqtrade.data.btanalysis import load_backtest_stats
|
from freqtrade.data.btanalysis import load_backtest_stats
|
||||||
|
from freqtrade.optimize.optimize_reports import show_backtest_results, show_sorted_pairlist
|
||||||
|
|
||||||
results = load_backtest_stats(config['exportfilename'])
|
results = load_backtest_stats(config['exportfilename'])
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ from zipfile import ZipFile
|
|||||||
import arrow
|
import arrow
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.commands import (start_backtest_show, start_convert_data, start_convert_trades,
|
from freqtrade.commands import (start_backtesting_show, start_convert_data, start_convert_trades,
|
||||||
start_create_userdir, start_download_data, start_hyperopt_list,
|
start_create_userdir, start_download_data, start_hyperopt_list,
|
||||||
start_hyperopt_show, start_install_ui, start_list_data,
|
start_hyperopt_show, start_install_ui, start_list_data,
|
||||||
start_list_exchanges, start_list_markets, start_list_strategies,
|
start_list_exchanges, start_list_markets, start_list_strategies,
|
||||||
@ -1391,17 +1391,17 @@ def test_show_trades(mocker, fee, capsys, caplog):
|
|||||||
start_show_trades(pargs)
|
start_show_trades(pargs)
|
||||||
|
|
||||||
|
|
||||||
def test_backtest_show(mocker, testdatadir, capsys):
|
def test_backtesting_show(mocker, testdatadir, capsys):
|
||||||
sbr = mocker.patch('freqtrade.optimize.optimize_reports.show_backtest_results')
|
sbr = mocker.patch('freqtrade.optimize.optimize_reports.show_backtest_results')
|
||||||
args = [
|
args = [
|
||||||
"backtest-show",
|
"backtesting-show",
|
||||||
"--export-filename",
|
"--export-filename",
|
||||||
f"{testdatadir / 'backtest-result_new.json'}",
|
f"{testdatadir / 'backtest-result_new.json'}",
|
||||||
"--show-pair-list"
|
"--show-pair-list"
|
||||||
]
|
]
|
||||||
pargs = get_args(args)
|
pargs = get_args(args)
|
||||||
pargs['config'] = None
|
pargs['config'] = None
|
||||||
start_backtest_show(pargs)
|
start_backtesting_show(pargs)
|
||||||
assert sbr.call_count == 1
|
assert sbr.call_count == 1
|
||||||
out, err = capsys.readouterr()
|
out, err = capsys.readouterr()
|
||||||
assert "Pairs for Strategy" in out
|
assert "Pairs for Strategy" in out
|
||||||
|
Loading…
Reference in New Issue
Block a user