Commit Graph

76 Commits

Author SHA1 Message Date
Michael Handschuh f47c700746 Add CompositeAlphaModel
The composite model combines multiple alpha models into a singular model and
properly sets each insight's SourceModel property to the name of the model that
generated the insight
2018-04-17 16:50:24 -04:00
Michael Handschuh 90d54da87c Add INamedModel and implement in existing alpha models
Alpha models can choose to implement the Name property, if not, the system
will use the model's type name as the Insight.SourceModel.
Existing tests were updated to also assert expected model names
2018-04-17 16:50:16 -04:00
AlexCatarino f437db8833 Fixes C# MacdAlphaModel
MACD was created with a helper method and registered for automatic updates, where we should use the constructor.
2018-04-11 11:17:44 +01:00
AlexCatarino 58493a2f21 Updates python version Lean AlphaModels to reflect API changes
Refactors unit tests.
2018-04-11 11:16:04 +01:00
AlexCatarino 191d92b7ea Adds python version of RsiAlphaModel 2018-04-11 11:07:51 +01:00
AlexCatarino 5a23a18fb8 Adds python version of EmaCrossAlphaModel 2018-04-11 11:07:51 +01:00
AlexCatarino 35cb62d65a Adds python version of MacdAlphaModel 2018-04-11 11:07:51 +01:00
AlexCatarino 8325b77c07 Adds python version of ConstantAlphaModel 2018-04-11 11:07:51 +01:00
AlexCatarino bf1aa7fa4c Implements Insight.Price helper method.
Implements `Insight.Price` method to make it easier to create new instances of `Insight` of `InsightType.Price`.
Standardize the parameter order to `Symbol`, `TimeSpan`, `InsightType`, `InsightDirection`, `Double`, `Double`.
2018-04-10 19:49:29 +01:00
Jared f32f351a4d Merge pull request #1832 from AlexCatarino/feature-1798-adds-meanvariancemodel
Implements MeanVarianceOptimizationAlgorithm
2018-04-08 20:27:17 -04:00
Michael Handschuh 31bc9d0544 Add method to easily warmup indicators
Three methods were added to enable easier consumption of an enumerable
of slices returned from a history request. The dictionary version is
most likely to be used by python, while the functional versions allow
for lots of flexibility in how you'd like to consume the stream of slices.
2018-04-06 16:30:28 -04:00
Michael Handschuh 92c5e64024 Adds VWAP and STD execution models
VWAP will submit market orders while the current price is more favorable than VWAP.
STD will submit market orders while the current price is a configured number of
standard deviations away from the mean in the favorable direction.
2018-04-06 16:30:26 -04:00
AlexCatarino a73cf3e328 Fixes HistoricalReturnsAlphaModel and MeanVarianceOptimizationPortfolioConstructionModel
Those models were not handling security removal properly. Once a security is removed, consolidators need to be removed.
2018-04-06 19:44:15 +01:00
AlexCatarino 133d2cd461 Implements peer-review requests
1. `HistoricalReturnsAlphaModel`:
   1. Adds lookback period for return calculation
   2. Adds return-depend direction to insights
   3. Refactors indicator history warm-up
2. `MeanVarianceOptimizationPortfolioConstructionModel`:
   1. Adds lookback period for return calculation
   2. Adds exception for null magnitude
   3. Refactors indicator history warm-up
3. Other minor fixes:
   1. Default target return was 2 instead of 0.02 (2%)
   2. Proper removal of consolidator subscriptions
2018-04-06 00:28:05 +01:00
AlexCatarino 92238a02fc Implements MeanVarianceOptimizationAlgorithm
This framework algorithm alpha model is  HistoricalReturnsAlphaModel and the  portfolio construction model is MeanVarianceOptimizationPortfolioConstructionModel.
This examples implements an algorithm that rebalances the portfolio according to modern portfolio theory.
2018-04-06 00:28:05 +01:00
Michael Handschuh f11acf1246 Remove Insight.Equals
This method is misleading at best and incorrect at worst.
Insight objects should use reference equality or compare ids to
perform equality checking. The only usage, in MacdAlphaModel,
was easily converted to not relying on this method.
2018-04-03 23:32:34 -04:00
Michael Handschuh a56d02e8a2 Set default values for MacdAlphaModel ctor args
Model constructor arguments changed to only accept MACD indicator parameters.
2018-04-03 16:20:38 -04:00
Michael Handschuh 82bbfde0be Define default values for EmaCrossAlphaModel
Model constructor arguments simplified to only contain EMA parameters.
2018-04-03 16:20:15 -04:00
Michael Handschuh 3895fa461a Remove RsiAlphaModel.Parameters, replace w/ ctor args
Model constructor arguments simplified to only contain RSI parameters.
2018-04-03 16:19:48 -04:00
Michael Handschuh f5656f6113 Add EmaCrossAlphaModel
Simple alpha model that uses a fast/slow ema cross to generate
a prediction.
2018-03-26 17:33:14 -04:00
Michael Handschuh 64b9766685 Add RsiAlphaModel 2018-03-26 16:42:24 -04:00
AlexCatarino b8cfbd7c24 Improves error message in python wrappers 2018-03-14 12:30:50 +00:00
AlexCatarino 35d29060d0 Implements python support for custom models in framework
Adds method overload that accept a `PyObject` to `SetAlpha`, `SetExecution`, `SetPortfolioConstruction`, `SetPortfolioSelection` and `SetRiskManagement`. In these methods, a custom model written in python will be wrapped around the respective `PythonWrapper`.
2018-03-13 11:35:31 +00:00
Michael Handschuh 6b239674e2 Renames Alpha -> Insight
The term 'alpha' is used to describe the entire algorithm. Therefore, 'alpha'
produces insights. From this we have things like IAlphaModel, which is the model
defining how insights are produced. We have IAlphaHandler, which defines how the
insights from a single 'alpha' (the algorithm) are managed, analyzed, and stored.
Types closer to the individual prediction level, such as InsightDirection, or
InsightScore relate directly to exactly 1 insight. The distinction between the
two became more clear as we developed the insights API, and from that effort it
was decided to harmonize alpha/insight terminology across the various QC systems.
2018-03-09 16:12:56 -05:00
Michael Handschuh 3161fd600b Rename PercentChange -> Magnitude 2017-12-15 20:10:34 -05:00
Michael Handschuh b4b3aae112 Rename Signal -> Alpha
Whoa... I think I got everything :)
2017-12-15 18:24:58 -05:00