Move signal candle generation into separate function
This commit is contained in:
parent
933054a51c
commit
f92997d378
@ -1079,12 +1079,17 @@ class Backtesting:
|
|||||||
|
|
||||||
if self.backtest_signal_candle_export_enable and \
|
if self.backtest_signal_candle_export_enable and \
|
||||||
self.dataprovider.runmode == RunMode.BACKTEST:
|
self.dataprovider.runmode == RunMode.BACKTEST:
|
||||||
|
self._generate_trade_signal_candles(preprocessed_tmp, results)
|
||||||
|
|
||||||
|
return min_date, max_date
|
||||||
|
|
||||||
|
def _generate_trade_signal_candles(self, preprocessed_df, bt_results):
|
||||||
signal_candles_only = {}
|
signal_candles_only = {}
|
||||||
for pair in preprocessed_tmp.keys():
|
for pair in preprocessed_df.keys():
|
||||||
signal_candles_only_df = DataFrame()
|
signal_candles_only_df = DataFrame()
|
||||||
|
|
||||||
pairdf = preprocessed_tmp[pair]
|
pairdf = preprocessed_df[pair]
|
||||||
resdf = results['results']
|
resdf = bt_results['results']
|
||||||
pairresults = resdf.loc[(resdf["pair"] == pair)]
|
pairresults = resdf.loc[(resdf["pair"] == pair)]
|
||||||
|
|
||||||
if pairdf.shape[0] > 0:
|
if pairdf.shape[0] > 0:
|
||||||
@ -1097,8 +1102,6 @@ class Backtesting:
|
|||||||
|
|
||||||
self.processed_dfs[self.strategy.get_strategy_name()] = signal_candles_only
|
self.processed_dfs[self.strategy.get_strategy_name()] = signal_candles_only
|
||||||
|
|
||||||
return min_date, max_date
|
|
||||||
|
|
||||||
def _get_min_cached_backtest_date(self):
|
def _get_min_cached_backtest_date(self):
|
||||||
min_backtest_date = None
|
min_backtest_date = None
|
||||||
backtest_cache_age = self.config.get('backtest_cache', constants.BACKTEST_CACHE_DEFAULT)
|
backtest_cache_age = self.config.get('backtest_cache', constants.BACKTEST_CACHE_DEFAULT)
|
||||||
|
Loading…
Reference in New Issue
Block a user