Skip to content

Extend LSMA to accept benchmark reference#9426

Open
aiSynergy37 wants to merge 1 commit intoQuantConnect:masterfrom
aiSynergy37:feature-6984-lsma-benchmark
Open

Extend LSMA to accept benchmark reference#9426
aiSynergy37 wants to merge 1 commit intoQuantConnect:masterfrom
aiSynergy37:feature-6984-lsma-benchmark

Conversation

@aiSynergy37
Copy link
Copy Markdown
Contributor

@aiSynergy37 aiSynergy37 commented Apr 21, 2026

What: Extend LeastSquaresMovingAverage to regress a target symbol against a benchmark reference symbol.

Why: Issue #6984 requested an LSMA overload that accepts a benchmark reference instead of only regressing target values against a fixed time index.

How: Added reference-symbol constructors, a QCAlgorithm.LSMA overload, matched target/reference timestamp buffering, and reference-value regression when paired samples are ready.

Edge cases handled: Target-first and reference-first updates are supported; mismatched timestamps wait for a matching pair; reset clears pending target/reference state; unexpected target symbols are rejected.

Tests added/updated: Added LSMA reference-mode tests for target-first updates, reference-first updates, timestamp matching, and reset behavior. Build validation completed for Tests/QuantConnect.Tests.csproj; focused local test execution was blocked by the existing pythonnet GIL finalizer crash before test execution.

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.

2 participants