Having trouble adding Crypto Symbols from Coinbase Pro / GDAX

Back

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!

Update Backtest







 
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi BestOnionTrader123,

The exceptions and errors that result are because ATOMUSD, DASHUSD, and LOOMUSDC are not listed as pairs available for trading in our Data Library. In fact, we do not support any 7-character crypto symbols at this time.

Even though we don’t have DASHUSD, we do have DSHUSD available. It can be added to an algorithm with

self.AddCrypto('DSHUSD', Resolution.Minute, Market.Bitfinex)

See the attached backtest for the full algorithm.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed