Skip to content

Let TerminalLink submit orders on index securities - #9755

Merged
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
AlexCatarino:fix-9747-terminallink-index-cfd
Aug 26, 2026
Merged

Let TerminalLink submit orders on index securities#9755
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
AlexCatarino:fix-9747-terminallink-index-cfd

Conversation

@AlexCatarino

Copy link
Copy Markdown
Member

Description

TerminalLinkBrokerageModel.CanSubmitOrder rejected every SecurityType.Index order, which blocked a supported Bloomberg EMSX workflow: booking a custom basket (e.g. a Morgan Stanley basket swap) whose market data arrives through B-Pipe as an index, by typing the index ticker into the EMSX security field and routing the ticket as a CFD/swap.

TerminalLinkBrokerage.PlaceOrder already sends EMSX_CFD_FLAG (from TerminalLinkOrderProperties.IsCfdTrade) and TerminalLinkSymbolMapper already resolves index tickers, so the engine-level pre-flight check was the only thing in the way.

EMSX accepts an index ticker in the security field, so Index joins _supportedSecurityTypes rather than being gated on the CFD flag — that flag is an order-level booking type that is independent of the security type by design, as its documentation states. The existing Security.IsTradable opt-in for indices still applies upstream of the brokerage model, so a data-only index is still rejected before it reaches here.

Closes #9747

Related Issue

Closes #9747

Motivation and Context

Reported by a live Institution user whose order was invalidated with BrokerageModel declared unable to submit order: ... The TerminalLinkBrokerageModel does not support Index security type. even though the order was explicitly flagged IsCfdTrade = true. In a standard (non-LEAN) EMSX ticket this booking flow is normal and supported.

Requires Documentation Change

No.

How Has This Been Tested?

TerminalLinkBrokerageModelTests: the SPX/SecurityType.Index case moved from CannotSubmitOrder_ForUnsupportedSecurityTypes to CanSubmitOrder_ForSupportedSecurityTypes, plus a new CanSubmitOrder_ForIndex_BookedAsCfdTrade covering the reported workflow — an index order carrying TerminalLinkOrderProperties { IsCfdTrade = true }.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

🤖 Generated with Claude Code

TerminalLinkBrokerageModel.CanSubmitOrder rejected every SecurityType.Index
order, which blocked a supported EMSX workflow: booking a custom basket whose
market data arrives through B-Pipe as an index by typing the index ticker into
the EMSX security field and routing the ticket as a CFD/swap. PlaceOrder
already sends EMSX_CFD_FLAG and the symbol mapper already resolves index
tickers, so the pre-flight check was the only thing in the way.

EMSX accepts an index ticker in the security field, so Index joins the
supported security types rather than being gated on the CFD flag, which is an
order-level booking type independent of the security by design.

Closes QuantConnect#9747

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Martin-Molinero
Martin-Molinero merged commit 07fb018 into QuantConnect:master Aug 26, 2026
8 checks passed
@AlexCatarino
AlexCatarino deleted the fix-9747-terminallink-index-cfd branch August 26, 2026 19:55
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.

TerminalLinkBrokerageModel rejects SecurityType.Index orders even with EMSX CFD flag set

2 participants