Back

Schedule Coarse/Fine Universe Selection

The Framework Algorithm wizzard provides either a scheduled universe or a coarse/fine universe collection. How can I combine both and schedule a coarse/fine universe selection once a month? 

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 Filib,

Scheduled universe selection and coarse/fine universe selection are not designed to work in a chain combination. We are making more universe selection models.

Here is an example of scheduling selection once a month: in both CoarseSelectionFunction() and FineSelectionFunction(), we first check if it is a new month. If not, we return the unchanged symbol list. If it is a new month, then do monthly selection. The check for new month is
{if self.Time.month == self.lastMonth:
           return self.symbols}
And the update for new month is
{self.lastMonth = self.Time.month}

Hope it helps!

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.


Thanks for your answer - I am already using these kind of workarounds. My point is: They shouldn't be necessary. If you provide a scheduling mechanism for anything, you should also provide flexible scheduling periods. Right now, one can only choose between minute, daily, weekly and monthly and for the latter, you only get to choose between month start and month end. If I want any other period , or if I want to schedule an event in the middle of a month, I am bound to use workarounds and additional code, like the one you provided.

That has a smell... 

0

Hi Filib Uster,
We have been looking into helpers to make Lean users life easy.
However, please note that Lean is event/data-driven and we cannot schedule an event. The workaround is actually a good solution for the Coarse+Fine Universe Selection case, because, in theory, we don't know when the event is fired. Therefore, only after the event is fired, that we can decide whether the algorithm should change the universe or not.

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