The Coinbase Pro / GDAX data displays 62 pairs (great job expanding this, QC team!).
However, I am having some trouble adding the symbols, especially for crypto pairs that include cryptos with four characters. Doing so gives me an error. What's the proper way to do this? Here's the code:
class UncoupledCalibratedAntennaArray(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2020, 1, 1) # Set Start Date
self.SetEndDate(2020,1,7)
self.SetCash(100000) # Set Strategy Cash
# Add the pairs containing *BTC on Coinbase Pro
# symbols = ['algousd','atombtc','atomusd','bateth','batusdc','bchbtc',
# 'bcheur','bchgbp','bchusd','btceur','btcgbp','btcusd',
# 'btcusdc','cvcusdc','daiusdc','dashbtc','dashusd','dntusdc',
# 'eosbtc','eoseur','eosusd','etcbtc','etceur','etcgbp',
# 'etcusd','ethbtc','ethdai','etheur','ethgbp','ethusd',
# 'ethusdc','gntusdc','kncbtc','kncusd','linketh','linkusd',
# 'loomusdc','ltcbtc','ltceur','ltcgbp','ltcusd','manausdc',
# 'mkrbtc','mkrusdc','oxtusd','repbtc','repeur','repusd',
# 'xlmbtc','xlmeur','xlmusd','xrpbtc','xrpeur','xrpusd',
# 'xtzbtc','xtzusd','zecbtc','zecusdc','zilusdc','zrxbtc',
# 'zrxeur','zrxusd']
# for symbol in symbols:
# # add according forex data to add the crypto pairs
# self.AddCrypto(symbol, Resolution.Minute, Market.GDAX)
# self.AddCrypto('ATOMUSD', Resolution.Minute, Market.GDAX) # => Exception
self.AddCrypto('BTCUSD', Resolution.Minute, Market.GDAX)
self.AddCrypto('EOSUSD', Resolution.Minute, Market.GDAX)
# self.AddCrypto('dashusd', Resolution.Minute, Market.GDAX) # => Exception
self.AddCrypto('loomusdc', Resolution.Minute, Market.GDAX)
def OnData(self, data):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:
data: Slice object keyed by symbol containing the stock data
'''
# if not self.Portfolio.Invested:
# self.SetHoldings("SPY", 1)
The output error message:
During the algorithm initialization, the following exception has occurred: ArgumentException : Symbol can't be found in the Symbol Properties Database: LOOMUSDC
at QuantConnect.Securities.SecurityService.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x000b7] in :0
at QuantConnect.Securities.SecurityManager.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00000] in :0
at QuantConnect.Algorithm.QCAlgorithm.AddSecurity[T] (QuantConnect.SecurityType securityType, System.String ticker, System.Nullable`1[T] resolution, System.String market, System.Boolean fillDataForward, System.Decimal leverage, System.Boolean extendedMarketHours) [0x000a6] in <7fa80b6fc9634409a464be671b03c6c6>:0
at QuantConnect.Algorithm.QCAlgorithm.AddCrypto (System.String ticker, System.Nullable`1[T] resolution, System.String market, System.Boolean fillDataForward, System.Decimal leverage) [0x00001] in <7fa80b6fc9634409a464be671b03c6c6>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in :0
at Initialize in main.py:line 33
ArgumentException : Symbol can't be found in the Symbol Properties Database: LOOMUSDC
at QuantConnect.Securities.SecurityService.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x000b7] in :0
at QuantConnect.Securities.SecurityManager.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00000] in :0
at QuantConnect.Algorithm.QCAlgorithm.AddSecurity[T] (QuantConnect.SecurityType securityType, System.String ticker, System.Nullable`1[T] resolution, System.String market, System.Boolean fillDataForward, System.Decimal leverage, System.Boolean extendedMarketHours) [0x000a6] in <7fa80b6fc9634409a464be671b03c6c6>:0
at QuantConnect.Algorithm.QCAlgorithm.AddCrypto (System.String ticker, System.Nullable`1[T] resolution, System.String market, System.Boolean fillDataForward, System.Decimal leverage) [0x00001] in <7fa80b6fc9634409a464be671b03c6c6>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in :0
Thanks!