Hello, I am trying to implement universe selection for cryptos, filtering by technical indicators, for which I need to list all supported symbols, obviously. The only solution I found so far is to download
raw githubusercontent com/QuantConnect/Lean/master/Data/symbol-properties/symbol-properties-database.csv (why can't I just insert link in comment as it is?)
and filter required symbols from there.
While this generally works, it doesn't seem like a proper way, also for some symbols I am getting an error because it cannot be converted to USD (something about there is no chain to USD found I think), especially for Binance (I know its not supported), but also for a couple of symbols on Bitfinex (which is supported). And it seems I cannot catch this exception in my code (I guess I could find and override a method where it happens for that though).
So basically, is there a better way to define a crypto universe?
Dan Root
I don't know if this completely answers your question, but what I've done is just type them manually into a list or dictionary, then just passed that to the Manual Universe Selection Model. Then filter as you see fit in the OnData() or wherever else you need in your algorithm. The crypto data docs can assist in this. Also, it is important to note that some Crypto data may not be available at past dates due to that specific Crypto not being around at that time. Make sure to check to see if the data is available first because of this. I attached simple Algorithm to demonstrate this.
https://www.quantconnect.com/docs/data-library/crypto
Documentation - Algorithm Framework - Universe Selection - QuantConnect.com
Lean/BasicTemplateFrameworkAlgorithm.py at master · QuantConnect/Lean (github.com)
Mak K
Hi Yuri,
Just to add to Dan's answer which is correct and provided good links, so thank you Dan.
This is a manual universe selection model here;
https://github.com/QuantConnect/Lean/blob/master/Algorithm/Selection/ManualUniverseSelectionModel.py
Which I am guessing what you are trying to do is a manual universe?
If not please explain to me what exactly it is that you are trying to do, thanks!
Yuri Lopukhov
My question was how to get all (properly) supported symbols, just like it is written in the topic subject. Like I mentioned, not all symbols that can be found in downloadable database work correctly. And I think this would be useful for other people who try to use it.
Check this backtest with manual quote currency filter and try uncommenting return True in filter function.
Yuri Lopukhov
This is what happens if you don't filter:
As you can see this error in in C# code and I can't seem to catch and handle it in my Python code…
This only happens for a couple of symbols on Bitfinex. With Binance it is more complicated, I don't have time to check all of them. Besides, this may be fixed in the future by QuantConnect team, so black-listing is not very good thing in general…
Mak K
Hi Yuri,
Please check out this threat as it may answer your questions, even if the answer is not very satisfying…
We're very sorry for any inconveniences caused and thank you for your patience.
If you have any further questions on this I would suggest that you send an email to support@quantconnect.com
Thanks!
Yuri Lopukhov
I think I've already saw this thread, or similar thread, where I got the idea of using this CSV mentioned there. I guess so far there is no better option.
I wish QuantConnect team would consider adding Crypto, Forex and other universes for supported symbols and exchanges, so we could filter them with technical indicators. I think lots of users would appreciate this, manually adding symbols is just not great fit for algorithmic trading. Also, I don't think it is a lot of work, since the symbols database is already there and you already support it for your needs…
Mak K
Hi Yuri,
The main takeaway that I wanted you to get from the threat is this;
So they are working on it, but also a lot of other things, so it is taking some time, however they are hoping to finish the updated documentation by the end of this year, fingers crossed.
Thank you for your patience :)
Louis Szeto
Hi All
Please be noted that Coarse Fundamental Universe Selection is now available for Cryptos. Refer to this thread for more information.
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.
Yuri Lopukhov
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!