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 13, 2024
1 parent 2014aef commit 24dcd56
Showing 1 changed file with 12 additions and 0 deletions.
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 Contingent Value Right, 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 Contingent Value Right, 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

0 comments on commit 24dcd56

Please sign in to comment.