Add RealizedVolatility indicator (Parkinson high-low estimator) - #9864
Open
rairishi764 wants to merge 1 commit into
Open
rairishi764 wants to merge 1 commit into
rairishi764 wants to merge 1 commit into
Conversation
rairishi764
force-pushed
the
feature-9863-realized-volatility-indicator
branch
from
October 3, 2026 01:06
b6af91c to
9972e44
Compare
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.
What this PR adds
Indicators/RealizedVolatility.cs— a new indicator implementing the Parkinson (1980) high-low range estimator of realized volatility, asBarIndicator+IIndicatorWarmUpPeriodProvider, following the same shape asRogersSatchellVolatility.Tests/Indicators/RealizedVolatilityTests.cs— extendsCommonIndicatorTests<IBaseDataBar>, comparing against an independently-computed reference CSV (Tests/TestData/spy_with_rv.csv), following the same convention asRogersSatchellVolatilityTests/spy_with_rsv.csv.Algorithm/QCAlgorithm.Indicators.cs— theRV(...)helper method, mirroringRSV(...)forRogersSatchellVolatility.Tests/QuantConnect.Tests.csproj— wires up the new test fixture CSV.What this PR does not change
Public API surface
QCAlgorithm.RV(symbol, period, resolution, selector)creates and registers it, mirroringRSV(...).Why Parkinson, and why now
LEAN has several volatility indicators (
AverageTrueRange,RogersSatchellVolatility,ImpliedVolatility, Keltner/Bollinger) but no realized volatility indicator — the standard backward-looking measure of historical price variation. Parkinson is the simplest high-low estimator (needs only High/Low, unlike Garman-Klass/Yang-Zhang which also need Open/Close), making it a clean first addition and a template for those follow-ups.Testing
dotnet buildclean onCommon,Algorithm, and the fullTestsproject (net10.0).RealizedVolatilityTests: 16/17 passing locally. The 1 failure (WarmUpIndicatorProducesConsistentResults) is a pre-existing Python runtime DLL gap in my local dev environment, not a regression — I confirmed the identical failure occurs when running the same test against the already-mergedRogersSatchellVolatilityindicator on this machine.spy_with_rv.csv) was generated independently in Python from the existingspy_with_rsv.csvOHLC data, not derived from my C# implementation.Closes #9863