fix spice-rack test

This commit is contained in:
robcaulk
2022-09-17 17:36:48 +02:00
parent a7312dec03
commit 12a9fda885
2 changed files with 19 additions and 2 deletions

View File

@@ -205,12 +205,22 @@ class IStrategy(ABC, HyperStrategyMixin):
new_corr_pairs = []
new_tfs = []
if not self.dp:
logger.warning('No dataprovider available.')
config['freqai']['enabled'] = False
return config
# find the closest pairs to what the default config wants
for pair in corr_pairs:
closest_pair = difflib.get_close_matches(
pair,
self.dp._exchange.markets # type: ignore
)[0]
)
if not closest_pair:
logger.warning(f'Could not find {pair} in markets, removing from '
f'corr_pairlist.')
else:
closest_pair = closest_pair[0]
new_corr_pairs.append(closest_pair)
logger.info(f'Spice rack will use {closest_pair} as informative in FreqAI model.')