So i was trying to modify the algorithm for the benzinga alternative dataset to allow for a universe selection of symbols, but everything I have tried gives the error: No data loaded for KHC W1YY4MGI5CH1 because there were no tradeable dates for this security.
documentation (original):
What am I doing wrong on my version? How do i get it to work with a universe coarse filter?
Louis Szeto
Hi Garrison
For dynamic universe, the Benzinga News Feed data has to be subscribe in the OnSecuritiesChanged method by:
as Initialize method will only run once at the start of the algorithm.
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.
Garrison Whipple
You are awesome! I got it to work, Now how would I go about setting the universe coarse/fine to a custom metric such as marketCap / Dollarvolume < 10,000 ? I have tried following the documentation here: https://www.quantconnect.com/docs/algorithm-reference/universes
But It doesn't tell how to define the symbols before it gets to the class object as i am getting errors noting that.
Garrison Whipple
Sorry Use this example instead, forgot the second part, still getting the same error:
Garrison Whipple
Louis Szeto
Varad Kabade
Hi Garrison Whipple,
The Universe selection method in the snippet is incorrect. The attribute MarketCap is a property of the FineFundamental object; to get the above method to work, we recommend implementing different functions for coarse and fine selection. We recommend going through the following example algorithm, which combines coarse and fine filters for universe selection.
Best,
Varad Kabade
Garrison Whipple
Varad kabade where does it combine them? the example you gave has them filtered seperately.
Louis Szeto
Hi Garrison
They are combined. Only the symbols returned from Coarse Universe Selection will relay to the Fine Universe Selection method. Check this doc to see how universe selection works.
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.
Garrison Whipple
Louis Szeto are you saying what I am trying to do is not possible?
Varad Kabade
Hi Garrison Whipple,
The filtering that you are trying to do is possible. You just have to break down the filter into a coarse and fine filter function.
Best,
Varad Kabade
Garrison Whipple
Louis Szeto Varad kabade I did try that already but I don't understand how to use the DollarVolume variable from the coarse filter with the marketcap from the fine filter at the same time.
Do I somehow pass the variables to another function or do I pass the coarse variable to the fine function similar to what I have below?
Louis Szeto
Hi Garrison
Only the symbols from the Coarse Universe Selection method will pass on for Fine filtering, so the Fine Universe Selection method will not have access to .DollarVolume attribute as in Coarse Selection. However, since the working order is the first filter by Coarse then Fine, we can use the updated dollar volume in Fine by storing it in a dictionary:
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.
Garrison Whipple
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!