Just do a naive lookup for symbol normalization
parent
f65f56ec75
commit
f6888057c3
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue