Hi All,
So I got the algorithm to run with out any errors but it is not making any trades.
I was wondering if I could ge some asscistance with it.
Best,
Andrew
QUANTCONNECT COMMUNITY
Hi All,
So I got the algorithm to run with out any errors but it is not making any trades.
I was wondering if I could ge some asscistance with it.
Best,
Andrew
Hi Victor,
by default the EqualWeightingPortfolioConstructionModel rebalances with the specified resolution (which is Resolution.Daily here). To avoid this, just pass "lambda time: None" to your PortfolioConstructionModel and use
self.Settings.RebalancePortfolioOnSecurityChanges = True
self.Settings.RebalancePortfolioOnInsightChanges = False
to make sure the algorithm will rebalance only when there were changes in your universe (which is 15th january).
I've attached a backtest which should meet your criteria.
Let me know if you have further questions.
some additional notes:
- self.Time.date is a method, if you want to call this function you need self.Time.date(). But keep in mind this would return a tuple (year, month, day). I've replaced it with self.Time.day for your purpose.
- if CoarseSelectionFunction returns UniverseUnchanged it will skip FineSelectionFunction, so you don't need to return UniverseUnchanged there.
- keep in mind that trading only at 15th jan is not a stable solution since this could falls on a weekend. however, i guess you just mentioned it for demo/testing purposes.
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!