Skip to content

Keep the first history point of a canonical download - #21

Merged
Martin-Molinero merged 1 commit into
masterfrom
bug-20-keep-first-history-point
Nov 12, 2026
Merged

Martin-Molinero merged 1 commit into
masterfrom
bug-20-keep-first-history-point

Conversation

@Martin-Molinero

Copy link
Copy Markdown
Member

Description

IQFeedDataDownloader.GetCanonicalSymbolHistory called Any() on the BlockingCollection's consuming enumerable, which removed the first history point and dropped it. It now returns Lean's GetConsumingEnumerableOrNull() (QuantConnect/Lean#10100): null when no contract returned history, otherwise every point, the first one included.

Related Issue

Closes #20

Motivation and Context

Every non-empty canonical download lost one history point, and a download with a single point returned an empty, non-null result.

Requires Documentation Change

No.

How Has This Been Tested?

  • Built against Lean 2.5.18257, the first release with the helper. The 2.5.* package references resolve to it, so no project file changes.
  • dotnet test on the test assembly, as CI runs it: 4 failed, 1 skipped. The same 4 LookUpSymbols tests fail on master here: their OneTimeSetUp validates a QuantConnect subscription ("Invalid api user id or token"), and I had no credentials locally.
  • Not run: the canonical download tests are in an [Explicit] fixture that needs IQFeed credentials. No offline regression test was added either, because the per-contract history comes from IQFeedFileHistoryProvider directly and can't be stubbed without changing the downloader.
  • The helper's tests are in Lean (Add GetConsumingEnumerableOrNull for blocking collections Lean#10100): every item for 1, 2 and 6 items, null when there are none, and a producer that adds items later.

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>

🤖 Generated with Claude Code

IQFeedDataDownloader.GetCanonicalSymbolHistory called Any() on the consuming enumerable of its BlockingCollection,
which removed the first history point and dropped it. Return Lean's
GetConsumingEnumerableOrNull() instead: null when no contract returned history, otherwise
every point, the first one included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Martin-Molinero
Martin-Molinero merged commit fdabdc6 into master Nov 12, 2026
0 of 2 checks passed
@Martin-Molinero
Martin-Molinero deleted the bug-20-keep-first-history-point branch November 12, 2026 16:13
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.

Canonical downloads discard the first history point

1 participant