Don't run validation per strategy, it's only eneded once

This commit is contained in:
Matthias 2019-06-14 19:37:54 +02:00
parent 0d8b572a17
commit 1afe6c1437

View File

@ -421,10 +421,6 @@ class Backtesting(object):
max_open_trades = 0
all_results = {}
for strat in self.strategylist:
logger.info("Running backtesting for Strategy %s", strat.get_strategy_name())
self._set_strategy(strat)
min_date, max_date = history.get_timeframe(data)
# Validate dataframe for missing values (mainly at start and end, as fillup is called)
history.validate_backtest_data(data, min_date, max_date,
@ -435,6 +431,11 @@ class Backtesting(object):
max_date.isoformat(),
(max_date - min_date).days
)
for strat in self.strategylist:
logger.info("Running backtesting for Strategy %s", strat.get_strategy_name())
self._set_strategy(strat)
# need to reprocess data every time to populate signals
preprocessed = self.strategy.tickerdata_to_dataframe(data)