Skip to content

Feature: add ReconnectBrokerage() to QCAlgorithm for self-healing data feeds#9497

Open
violet-day wants to merge 1 commit into
QuantConnect:masterfrom
violet-day:feature-9496-reconnect-brokerage
Open

Feature: add ReconnectBrokerage() to QCAlgorithm for self-healing data feeds#9497
violet-day wants to merge 1 commit into
QuantConnect:masterfrom
violet-day:feature-9496-reconnect-brokerage

Conversation

@violet-day
Copy link
Copy Markdown

Summary

  • Adds ReconnectBrokerage() to IAlgorithm and QCAlgorithm
  • Adds SetBrokerageReconnectAction(Action) to allow the engine to inject the actual
    Disconnect/Connect logic
  • Wires the action in Engine.cs after brokerage creation
  • Implements the wrapper in AlgorithmPythonWrapper for Python algorithms
  • 4 unit tests covering: action invoked, no-op when unregistered, null guard, order of
    operations

Motivation

Closes #9496 — algorithms running in live trading (e.g. against IBKR) can detect a silently
frozen data feed (bars with Volume=0) but previously had no way to trigger a reconnect
short of calling Quit(). This API lets them self-heal without human intervention.

Notes

  • Brokerage-agnostic: the Action delegate is injected by the engine, so QCAlgorithm has
    no dependency on any concrete brokerage
  • No-op in backtesting (action is never registered, logs a debug message)

…a feeds

Exposes a ReconnectBrokerage() method on IAlgorithm/QCAlgorithm that allows
algorithms running in live trading to trigger a brokerage Disconnect/Connect
cycle when they detect data quality issues (e.g. IBKR gateway silently
freezing with volume=0 bars). The reconnect action is injected by the engine
so the algorithm layer stays decoupled from the concrete brokerage type.

Closes QuantConnect#9496
@violet-day
Copy link
Copy Markdown
Author

@Martin-Molinero

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.

Title: [Feature Request] Expose brokerage reconnect to algorithm layer

1 participant