From a30d498abfb18deb76730a0fc7d0436941617d6a Mon Sep 17 00:00:00 2001 From: Frederic Fortier Date: Tue, 6 Mar 2018 22:12:19 -0500 Subject: [PATCH] BLD: added symbol mapping when migrating bundles --- catalyst/exchange/ccxt/ccxt_exchange.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/catalyst/exchange/ccxt/ccxt_exchange.py b/catalyst/exchange/ccxt/ccxt_exchange.py index 78386e6c..b17eccc1 100644 --- a/catalyst/exchange/ccxt/ccxt_exchange.py +++ b/catalyst/exchange/ccxt/ccxt_exchange.py @@ -232,6 +232,21 @@ class CCXT(Exchange): return frequencies + def substitute_currency_code(self, currency, source='catalyst'): + if source == 'catalyst': + currency = currency.upper() + + key = self.api.common_currency_code(currency).lower() + self._common_symbols[key] = currency.lower() + return key + + else: + if currency in self._common_symbols: + return self._common_symbols[currency] + + else: + return currency.lower() + def get_symbol(self, asset_or_symbol, source='catalyst'): """ The CCXT symbol.