Skip to content

Commit

Permalink
Disable subscribe symbol if end with CNT
Browse files Browse the repository at this point in the history
  • Loading branch information
violet-day committed Nov 8, 2024
1 parent 2014aef commit c5a2025
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3636,6 +3636,12 @@ private bool Subscribe(IEnumerable<Symbol> 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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -4559,7 +4571,8 @@ private string GetSymbolExchange(SecurityType securityType, string market, strin
/// <param name="symbol">Symbol to route</param>
private string GetSymbolExchange(Symbol symbol)
{
return GetSymbolExchange(symbol.SecurityType, symbol.ID.Market, symbol.ID.Symbol);
string exchange = GetSymbolExchange(symbol.SecurityType, symbol.ID.Market, symbol.ID.Symbol);
return exchange;
}

/// <summary>
Expand Down

0 comments on commit c5a2025

Please sign in to comment.