- This version serves two purposes: example of universe selection model and base class for other universe selection models, since the pythonnet doesn't deal well with inheritance of abstract classes.
- Adds PyObject overload to `CoarseFundamentalUniverse`.
The volume weighted average price execution model had its own implementation
of VWAP since the existing VWAP didn't perform the daily reset. The intraday
VWAP indicator has since been added to the indicators project so this is just
duplicate code.
Framework models should not loop over `algorithm.Securities` since it contains all securities that were ever added to the algorithm, but `UniverseManager.ActiveSecurities` that contains only the active securities.
Instances of `PortfolioTargetCollection` are intended to be a class level variables and not a method level variables. As a class member it maintains a complete set of all portfolio targets so you can operate against a 'full view' instead of the potentially streaming targets (which can come in one by one as alpha is generated).
- Use `MaximumDrawdownPercentPerSecurity` as `RiskManagementModel`.
- Modifies regression test to reflect risk model choice
- Use SetXXX to set models in python version
We are not using python lists instead of generator (yield) because we get better exception information in this case. The aim is to lead users to avoid using generators and/or know its limitations.
The exception in ignored because the generator isn't closed until it is being deleted (automatically in this case, when Python exits); the generator __del__ handler closes the generator, which triggers an exception of there is one.
We add entries for custom data w/ symbol references, so the generic look
up being performed here never resolves and throws an exception. With
custom data we add the entry manually and that same pattern has been
repeated here for consistency.
This happens when users pass Securities.Keys into the manual model,
causing the SecurityChanges object to have references to the canonical
securities, thereby leading to indicators and other things being
done to them unknowningly.
The PairsTradingAlphaModel is a simple example of defining an insight
grouping. Insights that are grouped together are assigned a unique
group-id that can be used by the portfolio construction model.
Updates were made to the CommonAlphaModelTests to give more control to
derived types. Some changes are still needed here to give securities
unique prices. I would recommend using a psuedo-random walk approach
by using Random with a constant seed value.