Skip to content

feature: map exchange string to primary exchange on level one ticks#9488

Merged
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
Romazes:feature-level-one-quote-exchange
May 15, 2026
Merged

feature: map exchange string to primary exchange on level one ticks#9488
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
Romazes:feature-level-one-quote-exchange

Conversation

@Romazes
Copy link
Copy Markdown
Collaborator

@Romazes Romazes commented May 15, 2026

Description

Adds saleCondition and exchange parameters to LevelOneMarketData.UpdateQuote and normalizes the exchange string through GetPrimaryExchange on both UpdateQuote and UpdateLastTrade. Resulting ticks now carry the canonical primary exchange name (e.g. "T""NASDAQ", "Z""BATS") instead of the raw broker-provided code.

Related Issue

N/A

Motivation and Context

Brokerage providers send exchange identifiers as short codes (T, Z, N, P, ...). Without normalization, downstream consumers see the raw code and have to map it themselves. Centralizing the mapping at tick-construction time gives a consistent Tick.Exchange value across the engine and matches the behavior already used by UpdateLastTrade's sibling code paths.

Requires Documentation Change

No.

How Has This Been Tested?

Added a combined NUnit test in Tests/Brokerages/LevelOneOrderBook/LevelOneMarketDataTests.cs:

  • LevelOneMarketDataShouldMapExchangeStringOnPublishedTicks subscribes to BaseDataReceived and asserts the resulting Tick.Exchange for both the quote tick (UpdateQuote) and the trade tick (UpdateLastTrade).
  • Covered cases: "T""NASDAQ", "Z""BATS", "N""NYSE", "P""ARCA", """", null"".

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>

- add saleCondition/exchange overload to UpdateQuote
- normalize exchange via GetPrimaryExchange in UpdateQuote/UpdateLastTrade
- cover exchange mapping with combined test
@Romazes Romazes requested a review from Martin-Molinero May 15, 2026 14:26
@Romazes Romazes self-assigned this May 15, 2026
Copy link
Copy Markdown
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

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

Thank you!

@Martin-Molinero Martin-Molinero merged commit d2daf42 into QuantConnect:master May 15, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants