From 0dc5ec2a286fb27ca06b93fc60434c42eed26a79 Mon Sep 17 00:00:00 2001 From: QuantConnect Support Bot Date: Thu, 1 Oct 2026 16:25:20 +0000 Subject: [PATCH] Collective2SignalExport: send a renamed equity's current ticker GetSymbol returned SecurityIdentifier.Symbol for an equity, the ticker the security first listed under, so a renamed security (BGU -> SPXL) was exported under a ticker Collective2 rejects as (1121) Invalid symbol, failing the whole payload. Restore the pre-#8604 behaviour for equities: the map-file ticker as of the algorithm's time via IAlgorithm.Ticker. Fixes #9857 --- .../Portfolio/SignalExports/Collective2SignalExport.cs | 6 ++++++ .../Framework/Portfolio/SignalExportTargetTests.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs b/Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs index ea4aa2182327..aee5f2476647 100644 --- a/Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs +++ b/Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs @@ -363,6 +363,12 @@ private string GetSymbol(Symbol symbol) { return symbol.Underlying.Value; } + else if (symbol.SecurityType == SecurityType.Equity) + { + // The ticker the security trades under today. SecurityIdentifier.Symbol is the ticker it first + // listed under, which Collective2 no longer knows once the security has been renamed (e.g. BGU -> SPXL) + return _algorithm.Ticker(symbol); + } else { return symbol.ID.Symbol; diff --git a/Tests/Algorithm/Framework/Portfolio/SignalExportTargetTests.cs b/Tests/Algorithm/Framework/Portfolio/SignalExportTargetTests.cs index 181ff7f3ab02..cf4be96e835a 100644 --- a/Tests/Algorithm/Framework/Portfolio/SignalExportTargetTests.cs +++ b/Tests/Algorithm/Framework/Portfolio/SignalExportTargetTests.cs @@ -469,6 +469,8 @@ public void EmptySignalExportList() private static object[] SendsTargetsToCollective2AppropriatelyTestCases = { new object[] { "USD", Symbols.SPY, 0.2m, @"{""StrategyId"":0,""Positions"":[{""exchangeSymbol"":{""symbol"":""SPY"",""currency"":""USD"",""securityExchange"":""DEFAULT"",""securityType"":""CS""},""quantity"":2992.0}]}" }, + // A renamed equity is sent under its current ticker, not the one in its SecurityIdentifier (GOOCV) + new object[] { "USD", Symbols.GOOG, 0.2m, @"{""StrategyId"":0,""Positions"":[{""exchangeSymbol"":{""symbol"":""GOOG"",""currency"":""USD"",""securityExchange"":""DEFAULT"",""securityType"":""CS""},""quantity"":2992.0}]}" }, new object[] { "USD", Symbols.EURUSD, 1m, @"{""StrategyId"":0,""Positions"":[{""exchangeSymbol"":{""symbol"":""EUR/USD"",""currency"":""USD"",""securityExchange"":""DEFAULT"",""securityType"":""FOR""},""quantity"":1.0}]}" }, new object[] { "USD", Symbols.EURGBP, 1m, @"{""StrategyId"":0,""Positions"":[{""exchangeSymbol"":{""symbol"":""EUR/GBP"",""currency"":""USD"",""securityExchange"":""DEFAULT"",""securityType"":""FOR""},""quantity"":1.0}]}" }, new object[] { "USD", Symbols.GBPJPY, 1m, @"{""StrategyId"":0,""Positions"":[{""exchangeSymbol"":{""symbol"":""GBP/JPY"",""currency"":""USD"",""securityExchange"":""DEFAULT"",""securityType"":""FOR""},""quantity"":1.0}]}" },