Add EMSX locate properties to TerminalLinkOrderProperties#9502
Open
AlexCatarino wants to merge 1 commit into
Open
Add EMSX locate properties to TerminalLinkOrderProperties#9502AlexCatarino wants to merge 1 commit into
AlexCatarino wants to merge 1 commit into
Conversation
Add LocateRequired (bool), LocateBroker (string), and LocateId (string) properties so algorithms can attach Reg SHO locate information to short equity sales routed through Bloomberg EMSX. These map to the EMSX_LOCATE_REQ, EMSX_LOCATE_BROKER, and EMSX_LOCATE_ID fields on the EMSX order ticket (LocReq / LocBrkr / LocId). 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>
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 three new properties to
TerminalLinkOrderPropertiesso algorithms can attach Reg SHO locate information to short equity sales routed through Bloomberg EMSX:LocateRequired(bool, defaultfalse) — whentrue, the brokerage emitsEMSX_LOCATE_REQ = "Y"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
LocReq/LocBrkr/LocIdfields on the EMSX trading ticket.Related Issue
N/A — surfaced via a TerminalLink customer report. The companion brokerage-side PR is QuantConnect/Lean.Brokerages.TerminalLink#PR_TBD (will be linked once opened).
Motivation and Context
The TerminalLink brokerage currently emits
EMSX_SIDE = "SHRT"for short equity sales (since #PR for issue #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 defaults (false/null/null)SetsLocateFieldsFromPython— 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