Add signals enum to 'export' cli option
This commit is contained in:
parent
f92997d378
commit
767592a1d6
@ -23,7 +23,7 @@ ARGS_COMMON_OPTIMIZE = ["timeframe", "timerange", "dataformat_ohlcv",
|
|||||||
|
|
||||||
ARGS_BACKTEST = ARGS_COMMON_OPTIMIZE + ["position_stacking", "use_max_market_positions",
|
ARGS_BACKTEST = ARGS_COMMON_OPTIMIZE + ["position_stacking", "use_max_market_positions",
|
||||||
"enable_protections", "dry_run_wallet", "timeframe_detail",
|
"enable_protections", "dry_run_wallet", "timeframe_detail",
|
||||||
"strategy_list", "export", "exportfilename",
|
"strategy_list", "export", "exportfilename"
|
||||||
"backtest_breakdown", "backtest_cache"]
|
"backtest_breakdown", "backtest_cache"]
|
||||||
|
|
||||||
ARGS_HYPEROPT = ARGS_COMMON_OPTIMIZE + ["hyperopt", "hyperopt_path",
|
ARGS_HYPEROPT = ARGS_COMMON_OPTIMIZE + ["hyperopt", "hyperopt_path",
|
||||||
|
@ -14,7 +14,7 @@ PROCESS_THROTTLE_SECS = 5 # sec
|
|||||||
HYPEROPT_EPOCH = 100 # epochs
|
HYPEROPT_EPOCH = 100 # epochs
|
||||||
RETRY_TIMEOUT = 30 # sec
|
RETRY_TIMEOUT = 30 # sec
|
||||||
TIMEOUT_UNITS = ['minutes', 'seconds']
|
TIMEOUT_UNITS = ['minutes', 'seconds']
|
||||||
EXPORT_OPTIONS = ['none', 'trades']
|
EXPORT_OPTIONS = ['none', 'trades', 'signals']
|
||||||
DEFAULT_DB_PROD_URL = 'sqlite:///tradesv3.sqlite'
|
DEFAULT_DB_PROD_URL = 'sqlite:///tradesv3.sqlite'
|
||||||
DEFAULT_DB_DRYRUN_URL = 'sqlite:///tradesv3.dryrun.sqlite'
|
DEFAULT_DB_DRYRUN_URL = 'sqlite:///tradesv3.dryrun.sqlite'
|
||||||
UNLIMITED_STAKE_AMOUNT = 'unlimited'
|
UNLIMITED_STAKE_AMOUNT = 'unlimited'
|
||||||
@ -380,7 +380,6 @@ CONF_SCHEMA = {
|
|||||||
},
|
},
|
||||||
'position_adjustment_enable': {'type': 'boolean'},
|
'position_adjustment_enable': {'type': 'boolean'},
|
||||||
'max_entry_position_adjustment': {'type': ['integer', 'number'], 'minimum': -1},
|
'max_entry_position_adjustment': {'type': ['integer', 'number'], 'minimum': -1},
|
||||||
'backtest_signal_candle_export_enable': {'type': 'boolean'},
|
|
||||||
},
|
},
|
||||||
'definitions': {
|
'definitions': {
|
||||||
'exchange': {
|
'exchange': {
|
||||||
|
@ -1077,7 +1077,7 @@ class Backtesting:
|
|||||||
})
|
})
|
||||||
self.all_results[self.strategy.get_strategy_name()] = results
|
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.dataprovider.runmode == RunMode.BACKTEST:
|
||||||
self._generate_trade_signal_candles(preprocessed_tmp, results)
|
self._generate_trade_signal_candles(preprocessed_tmp, results)
|
||||||
|
|
||||||
@ -1163,8 +1163,9 @@ class Backtesting:
|
|||||||
if self.config.get('export', 'none') == 'trades':
|
if self.config.get('export', 'none') == 'trades':
|
||||||
store_backtest_stats(self.config['exportfilename'], self.results)
|
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:
|
self.dataprovider.runmode == RunMode.BACKTEST:
|
||||||
|
store_backtest_stats(self.config['exportfilename'], self.results)
|
||||||
store_backtest_signal_candles(self.config['exportfilename'], self.processed_dfs)
|
store_backtest_signal_candles(self.config['exportfilename'], self.processed_dfs)
|
||||||
|
|
||||||
# Results may be mixed up now. Sort them so they follow --strategy-list order.
|
# Results may be mixed up now. Sort them so they follow --strategy-list order.
|
||||||
|
Loading…
Reference in New Issue
Block a user