- In some cases, for Resolution.Daily, application of splits were
up to one day behind the data. Causing the 'early' data to use a
wrong factor value
- Updating regression test affected by issue
- Adding new regression test
Restructured
Update message
Added removal of trailing highs for unnecessary securities
Add logging message
Improvements
Rename
Add regression Algorithm
Changed to use TradeBar values instead of only current price
Cleaned msg layout
Update Regression test
The CompositeRiskManagementModel aims to provide support for multiple
risk management models. In order to accomplish this, it must respect
the return values from each individual model. As previously written,
the composite model was allowing models run later to completely nuke
the targets produced by earlier models. This change performs the
composition of targets using the same technique as is used when over
laying the risk adjusted targets on top of the portfolio construction
model's targets. This approach gives preference, by symbol, to the
risk adjusted targets, but if there is no risk adjusted target, then
it uses the targets from the previous step. For example, if targets
for A, B, C, and D are produced by PCM, then risk model 1 adjusts to
zero targets for B and cuts the targets for C in half, these are then
piped to risk model 2 (A, C/2, D). Risk model 2 may return ZERO targets.
This doesn't mean we should remove all the targets, it simply means
that the risk model didn't adjust any and we should use the output
from risk model 1. Now, let's say risk model 2 zeroes out A and cuts
B in half again, the final result should (and now is) C/4, D. IOW,
risk models only return deltas, things to be changed, so returning
nothing means there are no changes.
- Removed usages of algorithm.Securities.key as a parameter for the
`ManualUniverseSelectionModel()` since those securities, added through
`AddXXXX` calls will be managed by the `UserDefinedUniverse`. This was
causing for Universes to try to add the same subscription requests
- Adding new empty constructor for ManualUniverseSelectionModel,
required for Python
- ManualUniverse will return any existing SDC for the
symbol. This is for maintaining existing behavior and
preventing breaking changes: Specifically motivated by usages of
Algorithm.Securities.Keys as constructor parameter of the
ManualUniverseSelectionModel, since those Symbols added by Addxxx()
calls will already be managed by the UserDefinedUniverse
- Making some format modifications to aling with used Lean formatting
In `SecurityHolding.TotalCloseProfit`, use the market order direction to define whether ithe method should use the bid or the ask to compute unrealized profit.
- Fix statistics of futures' algorithms.
- Adds unit test.
1. Apply the pattern used in `EqualWeightingPortfolioConstructionModel`
2. Change the logic to compute the views from the insights.
3. Change the logis to compute the posterior mean and covariance
Use `UnconstrainedMeanVariancePortfolioOptimizer` in `BlackLittermanPortfolioOptimizationFrameworkAlgorithm` to bypass the difference in regression tests with `IPortfolioOptimizer` that rely on different algorithms in C# and python.
Adds unit tests for BLOPCV to test the implementation against Black and Litterman 1999 paper.
- When there are or aren'tt new insights, the EqualWeightingPortfolioConstructionModel will creates a target to flatten delisted securities from the universe of expired insights.
- Helper methods were added to deal with removing expired insights and getting active ones and used in `EqualWeightingPortfolioConstructionModel`
- Adds unit test
- Updates framework algorithms
Fixes a bug where we were using the security's data resolution to compute
the insight's close time. This led a case such as insight.Period == 20days
to step 20days worth of tradable minutes (assuming minute data resolution),
yielding a close time that was very far in the future.
We also add different means of specifying an insight's period/close time:
1. Specify insight period as a TimeSpan and we compute close time
2. Specify insight period and a resolution and bar count and we compute close time
3. Specify insight close time local directly and we compute the insight period
The key here is maintaining consistency between the three different approaches
which is heavily validated with the corresponding unit tests.
Edits also made to trust the insight's close time as the analysis end time in
the case where the analysis period == insight period (extra analysis period = 0).
Given the current setup (extra analysis period == 0), this guarantees that close
and analysis end times are equivalent.
Regression statistics were updated and expectedly we get many more insights that
have completed analysis, and as such, average scores have also changed.
Adds a trade to `WarmupConversionRatesRegressionAlgorithm` and updates the `ExpectedStatistics`.
Before the changes proposed in this pull request, CAGR jumps from 1441.897% to 3067.390%.
- The algorithm has been renamed to CoarseFundamentalTop3Algorithm and updated to select the Top 3 instead of Top 5.
- The only new data required is daily, map and factor file for FB and has been added (map and factor files are dated 6/4/2018, as required by all regression tests).
- The coarse fundamental open source data has been updated.
- The expected regression statistics for the algorithm have been updated.
This algorithm shows how to implement a futures strategy in a framework algorithm.
`FutureUniverseSelectionModel` portfolio selection model was implemented to provide a base class to help create other futures universe selection models.
Move delisting date estimation to the constructor
Using `MarketHoursDatabase` for option delisting date estimation instead USHolidays
Adding file header.
Regression algorithm added.
Use of `ExchangeHours.IsDateOpen` instead `ExchangeHours.IsDateOpen.Holidays`.
Extract values from `symbol.ID` into a local variable.
Improved Regression test
- Changes `ExpectedStatistics` in MVOFA
- All regression tests now
- Removes unnecessary constructor arguments in `ReturnsSymbolData`
- Tide up code and add method summaries.