don't copy tickerdata_to_dataframe into backtesting

it's used only once, so this does not make sense and hides the origin of
the function
This commit is contained in:
Matthias
2018-10-17 19:47:19 +02:00
parent f9bbeb79fa
commit 8a3272e7c5
4 changed files with 13 additions and 14 deletions

View File

@@ -88,7 +88,6 @@ class Backtesting(object):
"""
self.strategy = strategy
self.ticker_interval = self.config.get('ticker_interval')
self.tickerdata_to_dataframe = strategy.tickerdata_to_dataframe
self.advise_buy = strategy.advise_buy
self.advise_sell = strategy.advise_sell
@@ -371,7 +370,7 @@ class Backtesting(object):
self._set_strategy(strat)
# need to reprocess data every time to populate signals
preprocessed = self.tickerdata_to_dataframe(data)
preprocessed = self.strategy.tickerdata_to_dataframe(data)
# Print timeframe
min_date, max_date = self.get_timeframe(preprocessed)

View File

@@ -352,7 +352,7 @@ class Hyperopt(Backtesting):
if self.has_space('buy'):
self.strategy.advise_indicators = Hyperopt.populate_indicators # type: ignore
dump(self.tickerdata_to_dataframe(data), TICKERDATA_PICKLE)
dump(self.strategy.tickerdata_to_dataframe(data), TICKERDATA_PICKLE)
self.exchange = None # type: ignore
self.load_previous_results()