Add Rachev Ratio indicator - #9847
Open
Amadeus-22 wants to merge 1 commit into
Open
Amadeus-22 wants to merge 1 commit into
Amadeus-22 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the
RachevRatioindicator and theRACHEVhelper inQCAlgorithm.Indicators.cs.The Rachev ratio (Biglova, Ortobelli, Rachev and Stoyanov, 2004) is the expected tail return of the best outcomes divided by the expected tail loss of the worst outcomes, over a rolling window of one-period returns:
Parameters:
period(number of returns),alpha(right-tail probability, default 0.05),beta(left-tail probability, default 0.05),riskFreeRate(per period, default 0). The tail expectations use the historical estimator with fractional weighting of the boundary observation (Acerbi and Tasche, 2002), so tails such as 0.05 * 252 = 12.6 observations are handled exactly. The indicator is ready afterperiod + 1data points and returns 0 when the tail loss is zero.Related Issue
Closes #7648
Motivation and Context
Adds a reward-to-risk ratio for non-Gaussian returns, complementing
SharpeRatioandSortinoRatio.Requires Documentation Change
Yes, add the indicator to the list of supported indicators.
How Has This Been Tested?
dotnet test Tests/QuantConnect.Tests.csproj --filter "FullyQualifiedName~RachevRatio": 24 passed, 2 skipped (period 1 is rejected by the constructor in the reset contract fixture).AlgorithmIndicatorsTestsandDocumentationAttributeTestalso pass. I did not run the full suite locally.RachevRatioTestsinheritsCommonIndicatorTests<IndicatorDataPoint>and compares againstTests/TestData/spy_rachev_ratio.csvfor three parameter sets (default, alpha 0.1 / beta 0.05, risk-free rate 0.0001) within 1e-6, plus a hand-computed case, the zero tail loss case and parameter validation.skfolio.measures.cvar) on the SPY daily prices already inTests/TestData/spy_valueatrisk.csv, over a rolling 252-return window:Test data generator
Types of changes
Checklist:
feature-<issue#>-<description>