Hey everyone, i'm trying to understand this example because I believe it should be only buying on the start of a new month when the market opens but under orders it buys on multiple days throughout the month. I'm only wanting it to buy two stocks selected based on parameters at the start of the month on market open. Any help appreciated :)
Thanks
Alexandre Catarino
Hi Liam,
The Schedule Universe Selection model doesn't have a bug. If we log the symbols in SelectPair, we will find:
2016-01-04 14:30:00 :: AAPL,DIS 2016-02-01 14:30:00 :: DD,UTX 2016-03-01 14:30:00 :: MSFT,GS 2016-04-01 13:30:00 :: WMT,PFE 2016-05-02 13:30:00 :: INTC,AAPL 2016-06-01 13:30:00 :: BA,DIS 2016-07-01 13:30:00 :: AXP,V 2016-08-01 13:30:00 :: XOM,CVX 2016-09-01 13:30:00 :: UNH,VZ 2016-10-03 13:30:00 :: NKE,GE 2016-11-01 13:30:00 :: PFE,MMM 2016-12-01 14:30:00 :: V,PG
The issue is related to the choice of Alpha Model. ConstantAlphaModel is set to emit an alpha for every active security every time there is not an active insight for it and, since the insight expiry is set to 1 day (timedelta(1)), the pairs will rebalance daily. Also, ConstantAlphaModel doesn't know that SPY is not tradable (is it only the benchmark to select the pairs).
The solution is the creation of a new Alpha Model that will handle the insights accordingly.
Â
Liam Maurer
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!