Use market data to get base and quote currencies in @informative() decorator.
This commit is contained in:
@@ -20,7 +20,7 @@ class InformativeDecoratorTest(IStrategy):
|
||||
startup_candle_count: int = 20
|
||||
|
||||
def informative_pairs(self):
|
||||
return [('BTC/USDT', '5m')]
|
||||
return [('NEO/USDT', '5m')]
|
||||
|
||||
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
dataframe['buy'] = 0
|
||||
@@ -38,8 +38,8 @@ class InformativeDecoratorTest(IStrategy):
|
||||
return dataframe
|
||||
|
||||
# Simple informative test.
|
||||
@informative('1h', 'BTC/{stake}')
|
||||
def populate_indicators_btc_1h(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
@informative('1h', 'NEO/{stake}')
|
||||
def populate_indicators_neo_1h(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
dataframe['rsi'] = 14
|
||||
return dataframe
|
||||
|
||||
@@ -50,7 +50,7 @@ class InformativeDecoratorTest(IStrategy):
|
||||
return dataframe
|
||||
|
||||
# Formatting test.
|
||||
@informative('30m', 'BTC/{stake}', '{column}_{BASE}_{QUOTE}_{base}_{quote}_{asset}_{timeframe}')
|
||||
@informative('30m', 'NEO/{stake}', '{column}_{BASE}_{QUOTE}_{base}_{quote}_{asset}_{timeframe}')
|
||||
def populate_indicators_btc_1h_2(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
dataframe['rsi'] = 14
|
||||
return dataframe
|
||||
@@ -68,7 +68,7 @@ class InformativeDecoratorTest(IStrategy):
|
||||
dataframe['rsi_less'] = dataframe['rsi'] < dataframe['rsi_1h']
|
||||
|
||||
# Mixing manual informative pairs with decorators.
|
||||
informative = self.dp.get_pair_dataframe('BTC/USDT', '5m')
|
||||
informative = self.dp.get_pair_dataframe('NEO/USDT', '5m')
|
||||
informative['rsi'] = 14
|
||||
dataframe = merge_informative_pair(dataframe, informative, self.timeframe, '5m', ffill=True)
|
||||
|
||||
|
Reference in New Issue
Block a user