From 788f61b4cc03566a042770cb4d854bb02bb9834f Mon Sep 17 00:00:00 2001 From: Nemo Date: Fri, 8 Nov 2024 11:59:23 +0800 Subject: [PATCH] Disable subscribe symbol if end with CNT --- .../InteractiveBrokersBrokerage.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs b/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs index ab446d6..bba8ccf 100644 --- a/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs +++ b/QuantConnect.InteractiveBrokersBrokerage/InteractiveBrokersBrokerage.cs @@ -3636,6 +3636,12 @@ private bool Subscribe(IEnumerable symbols) var id = GetNextId(); var contract = CreateContract(subscribeSymbol, includeExpired: false); + if (subscribeSymbol.Value.EndsWith("CNT")) + { + Log.Trace($"InteractiveBrokersBrokerage.Subscribe: cause {subscribeSymbol.Value} is cvr, so ignore subscribe request"); + continue; + } + var symbolProperties = _symbolPropertiesDatabase.GetSymbolProperties(subscribeSymbol.ID.Market, subscribeSymbol, subscribeSymbol.SecurityType, Currencies.USD); var priceMagnifier = symbolProperties.PriceMagnifier; @@ -3766,6 +3772,12 @@ private static bool CanSubscribe(Symbol symbol) return false; } + if (symbol.Value.EndsWith("CNT")) + { + Log.Trace($"InteractiveBrokersBrokerage.CanSubscribe: cause {symbol.Value} is cvr, so ignore get history"); + return false; + } + // Include future options as a special case with no matching market, otherwise // our subscriptions are removed without any sort of notice. return