Use market data to get base and quote currencies in @informative() decorator.
This commit is contained in:
@@ -67,7 +67,7 @@ class Backtesting:
|
||||
self.all_results: Dict[str, Dict] = {}
|
||||
|
||||
self.exchange = ExchangeResolver.load_exchange(self.config['exchange']['name'], self.config)
|
||||
self.dataprovider = DataProvider(self.config, None)
|
||||
self.dataprovider = DataProvider(self.config, self.exchange)
|
||||
|
||||
if self.config.get('strategy_list', None):
|
||||
for strat in list(self.config['strategy_list']):
|
||||
|
@@ -80,12 +80,11 @@ def _create_and_merge_informative_pair(strategy, dataframe: DataFrame, metadata:
|
||||
# Not specifying an asset will define informative dataframe for current pair.
|
||||
asset = metadata['pair']
|
||||
|
||||
if '/' in asset:
|
||||
base, quote = asset.split('/')
|
||||
else:
|
||||
# When futures are supported this may need reevaluation.
|
||||
# base, quote = asset, ''
|
||||
raise OperationalException('Not implemented.')
|
||||
market = strategy.dp.market(asset)
|
||||
if market is None:
|
||||
raise OperationalException(f'Market {asset} is not available.')
|
||||
base = market['base']
|
||||
quote = market['quote']
|
||||
|
||||
# Default format. This optimizes for the common case: informative pairs using same stake
|
||||
# currency. When quote currency matches stake currency, column name will omit base currency.
|
||||
|
Reference in New Issue
Block a user