Switch from pair(str) to metadata(dict)

This commit is contained in:
Matthias
2018-07-29 20:36:03 +02:00
parent 941879dc19
commit 787d6042de
7 changed files with 64 additions and 57 deletions

View File

@@ -230,7 +230,7 @@ class Backtesting(object):
pair_data['buy'], pair_data['sell'] = 0, 0 # cleanup from previous run
ticker_data = self.advise_sell(
self.advise_buy(pair_data, pair), pair)[headers].copy()
self.advise_buy(pair_data, {'pair': pair}), {'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

@@ -75,7 +75,7 @@ class Hyperopt(Backtesting):
return arg_dict
@staticmethod
def populate_indicators(dataframe: DataFrame, pair: str) -> DataFrame:
def populate_indicators(dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['adx'] = ta.ADX(dataframe)
macd = ta.MACD(dataframe)
dataframe['macd'] = macd['macd']
@@ -228,7 +228,7 @@ class Hyperopt(Backtesting):
"""
Define the buy strategy parameters to be used by hyperopt
"""
def populate_buy_trend(dataframe: DataFrame, pair: str) -> DataFrame:
def populate_buy_trend(dataframe: DataFrame, metadata: dict) -> DataFrame:
"""
Buy strategy Hyperopt will build and use
"""