From f44f85731f4581f33874bfe9e6396ac4c99d3d10 Mon Sep 17 00:00:00 2001 From: Martin Molinero Date: Mon, 24 Aug 2026 10:24:54 -0300 Subject: [PATCH] Send EMSX_CFD_FLAG as Y instead of 1 Bloomberg EMSX expects "Y"/"N" for EMSX_CFD_FLAG, so IsCfdTrade sending "1" silently booked orders as Regular instead of CFD. Companion to QuantConnect/Lean.Brokerages.TerminalLink#143 and closes QuantConnect/Lean.Brokerages.TerminalLink#138 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01YMfMcmQohYN92aU1wirKtZ --- Common/Orders/TerminalLinkOrderProperties.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/Orders/TerminalLinkOrderProperties.cs b/Common/Orders/TerminalLinkOrderProperties.cs index db0a52dffb1b..a4ceb97aa1c6 100644 --- a/Common/Orders/TerminalLinkOrderProperties.cs +++ b/Common/Orders/TerminalLinkOrderProperties.cs @@ -27,7 +27,7 @@ public class TerminalLinkOrderProperties : OrderProperties { /// /// Custom EMSX fields to send with the order. The key is the EMSX element name - /// and the value is the element value, e.g. AdditionalProperties["EMSX_CFD_FLAG"] = "1" + /// and the value is the element value, e.g. AdditionalProperties["EMSX_CFD_FLAG"] = "Y" /// /// Starts empty. Python cannot assign a plain dict to it, since pythonnet has no /// conversion for it; add the entries one by one, bulk load them from a dict with update(), @@ -106,8 +106,8 @@ public class TerminalLinkOrderProperties : OrderProperties /// public bool IsCfdTrade { - get { return AdditionalProperties != null && AdditionalProperties.TryGetValue("EMSX_CFD_FLAG", out var flag) && flag == "1"; } - set { SetTag("EMSX_CFD_FLAG", value ? "1" : null); } + get { return AdditionalProperties != null && AdditionalProperties.TryGetValue("EMSX_CFD_FLAG", out var flag) && flag == "Y"; } + set { SetTag("EMSX_CFD_FLAG", value ? "Y" : null); } } ///