Add EMSX locate properties to TerminalLinkOrderProperties#9502
Merged
Martin-Molinero merged 1 commit intoMay 29, 2026
Merged
Conversation
Add LocateBroker (string) and LocateId (string) so algorithms can attach Reg SHO locate information to short equity sales routed through Bloomberg EMSX. These map to the EMSX_LOCATE_BROKER and EMSX_LOCATE_ID fields on the EMSX order ticket (LocBrkr / LocId). The TerminalLink brokerage emits EMSX_LOCATE_REQ = "Y" automatically whenever either identifier is set on a short equity sale, so no separate "required" flag is exposed here. Without these properties the TerminalLink brokerage has no way to identify the lender on a short sale, and prime brokers reject the order. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8e79ca3 to
0917406
Compare
Martin-Molinero
approved these changes
May 29, 2026
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds two new properties to
TerminalLinkOrderPropertiesso algorithms can attach Reg SHO locate information to short equity sales routed through Bloomberg EMSX:LocateBroker(string) — counterparty broker code the shares are borrowed from (e.g."BMTB"), emitted asEMSX_LOCATE_BROKERLocateId(string) — locate confirmation/ticket id returned by the lender, emitted asEMSX_LOCATE_IDThese correspond to the
LocBrkr/LocIdfields on the EMSX trading ticket. The TerminalLink brokerage emitsEMSX_LOCATE_REQ = "Y"automatically whenever either identifier is set on a short equity sale, so no separate "required" flag is exposed here — presence of an identifier is the signal.Related Issue
N/A — surfaced via a TerminalLink customer report. Companion brokerage-side PR: QuantConnect/Lean.Brokerages.TerminalLink#116.
Motivation and Context
The TerminalLink brokerage currently emits
EMSX_SIDE = "SHRT"for short equity sales (since #115) but has no way to identify the lender. Prime brokers reject short sales without a locate attached, so the brokerage needs algorithm-supplied locate fields to route these orders successfully.Requires Documentation Change
No. These follow the same shape as existing properties on the class (
Broker,Account,HandlingInstruction, etc.) and will be picked up by the standard XML doc generation.How Has This Been Tested?
Added two unit tests in
Tests/Common/Orders/TerminalLinkOrderPropertiesTests.cs:LocateFieldsDefaultToEmpty— verifies both properties default tonullSetsLocateFieldsFromPython— verifies the properties round-trip from a Python algorithm via PythonNetBoth pass alongside the existing
SeamlesslySetsStrategyInPythontest (3/3 in the test fixture).Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>— no associated issue; branch isfeature-terminallink-locate-fields🤖 Generated with Claude Code