Hi, I'm trying to use the AddUniverse feature with cryptos, so far I've tried bitfinex and binance (I know binance is not yet supported, but bitfinex is)
If I use :
self.AddUniverse(self.coarse_selection)
I get Stock stuff, even if used
self.SetBrokerageModel(BrokerageName.Bitfinex, AccountType.Cash)
1# There is something else necessary to get a proper coarse_list of ONLY AVAILABLE CRYPTOS?
Also I've Tried the MANUAL way, which send me on the worst of rabbit-holes, I checked this link
https://github.com/QuantConnect/Lean/blob/master/Data/symbol-properties/symbol-properties-database.csv
And created a list based on that.
The problem with it, is that either error because the symbol is not in the internal database (using quantconnect backtest servers) With this kind of error when trying to fetch the History
Runtime Error: Trying to retrieve an element from a collection using a key that does not exist in that collection throws a KeyError exception. To prevent the exception, ensure that the 'XLMUSDT E3' key exist in the collection and/or that collection is not empty. at wrapped_function raise KeyError(f"No key found for either mapped or original key. Mapped Key: {mKey}; Original Key: {oKey}") File "./cache/algorithm/main.py" in PandasMapper.py: line 75
I guess in this case my backtest is from start of 2021 in bitfinex and xlmusdt should be listed, or might be it isn't…
or this one too
Runtime Error: Symbol can't be found in the Symbol Properties Database: YYWUSD in SecurityService.cs:line 82 (Open Stacktrace)
I guess in this case the pair wasn't listed yet, but How the hell I can now that, I cannot even capture the error as there is no exception risen (python)
OR I get the weirdest of errors
Runtime Error: Trying to retrieve an element from a collection using a key that does not exist in that collection throws a KeyError exception. To prevent the exception, ensure that the key exist in the collection and/or that collection is not empty.
at pandas._libs.hashtable.PyObjectHashTable.get_item
File "hashtable_class_helper.pxi" in hashtable_class_helper.pxi: line 1613
(Open Stacktrace)
This last one is using the following markets extracted from the symbol-properties-database.csv of master
BITFINEX_REAL = [
'1INCHUSD', '1INCHUSDT', 'AAVEUSD', 'AAVEUSDT', 'ADABTC', 'ADAUSD', 'ADAUSDT', 'ALBTUSD', 'ALBTUSDT', 'ALGOBTC',
'ALGOUSD', 'ALGOUSDT', 'AMPLBTC', 'AMPLUSD', 'AMPLUSDT', 'ANTBTC', 'ANTETH', 'ANTUSD', 'ATOMBTC', 'ATOMETH',
'ATOMUSD', 'AVAXUSD', 'AVAXUSDT', 'B21USD', 'B21USDT', 'BALUSD', 'BALUSDT', 'BANDUSD', 'BANDUSDT', 'BATBTC',
'BATETH', 'BATUSD', 'BCHABCUSD', 'BCHNUSD', 'BESTUSD', 'BFTUSD', 'BMIUSD', 'BMIUSDT', 'BNTUSD', 'BOSONUSD',
'BOSONUSDT', 'BSVBTC', 'BSVUSD', 'BTCCNHT', 'BTCEUR', 'BTCGBP', 'BTCJPY', 'BTCUSD', 'BTCUSDT', 'BTCXCHF', 'BTGBTC',
'BTGUSD', 'BTSEUSD', 'BTTUSD', 'CELUSD', 'CELUSDT', 'CHEXUSD', 'CHZUSD', 'CHZUSDT', 'CLOUSD', 'CNHCNHT', 'COMPUSD',
'COMPUSDT', 'CTKUSD', 'CTKUSDT', 'DAIBTC', 'DAIETH', 'DAIUSD', 'DATABTC', 'DATAUSD', 'DGBUSD', 'MDOGEBTC',
'DOGEUSD', 'DOGEUSDT', 'MDOGEUSD', 'MDOGEUSDT', 'DOTBTC', 'DOTUSD', 'DOTUSDT', 'DASHBTC', 'DASHUSD', 'DUSKBTC',
'DUSKUSD', 'PNTBTC', 'PNTETH', 'PNTUSD', 'EGLDUSD', 'EGLDUSDT', 'ENJUSD', 'EOSBTC', 'EOSDTUSD', 'EOSDTUSDT',
'EOSETH', 'EOSEUR', 'EOSGBP', 'EOSJPY', 'EOSUSD', 'EOSUSDT', 'ESSUSD', 'ETCBTC', 'ETCUSD', 'ETH2ETH', 'ETH2USD',
'ETH2USDT', 'ETHBTC', 'ETHEUR', 'ETHGBP', 'ETHJPY', 'ETHUSD', 'ETHUSDT', 'ETPBTC', 'ETPETH', 'ETPUSD', 'EURSUSD',
'EURTEUR', 'EURTUSD', 'EURTUSDT', 'EXRDBTC', 'EXRDUSD', 'FCLUSD', 'FCLUSDT', 'FETUSD', 'FETUSDT', 'FILUSD',
'FILUSDT', 'FORTHUSD', 'FORTHUSDT', 'FTMUSD', 'FTMUSDT', 'FTTUSD', 'FTTUSDT', 'FUNUSD', 'GNOUSD', 'GLMUSD',
'GOTEUR', 'GOTUSD', 'GRTUSD', 'GRTUSDT', 'GTXUSD', 'GTXUSDT', 'HEZUSD', 'HEZUSDT', 'ICEUSD', 'ICPBTC', 'ICPUSD',
'ICPUSDT', 'IDUSD', 'IDUSDT', 'IOTABTC', 'IOTAETH', 'IOTAEUR', 'IOTAGBP', 'IOTAJPY', 'IOTAUSD', 'IQXUSD', 'IQXUSDT',
'JSTBTC', 'JSTUSD', 'JSTUSDT', 'KANUSD', 'KANUSDT', 'KNCBTC', 'KNCUSD', 'KSMUSD', 'KSMUSDT', 'LEOBTC', 'LEOEOS',
'LEOETH', 'LEOUSD', 'LEOUSDT', 'LINKUSD', 'LINKUSDT', 'LRCUSD', 'LTCBTC', 'LTCUSD', 'LTCUSDT', 'LUNAUSD',
'LUNAUSDT', 'LYMUSD', 'MIRUSD', 'MIRUSDT', 'MKRUSD', 'MLNUSD', 'MANABTC', 'MANAUSD', 'MOBUSD', 'MOBUSDT', 'NEARUSD',
'NEARUSDT', 'NECUSD', 'NEOBTC', 'NEOETH', 'NEOEUR', 'NEOGBP', 'NEOJPY', 'NEOUSD', 'NEXOBTC', 'NEXOUSD', 'NEXOUSDT',
'OCEANUSD', 'OCEANUSDT', 'ODEUSD', 'OMGBTC', 'OMGETH', 'OMGUSD', 'OMNIUSD', 'ORSUSD', 'OXYUSD', 'OXYUSDT',
'PASSUSD', 'PAXUSD', 'PAXUSDT', 'PLANETSUSD', 'PLANETSUSDT', 'PLUUSD', 'PNKETH', 'PNKUSD', 'QASHUSD', 'QTFBTC',
'QTFUSD', 'QTUMBTC', 'QTUMUSD', 'RBTCBTC', 'RBTCUSD', 'REP2BTC', 'REP2USD', 'REQUSD', 'RINGXUSD', 'RRBUSD',
'RRBUSDT', 'RRTUSD', 'SANBTC', 'SANETH', 'SANUSD', 'SNGLSUSD', 'SNTUSD', 'SNXUSD', 'SNXUSDT', 'SOLUSD', 'SOLUSDT',
'STORJUSD', 'SUKUUSD', 'SUKUUSDT', 'SUNUSD', 'SUNUSDT', 'SUSHIUSD', 'SUSHIUSDT', 'TRXBTC', 'TRXETH', 'TRXEUR',
'TRXUSD', 'TUSDUSD', 'TUSDUSDT', 'USDCUSD',
'USDCUSDT', 'UNIUSD', 'UNIUSDT', 'UOPUSD', 'UOPUSDT', 'UOSBTC', 'UOSUSD', 'USDTCNHT', 'USDTUSD', 'UTKUSD', 'VEEUSD',
'VELOUSD', 'VELOUSDT', 'VETBTC', 'VETUSD', 'VSYSBTC', 'VSYSUSD', 'WAXUSD', 'WBTCUSD', 'XAUTBTC', 'XAUTUSD',
'XAUTUSDT', 'XCHFUSD', 'XDCUSD', 'XDCUSDT', 'XLMBTC', 'XLMETH', 'XLMUSD', 'XLMUSDT', 'XMRBTC', 'XMRUSD', 'XMRUSDT',
'XRAUSD', 'XRPBTC', 'XRPUSD', 'XRPUSDT', 'XSNUSD', 'XTZBTC', 'XTZUSD', 'XVGUSD', 'YFIUSD', 'YFIUSDT', 'MCSUSD',
'ZCNUSD', 'ZECBTC', 'ZECUSD', 'ZILBTC', 'ZILUSD', 'ZRXBTC', 'ZRXETH', 'ZRXUSD',
]
So it has to be a better way, one that actually let you know the markets properly available as regards data and listing and delisting of coins.
Cheers!
Louis Szeto
Hi DanyG
The Coarse Universe Selection Tool is only filtering Equity security type, regardless of the brokerage model used. We are regretted that currently, we don't support a pipeline for cryptos yet.
We are not able to reproduce the first error, but this is probably due to referencing a dictionary/history call without the Symbol "XLMUSDT" as one of its keys. We suggest a debug test to spot if your algo had flaws. The second error is thrown if the pair is not supported (you may check if it is contained here). We look forward to support more crypto pairs in the future.
If you only do AddCrypto from the CSV list, you could check if data.ContainsKey(your_crypto_symbol) to see if the data is available since LEAn only receive data if the coin is listed and the market is open.
Best
Louis
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.
DanyG
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!