Just do a naive lookup for symbol normalization

notokeninwswrapper
Tyler Goodlet 2022-07-02 15:48:42 -04:00
parent f65f56ec75
commit f6888057c3
1 changed files with 7 additions and 5 deletions

View File

@ -450,12 +450,14 @@ def normalize_symbol(
Normalize symbol names to to a 3x3 pair. Normalize symbol names to to a 3x3 pair.
''' '''
remap = {
'XXBTZEUR': 'XBTEUR',
'XXMRZEUR': 'XMREUR',
}
symlen = len(ticker) symlen = len(ticker)
if symlen != 6: if symlen != 6:
for sym in ['XXBT', 'XXMR', 'ZEUR']: ticker = remap[ticker]
if sym in ticker: else:
ticker = ticker.replace(sym, sym[1:]) raise ValueError(f'Unhandled symbol: {ticker}')
else:
raise ValueError(f'Unhandled symbol: {ticker}')
return ticker.lower() return ticker.lower()