Skip to content

Reset the IntradayVwap running sums - #9705

Merged
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
mkzung:bug-9703-intraday-vwap-reset
Aug 14, 2026
Merged

Reset the IntradayVwap running sums#9705
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
mkzung:bug-9703-intraday-vwap-reset

Conversation

@mkzung

@mkzung mkzung commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

IntradayVwap never overrode Reset(), so _sumOfVolume, _sumOfPriceTimesVolume and _lastDate survived it. Since IsReady is _sumOfVolume > 0, the indicator reported itself ready straight after a reset, and a replay inside the same session blended the previous volume into the average.

Closes #9703

Related Issue

#9703

Motivation and Context

TestHelper.AssertIndicatorIsInDefaultState asserts IsFalse(indicator.IsReady) and CommonIndicatorTests.ResetsProperly calls it for every indicator that has a test class. IntradayVwap had none, so the check that would have caught this has never run against it.

Requires Documentation Change

No.

How Has This Been Tested?

Added Tests/Indicators/IntradayVwapTests.cs with three tests: the default state after a reset, a replay reproducing the same values, and a same-session reset matching a fresh instance. All three fail with the override removed and pass with it.

@Martin-Molinero
Martin-Molinero merged commit 04c2a35 into QuantConnect:master Aug 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IntradayVwap does not reset its running sums

2 participants