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!
Derek Melchin
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.
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.
Tiago Silva
Hello, this seems to not be working anymore.
Is there still no way to add 4+ length crypto coin pairs?
Error Message:
During the algorithm initialization, the following exception has occurred: ArgumentException : Symbol can't be found in the Symbol Properties Database: DSHUSD at QuantConnect.Securities.SecurityService.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x0009f] 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) [0x000a9] in :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 :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 self.AddCrypto('DSHUSD' in main.py:line 48Derek Melchin
Hi Tiago,
We can fix the issue by replacing 'DSHUSD' with 'DASHUSD'. See the attached backtest for reference.
Best,
Derek Melchin
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.
Tiago Silva
Hi Derek,
Thank you. Is there anywhere where I can see the supported tickers?
I see quantconnect page:
https://www.quantconnect.com/docs/data-library/cryptoAnd Bitfinex API Page:
https://api-pub.bitfinex.com/v2/conf/pub:list:pair:exchange
Are not up to date on the DASHUSD case for example.
David Eldringhoff
I would appriciate this too, especially for coinbase pro. The list on the documents is out of date I believe. It lists only 3 coins are tradeable on coinbase.
David Eldringhoff
I just tried MATICUSD and CVCUSD and they didnt work. How can I run a list to find those 62 pairs you mention bestonion?
Tiago Silva
Hi David,
Best place I found so far is the Lean Github page:
https://github.com/QuantConnect/Lean/blob/master/Data/symbol-properties/symbol-properties-database.csvYou can download the raw CSV and filter depending on preferences.
Derek Melchin
Hi David & Tiago,
We are in the process of updating our documentation. We appreciate your patience in the meantime. For a comprehensive list of the available securities, refer to the CSV above.
Best,
Derek Melchin
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.
Michael P
Hey Derek, thanks for following up on this. I came across this thread because I'm also interesting in trading some of the alt-coins on Coinbase: LINK, AAVE, COMP, etc. At least running some backtests against those datasets. Regarding your comment on not supporting any "7-character crypto symbols", curious on those details and if this is still a limitation. Thanks!
Michael P
If it's something like a simple length check, happy to help. Point me in the right direction. :)
Michael P
Lol. I'm a little confused now. I was able to backtest LINKUSD just fine (I initially had an incorrect start date). Guessing this means it should trade fine on Coinbase too. Sorry, another question. Is there a process for adding another symbol like AAVE? Thanks much! You all are doing amazing work.
Derek Melchin
Hi Michael,
The comment about 7-character cryptos is no longer accurate. We currently have data for LINKUSD and COMPUSD through Coinbase. AAVEUSD is listed on Coinbase, but we don't currently have the data available. See the attached backtest for reference.
We've created a Data Issue to have AAVEUSD data added to our library. Subscribe to our progress here.
Best,
Derek Melchin
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.
Michael P
Thanks Derek!
BestOnionTrader123
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!