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

Closes #6984.

Description

Adds a benchmark-reference mode to LeastSquaresMovingAverage so LSMA can regress a target symbol against a reference symbol instead of only regressing target values against a fixed time index.

This adds:

  • LeastSquaresMovingAverage(string name, Symbol referenceSymbol, int period) and LeastSquaresMovingAverage(Symbol referenceSymbol, int period) constructors
  • QCAlgorithm.LSMA(Symbol symbol, Symbol reference, int period, ...) helper overload
  • paired target/reference timestamp handling so the indicator works whether the target or reference update arrives first
  • tests for target-first updates, reference-first updates, timestamp matching, and reset behavior

Related Issue

Closes #6984

Motivation and Context

Maintainer guidance requested a Symbol reference overload for LSMA. A previous PR for this issue was closed with concerns around paired-symbol time handling; this implementation waits for matching target/reference timestamps before adding a regression sample.

How Has This Been Tested?

  • dotnet build Tests\QuantConnect.Tests.csproj --no-restore --verbosity minimal
  • dotnet test Tests\QuantConnect.Tests.csproj --no-build --no-restore --filter "FullyQualifiedName~QuantConnect.Tests.Indicators.LeastSquaresMovingAverageTests" --logger "trx;LogFileName=feature6984-lsma.trx" --logger "console;verbosity=normal" (local test host aborts during test setup with Python.NET GIL finalizer error before executing tests)

Types of Changes

  • New feature
  • Tests

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.

Extend LeastSquaresMovingAverage to Accept a Benchmark

2 participants