Commit Graph

22 Commits

Author SHA1 Message Date
Martin Molinero 47b5178c0b Reduce Result packet number and size
- Reduce ResultHandler amount of packets sent and their size.
- Only send order and orderEvents packet if there is actually data in them.
- Don't send Holdings fields if value is 0
- Don't send AlphaRuntimeStatistics fields if default values
2020-04-20 10:03:59 -03:00
Michael Handschuh 033c1d3eab Remove double Invariant
Looks like some copy/pasta when initially implementing invariant culture
enforcement. This change simply removes an extra Invariant(...) call
since the one line has them doubled up.
2019-09-30 12:30:26 -04:00
Michael Handschuh d709d1c4e0 Update Common to respect CA1304 and CA1305
Updates all occurrences of parsing/ToString-ing to go through the new
StringExtensions methods that use CultureInfo.InvariantCulture

See #3045
2019-09-12 14:13:24 -04:00
Martin Molinero a79cc16b03 Add Kelly Criterion values
- New `KellyCriterionManager` will be used by the
`StatisticsInsightManagerExtension` to calculate and update the
`AlphaRuntimeStatistics` with the new Kelly Criterion values, on a daily
basis.
2019-07-26 19:16:36 -03:00
Martin Molinero 168fb98e20 Fix Turnover Ratio for Futures/CFDs
- `Futures` and `CFDs` sales value will use `ContractMultiplier` as the
rest of the securities.
- `FitnessScore` values will be truncated, not rounded, to 3 decimal places.
- Reducing code duplication for calculating the
`CompoundingAnnualPerformance`
2019-06-06 20:06:54 -03:00
Martin Molinero 761974ab5a PortfolioTurnover will use whole backtest (not last rolling year) 2019-06-03 15:15:50 -03:00
Martin Molinero 61db544817 Address reviews 2019-06-03 15:10:19 -03:00
Martin Molinero 61bab7439b Address reviews 2019-06-03 15:10:18 -03:00
Martin Molinero c015d4ca1f Add Fitness Score
- Adding new `FitnessScore`, score of the strategys performance, and
suitability for the Alpha Stream Market
2019-06-03 15:10:18 -03:00
Stefano Raggi 4723301821 Fix AlphaRuntimeStatistics deserialization and missing null check 2019-01-23 20:05:08 +01:00
Martin Molinero 75ffa300f1 Adding new IAlgorithm.AccountCurrency
- Adding new `IAlgorithm.AccountCurrency { get; }` that will point to the
`Portfolio.CashBook.AccountCurrency`. Setter will be added in a
following PR.
- Base `Brokerage` class will now have a `AccountCurrency { get }`
pointing to the `IAccountCurrencyProvider`. Will be used by the different
brokerages implementations.
2018-12-10 11:59:02 -03:00
Michael Handschuh 3e4723593f Fixes bug deserializing alpha runtime statistics
Computed property wasn't being set causing issues downstream.
This change addresses this exact case when _daysCompleted is zero.
2018-07-06 01:08:10 -04:00
Michael Handschuh f865355be8 Fixes BasicTemplateFrameworkAlgorithm regression
Alpha runtime stats were updated to include a normalized monthly value,
but the dictionary of results wasn't kept consistent. This change updates
the dictionary of statistics to include both the monthly and accumulated
values as well as updates to the regression statistics to verify these
values.
2018-03-23 16:12:03 -04:00
Jared Broad 882b474446 Zero check period for beginning of backtest 2018-03-23 09:45:10 -04:00
Jared Broad 3cff736cae Remove unused variable end date from the range set. 2018-03-23 09:27:52 -04:00
Jared Broad f840f4cdb5 Removed unused total period variable for monthly alpha value 2018-03-22 18:35:24 -04:00
Jared Broad c7f2e2cf21 Tweaked alpha value to be monthly instead of accumulating for ever 2018-03-22 18:33:52 -04:00
Michael Handschuh aeff8b5a6f Updates statistics keys per Alpha->Insight rename 2018-03-15 15:06:19 -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 69d3a10a93 Decompose DefaultAlphaHandler into IAlphaManagerExtension
The IAlphaManagerExtension defines a type that needs to react to events produced
by the AlphaManager. The actual events were removed in favor of a interface to
handle the events. This removes the need to wire events and instead just pass the
extensions to the alph manager and it will handle invoking the extensions at the
appropriate time.

This change removes all charting and statistics aggregation logic from the alpha
handler and moves it into dedicated types, AlphaChartingManagerExtension and
AlphaStatisticsManagerExtension. The resulting types are highly decoupled from the
LEAN ecosystem allowing them to be easily unit tested, whereas before the logic
was embedded in a handler with many many dependencies which would be very hard to
properly unit test.

As part of this change (and in preparation for moving scoring to the alpha thread)
the resolution of SecurityValues was removed from the alpha manager. In this new
pattern, the alpha manager is pushed generated alphas and security values at each
time step.
2018-01-12 12:08:40 -05:00
Michael Handschuh cfea54aecd Fixes average estimated value and delays avg score sampling 2017-12-28 12:24:59 -05:00
Michael Handschuh 2295e524f4 Add IAlphaRuntimeStatisticsGenerator and send to result handler
Provides estimates of alpha value as well as performs online computations of
alpha scores and other KPIs.

Sends alpha stats to result handler
Update live result with framework flag
2017-12-20 08:33:30 -05:00