OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.5.1
API documentation
Selecting Securities Of Interest

Defining Securities of Interest

By default, the OnixS::ICE::iMpact::MarketData::Handler processes market data for all securities available in a particular OnixS::ICE::iMpact::MarketData::MarketSubscription. For certain subscriptions, it may be a huge amount of data which may cause the Handler to allocate a significant amount of system resources (like a memory). From the other side, it often happens that not all securities are the point of interest. For these reasons, the Handler provides an ability to define a subset of securities for which the Handler will monitor market data, maintain books and report about other market-related events. No events will be fired by the Handler for any security not present in the defined subset. This feature is called selecting securities or security filtering.

There are two ways (which can be combined) to create and modify a security filter:

  1. OnixS::ICE::iMpact::MarketData::MarketSubscription::marketIds container could be used to gather securities into the collection for which the Handler should process market data. There are no limits on the quantity of securities which can be included in selection. This way allows securities to be filtered using market ID only.
  2. Special parameter isInterested of the OnixS::ICE::iMpact::MarketData::ExchangeListener::onFuturesProductDefinition, OnixS::ICE::iMpact::MarketData::ExchangeListener::onFuturesStrategyDefinition, OnixS::ICE::iMpact::MarketData::ExchangeListener::onNewFuturesStrategyDefinition, OnixS::ICE::iMpact::MarketData::ExchangeListener::onOptionsProductDefinition, OnixS::ICE::iMpact::MarketData::ExchangeListener::onNewOptionsMarketDefinition, OnixS::ICE::iMpact::MarketData::ExchangeListener::onOptionsStrategyDefinition, OnixS::ICE::iMpact::MarketData::ExchangeListener::onNewOptionsStrategyDefinition, OnixS::ICE::iMpact::MarketData::ExchangeListener::onNewExpiry callbacks could be used to add security to the securtiy filter. This way allows securities to be filtered using any attributes.

If at least one security is added to the filter, the Handler stops raising events for all securities available in the market data channel. Since that moment the Handler fires events only for securities included into filtering. Empty (blank) security selection causes the Handler to process market data and trigger events all securities in the market data feed.

Note
Selecting securities affects OnixS::ICE::iMpact::MarketData::ExchangeListener, OnixS::ICE::iMpact::MarketData::OrderBookChangeListener, OnixS::ICE::iMpact::MarketData::OrderBookUpdateListener and OnixS::ICE::iMpact::MarketData::OrderBookBundleUpdateListener listeners only. Handler does not invoke listener members for securities out of selection scope. Other listeners are not affected by this feature.
Attention
Filtering could be manipulated only when the Handler is not processing market data or in bounds of OnixS::ICE::iMpact::MarketData::HandlerStates::SecurityDefinitionsRecoveryFinished state. Once the Handler begins market data processing or moves out of the noted state scope, security selection does not affect the security filter.

Example

Following code demonstrates how to instruct the Handler to process data only for pre-selected securities:

HandlerSettings handlerSettings;
Handler handler(handlerSettings);
MarketSubscriptions subscriptions;
MarketSubscription brentFutures(
5
, MarketSubType::NonImplied
, SecurityType::Futures
, BookDepth::TOP5PL
);
MarketId someMarketId = 318412;
brentFutures.marketIds.push_back(someMarketId);
subscriptions.push_back(brentFutures);
handler.start(subscriptions);

Following code demonstrates how to instruct the Handler to add securities to the filter during security definition recovery:

virtual void onFuturesProductDefinition(const FuturesProductDefinition& msg, bool& isInterested)
{
if (318412 == msg.marketId)
isInterested = true;
}