Commit Graph

15 Commits

Author SHA1 Message Date
Martin Molinero e73e927c0f Enable parallel unit testing 2020-04-27 17:45:53 -03:00
Martin Molinero 64d43c1487 Add Insight.ReferenceValueFinal 2019-07-09 17:53:58 -03:00
Jared a2a63ae058 Merge pull request #3016 from QuantConnect/feature-3015-add-weight-to-insights
Add Insight optional Weight
2019-06-04 16:52:48 -07:00
Martin Molinero 3d52343799 Optimize stored result json
- `Alpha Assets` chart will only store last data point
- Adding new `JsonRoundingConverter` that will round to 4 (number of
digits currently used for comparing alpha statistics) fractional
digits.
   - Will be used for `Insights` and `ChartPoint`
2019-04-29 19:17:00 -03:00
Martin Molinero 7af29e3697 Add Insight Portfolio Weight
- Adding optional portfolio Weight property for `Insights`
2019-04-24 10:58:45 -03:00
AlexCatarino 5931a42d48 Implements Insight Expiry Helper
Implement a new overload to `Insight` constructor that accepts a  `Func<DateTime, DateTime>` that is used to compute the `CloseTimeUtc` and `Period` after the `Insight` object is emitted (`SetPeriodAndCloseTime` method).

Adds the static Expiry class with functions that can be used to compute a future date/time (expiry) given a date/time.

Closes #3038
2019-04-03 21:46:14 +01:00
Michael Handschuh d5f88c6bb7 Add Insight.IsActive and Insight.IsExpired methods
Easily check if an insight is active or expired
2018-08-10 13:52:17 -04: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
AlexCatarino b15cfacff2 Insight.Group retuns the original Insight array with modified Insights
Use the new return type in PairsTradingAlphaModel.
2018-05-10 16:18:07 +01:00
AlexCatarino 62adc3a24b Changes Insight.Group return type to IEnumerable<Insight> from Guid 2018-05-09 14:49:00 +01:00
Michael Handschuh 5f33d61220 Add Insight.GroupId and Insight.Group( insights )
Provides a means of grouping insights together.
This new value is serialized as 'group-id'.
2018-04-19 12:47:08 -04:00
Michael Handschuh c3c6a9aff8 Add Insight.SourceModel
This identifier is used to determine the alpha model that generated.
This is NOT ideal, since it requires users to specify the value, more
thought will be givent to how we can resolve this value automatically

Adds test for surviving roundtrip copy operation.
2018-04-17 16:36:47 -04: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
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 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