Adapt after merge from develop

This commit is contained in:
Matthias 2018-07-20 20:56:44 +02:00
parent 0eff6719c2
commit df8700ead0
2 changed files with 5 additions and 5 deletions

View File

@ -57,8 +57,8 @@ class Backtesting(object):
self.strategy: IStrategy = StrategyResolver(self.config).strategy
self.ticker_interval = self.strategy.ticker_interval
self.tickerdata_to_dataframe = self.strategy.tickerdata_to_dataframe
self.populate_buy_trend = self.strategy.populate_buy_trend
self.populate_sell_trend = self.strategy.populate_sell_trend
self.advise_buy = self.strategy.advise_buy
self.advise_sell = self.strategy.advise_sell
# Reset keys for backtesting
self.config['exchange']['key'] = ''
@ -229,8 +229,8 @@ class Backtesting(object):
for pair, pair_data in processed.items():
pair_data['buy'], pair_data['sell'] = 0, 0 # cleanup from previous run
ticker_data = self.populate_sell_trend(
self.populate_buy_trend(pair_data, pair), pair)[headers].copy()
ticker_data = self.advise_sell(
self.advise_buy(pair_data, pair), pair)[headers].copy()
# to avoid using data from future, we buy/sell with signal from previous candle
ticker_data.loc[:, 'buy'] = ticker_data['buy'].shift(1)

View File

@ -277,7 +277,7 @@ class IStrategy(ABC):
"""
Creates a dataframe and populates indicators for given ticker data
"""
return {pair: self.populate_indicators(parse_ticker_dataframe(pair_data))
return {pair: self.advise_indicators(parse_ticker_dataframe(pair_data), pair)
for pair, pair_data in tickerdata.items()}
def advise_indicators(self, dataframe: DataFrame, pair: str) -> DataFrame: