OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.18.0
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 security 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:

// Initialize the Handler settings.
HandlerSettings handlerSettings;
handlerSettings.connectivityConfiguration = "ConnectivityConfiguration.AP1.xml";
// Set up a market subscription for Brent Futures.
MarketSubscription brentFutures(
KnownMarketTypes::IpeBrentFutures // Market type ID for IPE Brent Futures.
, MarketSubType::NonImplied // Use non-implied prices.
, SecurityType::Futures // Defines type of securities (Futures/OTC, Options or UDS Markets).
, BookDepth::TOP5PL // Build and maintain top five price levels books.
);
// Set up the desired market IDs.
MarketId someMarketId = 318412;
brentFutures.marketIds.push_back(someMarketId);
// Initialize the subscriptions collection.
MarketSubscriptions subscriptions;
subscriptions.insert(brentFutures);
// Start the Handler with the specified subscriptions.
Handler handler(handlerSettings);
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;
}