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:
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.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.
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.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.Following code demonstrates how to instruct the Handler to process data only for pre-selected securities:
Following code demonstrates how to instruct the Handler to add securities to the filter during security definition recovery: