Skip to content

Update IndicatorHistory with the bar type its registered indicator consolidates - #10205

Open
quantconnect-kronos[bot] wants to merge 5 commits into
masterfrom
kronos/bug-10141-indicator-history-data-type
Open

quantconnect-kronos[bot] wants to merge 5 commits into
masterfrom
kronos/bug-10141-indicator-history-data-type

Conversation

@quantconnect-kronos

@quantconnect-kronos quantconnect-kronos Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #10141

What changed

IndicatorHistory over slices, when no selector implies a data type, pushed each symbol's default slice value (slice[symbol]). For a security with both trade and quote data, such as a future, that value can be a QuoteBar, while the indicator registered for live updates consolidates trade bars, so history and live values differed.

Now, when IndicatorHistory gets no selector and the indicator takes IndicatorDataPoint or an abstract input type, a slice that holds both a TradeBar and a QuoteBar for a symbol updates that symbol with the bar of the tick type the indicator consolidates (the quote bar for TickType.Quote, else the trade bar), resolved once per symbol:

  • the tick type of the subscription the indicator is registered on for that symbol: the subscription whose Consolidators holds one of indicator.Consolidators (SubscriptionManager.AddConsolidator puts it there). This covers helper-created indicators and indicators registered with a trade or a quote consolidator, on bar or tick subscriptions (such as a TickQuoteBarConsolidator on the quote tick subscription), whatever the slice's data order;
  • for an unregistered indicator, the tick type registering it would use: the symbol's subscription, picked like RegisterIndicator/ResolveConsolidator (TryGetSubscription, trades over quotes), or, with no subscription, the first of the security type's default data types, ordered the same way, as WarmUpIndicator already does (that ordering moved into GetDefaultSubscriptionDataType, now shared by both);
  • quote bars for the option contracts of an unregistered option indicator, as InitializeOptionIndicator registers them.

Behavior changes, for symbols whose slices hold both trade and quote bars:

  • IndicatorHistory without a selector, on a new or a registered indicator;
  • WarmUpIndicator(symbol(s), indicator, resolution, selector) without a selector, which goes through IndicatorHistory. That includes the automatic warm-up of helper-created indicators. A new or helper-created indicator warmed up on a future now gets trade bars, matching its live updates.

Unchanged, keeping master's behavior through PushThrough's default-value path:

  • slices with a single bar type, ticks and custom data;
  • any selector passed by the caller, such as x => ((QuoteBar)x).Bid.Close (selectors that imply a type, such as Field.BidClose, still use that type);
  • indicators with a concrete input type such as TradeBar or QuoteBar.

Review history

  • ec0d77e updated each symbol only with its resolved bar type, which dropped ticks and custom data. 9f04aac fixed that by applying the type only as the tie-break between a trade and a quote bar in the same slice.
  • 9f04aac replaced inputs callers had chosen: custom quote selectors and quote-registered indicators got trade bars. da0ddd9 skipped the tie-break for a selector or a registered indicator.
  • Skipping registered indicators left the reported case unfixed: helper-created indicators and their warm-up. 506bcf5 reads the subscription each indicator is registered on instead. That answers the open question da0ddd9 raised, as the review asked.
  • 506bcf5 used the registered subscription's data type, which is Tick for a tick subscription, so an indicator on the quote tick subscription got trade bars. 756b69a picks the bar by the subscription's TickType instead.

Tests

  • New AlgorithmIndicatorsTests:
    • IndicatorHistoryUsesTradeBarsWhenSliceAlsoHasQuoteBars (with and without the future added): the issue's reproduction, an SMA and an ATR, now computed from the trade closes (100, 101, 102). Fails on master (gets the quote closes 200, 201, 202).
    • IndicatorHistoryUsesTradeBarsOfIndicatorRegisteredByHelper (quote bar last and first in the slice): a helper-created SMA gets the trade closes. Quote-last fails on master and da0ddd9.
    • IndicatorHistoryUsesQuoteBarsOfIndicatorRegisteredWithQuoteConsolidator (quote bar last and first): the quote closes. Quote-first fails on master and da0ddd9; quote-last fails on 9f04aac.
    • IndicatorHistoryUsesQuoteBarsOfIndicatorRegisteredOnQuoteTicks (quote bar last and first): an SMA registered with a TickQuoteBarConsolidator on a tick-subscribed future gets the quote closes. Both fail on 506bcf5.
    • IndicatorHistoryKeepsQuoteBarsForCustomQuoteSelectors (x => ((QuoteBar)x).Bid.Close, x => Field.BidClose(x)): quote values, as on master. Fails on 9f04aac.
    • IndicatorHistoryUsesQuoteBarsWhenSelectorRequiresThem: Field.BidClose still uses quotes.
    • IndicatorHistoryUsesQuoteBarsForQuoteOnlySecurities: a forex symbol still gets its quote bars.
    • IndicatorHistoryUsesTicks (SPY subscribed at minute resolution, and an unsubscribed equity) and IndicatorHistoryUsesCustomDataWithoutSubscription (an unsubscribed SecurityType.Base symbol): 3 rows each, as on master. They fail on ec0d77e.
  • The existing option indicator history tests (IndicatorUpdatedWithSymbol, IndicatorHistoryIsSupportedInPythonForOptionsIndicators) cover the option contracts getting quote bars.
  • Local runs on 756b69a, Release build:
    • unit tests (TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests&TestCategory!=RegressionTests): Passed! - Failed: 0, Passed: 39834, Skipped: 100
    • regression tests, 4 shards: Passed! - Failed: 0 on each shard
    • research regression tests: Passed! - Failed: 0, Passed: 5
  • Tested end to end on 756b69a with a backtest over 2024-01-02 to 2024-01-04 on a continuous ES future at minute resolution. Each history was compared with a snapshot of the live indicator's values over their shared timestamps:
    • IndicatorHistory(RateOfChange(1), ...) against the helper-created ROC(1): 0 of 899 differ (847 on master).
    • IndicatorHistory on the helper-created ROC(1) instance itself: 0 of 899 differ (847 on master and da0ddd9).
    • A RateOfChange(1) registered with a quote consolidator, on itself: 0 of 899 differ.
    • IndicatorHistory(SimpleMovingAverage(1), ..., lambda x: x.bid.close) against a bid-close SMA registered with a quote consolidator: 0 of 900 differ, with no exception.
    • A tick-resolution IndicatorHistory(SimpleMovingAverage(1), SPY, ..., Resolution.Tick) with SPY subscribed at minute resolution: 5549 rows, the same as master.

…nsolidates

When no selector implies a data type, IndicatorHistory fed each symbol the
slice's default value, which can be a quote bar for a security with both
trade and quote data, such as a future, while the registered indicator
consolidates trade bars. Each symbol now gets the bar type of its
subscription, which prefers trades, or of the default subscription types
when it has none, and an option indicator's contracts get quote bars, as
registering the indicator does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quantconnect-kronos quantconnect-kronos Bot added kronos:develop:working develop: in progress kronos:review Request review labels Nov 18, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued kronos:review:working review: in progress and removed kronos:review Request review kronos:review:queued review: queued labels Nov 18, 2026

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the clear write-up and the issue's reproduction as a test. The futures case is fixed, but the change breaks histories that work on master. I'm requesting changes.

Tick and custom-data histories now produce no indicator values (blocking). The type each symbol gets comes from its subscription, or from the security type's defaults when it has none. Both of those resolve to TradeBar or QuoteBar even when the history in hand holds other data. The symbol then gets updated only from slice.Bars/slice.QuoteBars, so data of any other type is dropped without an error. I reproduced this locally with IndicatorHistory(new SimpleMovingAverage(1), slices). Each case returns 3 rows on master and 0 on this branch:

  • SPY added at minute resolution (the default), slices holding only Ticks. Users reach this through IndicatorHistory(sma, spy, 100, Resolution.Tick), since the history request returns ticks while the subscription's type is TradeBar.
  • An equity symbol that isn't subscribed, with tick slices.
  • An unsubscribed SecurityType.Base symbol with custom BaseData slices, such as a custom-data history request without AddData.

The cause is that the subscription's type decides what the slice can provide, not only which type to prefer. The issue's case only comes up when a slice has both a TradeBar and a QuoteBar for a symbol. A smaller change would use the resolved type only as the tie-break in that case and keep master's default value otherwise. Ticks, custom data and single-type slices would then behave as on master. The default-value extraction is also a copy of SliceExtensions.PushThrough's null-type branch. Reshaping the change this way may let you reuse that code instead.

Tests. The new tests only cover slices with bars. Please add the cases above (ticks for a minute-subscribed symbol, and custom data without a subscription) so the fix is shown not to drop them.

Other notes

  • CI is green on ec0d77e.
  • The description has an end-to-end outcome (0 of 899 timestamps differing on a continuous ES future). Please re-run it after the change, and add a tick-resolution history to that run.
  • No other repositories need an update: the public API signatures are unchanged.

Risk: risk:high. This changes the values a public algorithm API returns, and in its current form it drops data that master uses, so it can give users wrong (empty) results.

Comment thread Algorithm/QCAlgorithm.Indicators.cs Resolved
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added risk:high High risk and removed kronos:review:working review: in progress labels Nov 18, 2026
…story

Resolving the bar type from the subscription dropped data the history
held of other types, such as ticks or custom data. The resolved type now
only picks between a symbol's trade and quote bars when a slice has both,
and every other value is pushed as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quantconnect-kronos

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I've addressed it in 9f04aac:

  • Ticks and custom data no longer dropped. The resolved bar type now only breaks the tie when a slice has both a TradeBar and a QuoteBar for a symbol. Every other value goes through SliceExtensions.PushThrough's default-value path, as on master. The copied extraction code is gone.
  • Tests added for the reported cases: IndicatorHistoryUsesTicks (ticks for SPY subscribed at minute resolution, and for an unsubscribed equity) and IndicatorHistoryUsesCustomDataWithoutSubscription (custom data for an unsubscribed SecurityType.Base symbol). Each returns 3 rows. They fail on ec0d77e.
  • End-to-end re-run. The ES comparison still has 0 of 899 timestamps differing from the live indicator (847 on master). A tick-resolution history for minute-subscribed SPY returns 5549 rows, the same as master.
  • Full suites pass locally: unit, regression (4 shards) and research regression.

The description has the details.

@quantconnect-kronos quantconnect-kronos Bot added the kronos:review Request review label Nov 18, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued kronos:review:working review: in progress and removed kronos:review Request review kronos:review:queued review: queued labels Nov 18, 2026
@quantconnect-kronos-reviewer
quantconnect-kronos-reviewer Bot marked this pull request as ready for review November 18, 2026 17:49

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the quick turnaround. 9f04aac resolves everything from my last review, so I'm approving.

Earlier findings

  • Ticks and custom data were dropped: resolved. The resolved type is now used only when a slice has both a TradeBar and a QuoteBar for the symbol. Every other value goes through PushThrough's default-value path, as on master. Ticks, custom data and single-type slices behave as before, and the copied extraction code is gone.
  • Tests: resolved. IndicatorHistoryUsesTicks (subscribed and unsubscribed) and IndicatorHistoryUsesCustomDataWithoutSubscription cover the cases I reported.
  • End-to-end: resolved. The re-run on 9f04aac still shows 0 of 899 differing timestamps for ES, against 847 on master. The tick-resolution SPY history returns the same row count as master.

What I checked on this commit

  • Moving the dataType != null branch first doesn't change any path. dataType is only non-null from the IndicatorBase<IndicatorDataPoint> overload (GetDataTypeFromSelector), which master also sent to PushThrough(dataType).
  • The tie-break matches registration. TryGetSubscription orders by tick type, so trades win over quotes, as in ResolveConsolidator. InitializeOptionIndicator registers option contracts with QuoteBar and the underlying with its subscription's type, which is what the option branch does. A non-option indicator on an option contract gets trades, as RegisterIndicator would give it.
  • GetDefaultSubscriptionDataType is a straight extraction of the WarmUpIndicator code, and its behavior there is unchanged.
  • CI: all checks pass on 9f04aac. API Tests were skipped, as usual for this repository.
  • No other repositories need an update: no public signatures changed.

Risk: risk:high. This is a bug fix, and it leaves single-type, tick and custom-data histories as they were. But it changes the values IndicatorHistory returns for every symbol whose history has both trade and quote bars: futures, and also equities, crypto and options at intraday resolutions. That is a public algorithm API with wide reach. The ES run shows most rows changing on master's data (847 of 899), so users comparing against earlier histories will see different numbers. A person should merge it knowing that.

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot removed the kronos:review:working review: in progress label Nov 18, 2026
@quantconnect-kronos quantconnect-kronos Bot added the kronos:review Request review label Nov 18, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued and removed kronos:review Request review labels Nov 18, 2026
@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot added kronos:review:working review: in progress and removed kronos:review:queued review: queued labels Nov 18, 2026

@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes on 9f04aac: the default futures case is fixed, and the earlier tick/custom-data regression is resolved, but the new tie-break also overrides explicit quote inputs that work on master.

Blocking finding — preserve explicit quote inputs. An indicator registered with a quote consolidator now gets trade prices during IndicatorHistory. Custom quote selectors also receive trade bars: a wrapped Field.BidClose silently produces trade closes, and a selector casting to QuoteBar throws. These share one cause: an unresolved dataType is treated as permission to replace the caller's input with the symbol's default subscription type. The inline comment has the base-versus-head reproduction. Please preserve explicit selector/consolidator choices and add regression coverage for both.

Validation

  • All 71 AlgorithmIndicatorsTests passed locally with dotnet test Tests/QuantConnect.Tests.csproj -c Release --filter FullyQualifiedName~QuantConnect.Tests.Algorithm.AlgorithmIndicatorsTests.
  • CI passes on this head; API Tests were skipped.
  • Tested end to end over January 2–4, 2024, with 1,349 shared ES minute timestamps: default ROC history improves from 1,279 mismatches to zero, but explicitly quote-registered ROC history regresses from zero mismatches to 1,279. The custom bid selector returns 450 rows before the change and throws after it. Tick-resolution SPY indicator history returns the same 11,123 rows before and after.
  • No dependent repository or generated API update is needed; the correction belongs in the shared IndicatorHistory implementation.

Risk: risk:high retained. This version changes working quote-based histories to wrong prices or exceptions. Preserving those paths and covering them with tests is necessary before approval.

Comment thread Algorithm/QCAlgorithm.Indicators.cs Resolved
@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot removed the kronos:review:working review: in progress label Nov 18, 2026
The trade and quote tie-break replaced the input a caller chose: a custom
selector reading quote fields got trade bars, or threw when it cast to a
quote bar, and an indicator registered with a quote consolidator got trade
prices. The tie-break now applies only to an indicator without a selector
or registered consolidators; any other keeps the slice's default value,
as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quantconnect-kronos

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I've addressed the requested changes in da0ddd9:

  • Explicit inputs are kept. The trade/quote tie-break now applies only when IndicatorHistory gets no selector and the indicator has no registered consolidators. A custom selector (x => ((QuoteBar)x).Bid.Close, x => Field.BidClose(x)) or an indicator registered with a quote consolidator keeps the slice's default value, as on master. Ticks, custom data and single-type slices also behave as on master, as they did on 9f04aac.
  • Tests: IndicatorHistoryKeepsQuoteBarsOfIndicatorRegisteredWithQuoteConsolidator and IndicatorHistoryKeepsQuoteBarsForCustomQuoteSelectors return the quote values. Both fail on 9f04aac.
  • End-to-end on ES, Jan 2–4 2024, compared with the live indicators:
    • default IndicatorHistory(RateOfChange(1), ...): 0 of 899 differ (847 on master);
    • quote-registered RateOfChange: 0 of 900 differ;
    • custom bid selector: 0 of 900 differ, no exception;
    • tick-resolution SPY history: same 5549 rows as master.
  • Full suites pass locally: unit, regression (4 shards) and research regression.

Open question for a maintainer: IndicatorHistory on an indicator a helper already registered, such as the instance ROC(symbol, ...) returns, keeps master's behavior. On the same ES data, 847 of 899 of its history values still come from quote bars. Widening the fix would mean reading the input type of the indicator's registered consolidator for each symbol. Should this pull request keep that limitation, or widen to registered indicators? The question is also in the description.

@quantconnect-kronos
quantconnect-kronos Bot marked this pull request as draft November 18, 2026 18:30

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes on da0ddd9. Explicit selectors and quote-registered indicators now keep their inputs, which resolves the other reviewer's finding. But skipping every registered indicator leaves the case the issue reports unfixed.

The registered indicator still gets quote bars (blocking). The issue asks that IndicatorHistory update "the same indicator, registered for live updates" with the type RegisterIndicator consolidates for it. indicator.Consolidators.Count > 0 sends every registered indicator back to master's default value. That covers the common paths:

  • IndicatorHistory on a helper-created indicator such as ROC(symbol, 1). Your own end-to-end run shows 847 of 899 values still differing from live.
  • Automatic warm-up: InitializeIndicator registers the indicator before it calls WarmUpIndicator, which goes through this method. A helper indicator on a future is still warmed up with quote bars and then updated live with trade bars.

This has the same cause as the earlier finding. The code guesses the type from the subscription instead of reading what the indicator is actually registered with. So, to your open question: I think the wider fix is in scope, because it is what the issue asks for, and it's also simpler. For a symbol whose subscription's Consolidators holds one of indicator.Consolidators, use that subscription's type (SubscriptionManager.AddConsolidator adds the consolidator there). Fall back to today's resolution only when there's no such subscription. One rule then covers trade-registered, quote-registered and unregistered indicators, and the Consolidators.Count > 0 exclusion goes away. The quote-registered case also stops depending on the order of the slice's data. Today IndicatorHistoryKeepsQuoteBarsOfIndicatorRegisteredWithQuoteConsolidator passes only because the slices add the quote bar last. Please add a test for an indicator registered through a helper, or with a trade consolidator, getting trade values. Keep the explicit-selector rule as it is.

Description. WarmUpIndicator(symbol, indicator, resolution) also goes through this path, so a fresh indicator warmed up on a future now gets trade bars. Please list that among the behavior changes.

Risk: risk:high stays. This changes the values a public algorithm API and indicator warm-up return for every symbol that has both trade and quote bars.

Comment thread Algorithm/QCAlgorithm.Indicators.cs Resolved
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot removed the kronos:review:working review: in progress label Nov 18, 2026
Skipping every registered indicator left the reported case unfixed: an
indicator created by a helper, or warmed up after its registration, still
got the slice's default quote bars where it consolidates trade bars live.
When a slice has both bars for a symbol, the indicator now gets the type
of the subscription holding one of its consolidators, and only an
unregistered indicator falls back to the type registering it would use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quantconnect-kronos

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I've addressed it in 506bcf5:

  • Registered indicators read their own subscription. The Consolidators.Count > 0 exclusion is gone. When a slice has both a trade and a quote bar for a symbol, the indicator gets the type of the subscription that holds one of its consolidators. Only an unregistered indicator falls back to the earlier resolution (subscription or default types, quotes for an option indicator's contracts). Helper-created indicators and their automatic warm-up now get trade bars on a future. A quote-registered indicator gets quote bars whatever the slice's data order. The explicit-selector rule is unchanged.
  • Tests:
    • New IndicatorHistoryUsesTradeBarsOfIndicatorRegisteredByHelper (an SMA helper) checks the helper case.
    • IndicatorHistoryUsesQuoteBarsOfIndicatorRegisteredWithQuoteConsolidator (renamed from IndicatorHistoryKeepsQuoteBarsOfIndicatorRegisteredWithQuoteConsolidator) now runs with the quote bar first and last.
    • One case of each fails on da0ddd9.
  • Description: lists the warm-up change (WarmUpIndicator(symbol, indicator, resolution) and automatic warm-up), and records that this answers the open question.
  • End-to-end on ES, Jan 2–4 2024, each history compared with a snapshot of its live values:
    • fresh RateOfChange(1): 0 of 899 differ;
    • the helper-created ROC(1) instance itself: 0 of 899 (847 on da0ddd9);
    • quote-registered RateOfChange: 0 of 899;
    • custom bid selector: 0 of 900;
    • tick-resolution SPY history: 5549 rows, as on master.
  • Correction: last round's "quote-registered 0 of 900" compared against live values that IndicatorHistory itself had just overwritten through the registered instance's Updated handler, so it proved nothing. This round snapshots the live values first; that clean comparison gives 0 of 899.
  • Full suites pass locally: unit, regression (4 shards) and research regression.

@quantconnect-kronos quantconnect-kronos Bot added the kronos:review Request review label Nov 18, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued kronos:review:working review: in progress and removed kronos:review Request review kronos:review:queued review: queued labels Nov 18, 2026

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes on 506bcf5. Reading the subscription the indicator is registered on resolves my last finding: helper-created indicators and their automatic warm-up now get trade bars on a future, and a quote-registered indicator gets quote bars whatever the slice order. The explicit-selector rule is unchanged. One case of the new lookup still gives the wrong bar type.

An indicator that consolidates quote ticks gets trade bars (blocking). The new branch uses registeredSubscription.Type, which is Tick for a tick subscription. The final barType == typeof(QuoteBar) ? quoteBar : tradeBar then sends trade bars to an indicator registered on the quote tick subscription. I reproduced it locally: a future added at Resolution.Tick, an SMA registered with new TickQuoteBarConsolidator(TimeSpan.FromHours(1)) (it lands on the Tick/Quote subscription), then IndicatorHistory(sma, slices) over slices that hold both bars.

  • This branch returns the trade closes 100, 101, 102 in both slice orders.
  • Master returns the quote closes 200, 201, 202 when the quote bar is last, which is the order real future history comes in (your end-to-end run shows master's default value is the quote bar). So this is a regression for that setup.

The subscription's TickType says which bar it consolidates for both tick and bar subscriptions (TradeBar→Trade, QuoteBar→Quote). Picking the bar by registeredSubscription.TickType == TickType.Quote fixes this case and leaves the others as they are. Please add a test for it next to IndicatorHistoryUsesQuoteBarsOfIndicatorRegisteredWithQuoteConsolidator.

What I checked on this commit

  • ConcurrentSet.Overlaps takes the set's lock, so reading config.Consolidators is safe against the data feed. The lookup runs once per symbol and is cached.
  • The Python RegisterIndicator path puts the same consolidator instance (wrapper) in indicator.Consolidators and in the subscription, so the lookup finds it.
  • A trade-tick registration, the default for helpers on a tick-subscribed future, correctly gets trade bars.
  • CI passes on 506bcf5. API Tests were skipped, as usual for this repository.

Risk: risk:high stays. This changes the values a public algorithm API and indicator warm-up return for every symbol whose history has both trade and quote bars.

Comment thread Algorithm/QCAlgorithm.Indicators.cs Resolved
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot removed the kronos:review:working review: in progress label Nov 18, 2026
…istory

An indicator registered on a quote tick subscription, such as with a tick
quote bar consolidator, got trade bars: the subscription's type is Tick,
which isn't a quote bar. The bar is now picked by the subscription's tick
type, which holds for bar and tick subscriptions alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quantconnect-kronos

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I've addressed it in 756b69a:

  • Quote ticks get quote bars. The per-symbol lookup now resolves a TickType instead of a data type: the registered subscription's TickType, the unregistered fallback's (TryGetSubscription or the default types), or Quote for an option indicator's contracts. The quote bar is used for TickType.Quote, otherwise the trade bar. This holds for bar and tick subscriptions alike.
  • Test: IndicatorHistoryUsesQuoteBarsOfIndicatorRegisteredOnQuoteTicks, next to the quote-consolidator test, registers an SMA with a TickQuoteBarConsolidator on a tick-subscribed future. It returns the quote closes with the quote bar both last and first, and fails on 506bcf5 in both orders.
  • End-to-end re-run on ES, Jan 2–4 2024, compared with snapshots of the live values:
    • fresh, helper-created and quote-registered RateOfChange: 0 of 899 differ each;
    • custom bid selector: 0 of 900 differ;
    • tick-resolution SPY history: 5549 rows, as on master.
    • The quote-tick case is covered by the unit test only, not by the end-to-end run.
  • Full suites pass locally: unit, regression (4 shards) and research regression.

The description is updated to match.

@quantconnect-kronos quantconnect-kronos Bot added the kronos:review Request review label Nov 18, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued kronos:review:working review: in progress and removed kronos:review Request review kronos:review:queued review: queued labels Nov 18, 2026
@quantconnect-kronos-reviewer
quantconnect-kronos-reviewer Bot marked this pull request as ready for review November 18, 2026 20:23

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approving 756b69a. It resolves my last finding, and I found nothing new.

Quote ticks: resolved. The bar is now picked by the subscription's TickType, so an indicator registered on the quote tick subscription (such as with a TickQuoteBarConsolidator) gets quote bars. For bar subscriptions this gives the same result as the previous type check (TradeBar→Trade, QuoteBar→Quote). The unregistered fallbacks (TryGetSubscription, GetDefaultSubscriptionDataType(...).Item2) still prefer trades, as RegisterIndicator does. I checked locally: all 78 AlgorithmIndicatorsTests pass on this commit, and IndicatorHistoryUsesQuoteBarsOfIndicatorRegisteredOnQuoteTicks fails in both slice orders with 506bcf5's QCAlgorithm.Indicators.cs.

Risk: risk:high stays. This is a bug fix, but it changes the values a public algorithm API and indicator warm-up return for every symbol whose history has both trade and quote bars (futures, and intraday equities, crypto and options). A person should merge it knowing that.

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot removed the kronos:review:working review: in progress label Nov 18, 2026
@quantconnect-kronos quantconnect-kronos Bot added the kronos:review Request review label Nov 18, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued and removed kronos:review Request review labels Nov 18, 2026
@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot added kronos:review:working review: in progress and removed kronos:review:queued review: queued labels Nov 18, 2026

@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approving. My explicit quote-input finding is resolved: custom selectors keep their original path, and registered indicators use their own subscription's TickType, including quote-tick registrations.

I reran all 78 AlgorithmIndicatorsTests; all passed. I also tested end to end over January 2–4, 2024, comparing history against snapshots of live indicator values:

  • Fresh and helper-created ES ROC: 0 of 899 shared values differ for each, versus 847 before the change.
  • Quote-registered ROC: 0 of 899 differ.
  • Explicit bid-close selector: 0 of 900 differ, with no exception.
  • Tick-resolution SPY history with a minute subscription: 11,123 rows before and after.

A separate two-symbol probe, registered for trades on one symbol and quotes on the other, also matches direct updates. No new blocking finding.

@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot removed the kronos:review:working review: in progress label Nov 18, 2026
@quantconnect-kronos quantconnect-kronos Bot added kronos:develop:idle develop: paused and removed kronos:develop:working develop: in progress labels Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kronos:develop:idle develop: paused risk:high High risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IndicatorHistory can feed quote bars where the live indicator gets trade bars

0 participants