Add signals enum to 'export' cli option

This commit is contained in:
froggleston 2022-04-22 18:46:12 +01:00
parent f92997d378
commit 767592a1d6
3 changed files with 5 additions and 5 deletions

View File

@ -23,7 +23,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",
"strategy_list", "export", "exportfilename"
"backtest_breakdown", "backtest_cache"]
ARGS_HYPEROPT = ARGS_COMMON_OPTIMIZE + ["hyperopt", "hyperopt_path",

View File

@ -14,7 +14,7 @@ PROCESS_THROTTLE_SECS = 5 # sec
HYPEROPT_EPOCH = 100 # epochs
RETRY_TIMEOUT = 30 # sec
TIMEOUT_UNITS = ['minutes', 'seconds']
EXPORT_OPTIONS = ['none', 'trades']
EXPORT_OPTIONS = ['none', 'trades', 'signals']
DEFAULT_DB_PROD_URL = 'sqlite:///tradesv3.sqlite'
DEFAULT_DB_DRYRUN_URL = 'sqlite:///tradesv3.dryrun.sqlite'
UNLIMITED_STAKE_AMOUNT = 'unlimited'
@ -380,7 +380,6 @@ CONF_SCHEMA = {
},
'position_adjustment_enable': {'type': 'boolean'},
'max_entry_position_adjustment': {'type': ['integer', 'number'], 'minimum': -1},
'backtest_signal_candle_export_enable': {'type': 'boolean'},
},
'definitions': {
'exchange': {

View File

@ -1077,7 +1077,7 @@ class Backtesting:
})
self.all_results[self.strategy.get_strategy_name()] = results
if self.backtest_signal_candle_export_enable and \
if self.config.get('export', 'none') == 'signals' and \
self.dataprovider.runmode == RunMode.BACKTEST:
self._generate_trade_signal_candles(preprocessed_tmp, results)
@ -1163,8 +1163,9 @@ class Backtesting:
if self.config.get('export', 'none') == 'trades':
store_backtest_stats(self.config['exportfilename'], self.results)
if self.backtest_signal_candle_export_enable and \
if self.config.get('export', 'none') == 'signals' and \
self.dataprovider.runmode == RunMode.BACKTEST:
store_backtest_stats(self.config['exportfilename'], self.results)
store_backtest_signal_candles(self.config['exportfilename'], self.processed_dfs)
# Results may be mixed up now. Sort them so they follow --strategy-list order.