Commit Graph

24 Commits

Author SHA1 Message Date
Martin Molinero 165f6fa43e Adjusting unit and regression tests 2018-08-28 12:27:21 -03:00
Michael Handschuh 4fd16f6daf Fix resolution of insight close times, allow user defined close times
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.
2018-08-07 11:21:11 -04:00
Michael Handschuh b038839e78 Seed insight score EMAs with 5 point SMA
This is to remove some asymptotic behavior when the first insight
score is 1 or 0.
2018-08-01 12:21:01 -03:00
Michael Handschuh 380caa5203 Add IRegressionAlgorithmDefinition.CanRunLocally
This flag indicates whether or not the local regression test system,
via RegressionTests.AlgorithmStatisticsRegression should run a given
IRegressionAlgorithmDefinition
2018-07-18 15:57:11 -04:00
Martin Molinero 96dc5e8673 Moving IRegressionAlgorithmDefinition to QuantConnect.Common 2018-07-03 13:34:27 -03:00
Michael Handschuh 8402b6f01e Update factor files to 2018.06.04
It's important that we keep the factor files consistent with respect to
the date that they were generated. This enables us to run the regression
algorithms in the cloud and get the same results by using the factor files
from the correct date.
2018-06-07 12:16:45 -04:00
Michael Handschuh 9ee61f425c Refactor regression algorithm to IRegressionAlgorithmDefinition
A mechanical refactoring was performed to make algorithms currently used in
regression algorithms to implement IRegressionAlgorithmDefinition, which allows
algorithms to define their own expected statistics and what languages should be
run as part of regression. The type name of the  C# type is used to determine the
file/model name for python. This was for simplicity, but if needed, could later be
refactored to expose more information, but for now the convention of keeping names
the same makes sense and just works easily.
2018-06-05 12:10:50 -04:00
AlexCatarino aac5cb65ce Updates Framework example algorithms to use Set model methods 2018-05-07 14:20:35 +01:00
AlexCatarino 11489b3edf Modifies BasicTemplateFrameworkAlgorithm
- Use `MaximumDrawdownPercentPerSecurity` as `RiskManagementModel`.
- Modifies regression test to reflect risk model choice
- Use SetXXX to set models in python version
2018-04-27 23:08:53 +01:00
Michael Handschuh d87c121d4b Rename IPortfolioSelectionModel -> IUniverseSelectionModel 2018-03-29 12:18:44 -04:00
Michael Handschuh c5704a1cd4 Rename SimplePortfolioConstructionModel -> EqualWeightingPortoflioConstructionModel
The simple name was too simple and too vague. Equal weighting nicely
describes the purpose and intent of this model
2018-03-26 17:33:13 -04: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 b4b3aae112 Rename Signal -> Alpha
Whoa... I think I got everything :)
2017-12-15 18:24:58 -05:00
Michael Handschuh 5910bc620f Add ISignalHandler
Handles signals generated by the algorithm. The default implementation
sends a SignalPacket to the messaging handler.
2017-12-12 08:56:19 -05:00
Michael Handschuh d0b7c9b31e Make ISignal.Period a required field
Requiring a period here forces signal models to place a time frame on
when their signal is valid. This also allows consumers of signals to
have some expectation of when a prediction should come to fruition.
2017-12-10 08:41:29 -05:00
Michael Handschuh 8093a818c7 Rename Direction -> SignalDirection
This follows the naming convention of the other direction enums
2017-12-08 10:07:54 -05:00
Michael Handschuh dac63225cf Set default executon and risk management models 2017-12-08 10:07:54 -05:00
Michael Handschuh d6496ebb85 Change ManualPortfolioSelectionModel to accept params Symbol
This will make life easier for python while also keeping things easy for csharp.
2017-12-08 10:07:54 -05:00
Michael Handschuh 160a28076c Use simpler ManualPortfolioSelectionModel constructor for example 2017-12-08 10:07:54 -05:00
Michael Handschuh 755dcb30ab Add IRiskManagementModel
The risk management model is intended to check the algorithm's positions
at the end of each time step to potentially exit positions that are losing
too much.
2017-12-08 10:07:54 -05:00
Michael Handschuh 7076928904 Add IExecutionModel
The execution model is responsible for executing trades to achieve the desired
portfolio targets
2017-12-08 10:07:54 -05:00
Michael Handschuh 343bbf2c59 Add IPortfolioConstructionModel
The portoflio construction model generates portoflio targets from signals
2017-12-08 10:07:53 -05:00
Michael Handschuh 514434692b Add ISignalModel
This change includes a check to prevent users from overriding methods  required
by the framework. This is non-ideal and we should perhaps look into alternatives
to this approach, which could involve additional methods on IAlgorithm. In order
to not lose access to these events at the algorithm level, we could expose them
as C# events (not sure python compatibility?)
2017-12-08 10:07:53 -05:00
Michael Handschuh e4e82bd2bc Add BasicTemplateFrameworkAlgorithm
This example algorithm serves as a template for building framework algorithms
2017-12-08 10:07:53 -05:00