Skip to content

Reset the MidPrice rolling extremes - #9694

Merged
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
mkzung:bug-9693-midprice-reset
Aug 13, 2026
Merged

Reset the MidPrice rolling extremes#9694
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
mkzung:bug-9693-midprice-reset

Conversation

@mkzung

@mkzung mkzung commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

MidPrice never overrode Reset(), so its Maximum and Minimum carried the previous run.

Related Issue

Closes #9693

Motivation and Context

The first bars after a reset were computed from data outside the window. Same class as #9686, #9687 and #9688.

Requires Documentation Change

No.

How Has This Been Tested?

Added ProducesTheSameValuesAfterReset to MidPriceTests, in the shape used in ConnorsRelativeStrengthIndexTests and SuperTrendTests. It fails on master and passes with the override.

Also ran the indicator against Tests/TestData/spy_midprice.txt on a master build and on this one: 496 expected MIDPRICE_5 values, no mismatches either way, so nothing outside the reset path moves.

My local NUnit host crashes on a Python.NET finalizer during test discovery, unrelated to this change, so both runs above were done from a console program linked against each build rather than through dotnet test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

@Martin-Molinero Martin-Molinero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mkzung!

@Martin-Molinero
Martin-Molinero merged commit e3e05d4 into QuantConnect:master Aug 13, 2026
7 of 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.

MidPrice does not reset its rolling maximum and minimum

2 participants