Rework backtesting --no-cahche to --cache=[none, day, week, month].

Fix an issue where config modification during runtime would prevent use of cached results.
This commit is contained in:
Rokas Kupstys
2022-01-18 11:00:51 +02:00
parent 3c06d31bbf
commit 5fffc5033a
8 changed files with 117 additions and 42 deletions

View File

@@ -24,7 +24,7 @@ ARGS_COMMON_OPTIMIZE = ["timeframe", "timerange", "dataformat_ohlcv",
ARGS_BACKTEST = ARGS_COMMON_OPTIMIZE + ["position_stacking", "use_max_market_positions",
"enable_protections", "dry_run_wallet", "timeframe_detail",
"strategy_list", "export", "exportfilename",
"backtest_breakdown", "no_backtest_cache"]
"backtest_breakdown", "backtest_cache"]
ARGS_HYPEROPT = ARGS_COMMON_OPTIMIZE + ["hyperopt", "hyperopt_path",
"position_stacking", "use_max_market_positions",

View File

@@ -205,10 +205,12 @@ AVAILABLE_CLI_OPTIONS = {
nargs='+',
choices=constants.BACKTEST_BREAKDOWNS
),
"no_backtest_cache": Arg(
'--no-cache',
help='Do not reuse cached backtest results.',
action='store_true'
"backtest_cache": Arg(
'--cache',
help='Load a cached backtest result no older than specified age.',
metavar='AGE',
default=constants.BACKTEST_CACHE_DEFAULT,
choices=constants.BACKTEST_CACHE_AGE,
),
# Edge
"stoploss_range": Arg(