forwardProduct Definitions   Table of ContentHandler Eventsforward
Subscribing to Multicast Groups

The ICE iMpact multicast groups are currently defined based on set of products (such as 'Europe Futures Oil') and depth of book (Full Order Depth, Top 5 Price Level). The Handler exposes flexibility of subscribing to the multicast groups that are best suited to customers individual needs.

Creating Subscription

Subscribing is a way to start receiving multicast feed market data. To subscribe to certain multicast groups as well as to select which type of books must be maintained by the Handler, instance of ICollection<MarketSubscription> collection must be created and filled with items. Any collection which implements noted interface is suitable for the use.

Once instance of a blank collection is created, subscriptions for a particular market type can be added. This can be achieved by pushing items of type MarketSubscription into the collection. Each added item identifies type of market to which subscription will be performed and kinds of books which the Handler is supposed to build and update while maintaining subscription.

Depending on security type the following order book depths are available:

Filtering

It is possible to specify one or more market ID for each market subscription using AddFilter(Int32). This filter be used as a first-level filter and all product definitions which do not match this list will be ignored.

The second-level filter is a special boolean property isInterested which is available in the following events:

This property can be used to determine if a subscription for a given product definition should be maintained or not. By default, this value is set to true. If the given product definition is not interested you just need to set it to false and it will be removed from market subscription and the Handler won't process any messaged with this market ID.

The Handler can maintain as much first- and second-level filters as needed. There are no limitations to this kind of settings in the Handler implementation.

Cross Filtering

If you need to filter one set of product definitions depending on information from another set of product definitions like you want to maintain only those Futures product definitions which related to UdsFuturesMarkets you are interested in you can use the following approach:

  1. Make two subscriptions - for UdsFuturesMarkets and for Futures.
  2. The UdsFuturesMarkets subscription should be first in the list.
  3. In your code allocate some array to keep market IDs of the legs.
  4. When you receive the UdsFuturesMarkets with legs you want to subscribe you need to add its IDs to your array.
  5. When you receive the `Futures` you need to check if a market ID is in your array and set IsInterested to true.

Starting Subscription

Constructed collection must be passed to Start(ICollection<MarketSubscription>) member which starts subscription. Since that moment, Handler will notify about all the events through appropriate handlers. In particular, it will notify the subscribers about reception of the product definitions. Later - about changes in states of markets, new orders added or removed to or from market books, and, surely, about errors if any occurred during processing data from multicast feed channels.

Example

Below is the example of subscribing to 'IPE Gas Oil Futures' market data of 'ICE Futures Europe Oil' multicast group.

C#
using System;
using System.Collections.Generic;

using OnixS.NET.ICE.iMpact;

.. 

HandlerSettings handlerSettings = new HandlerSettings();
handlerSettings.ConnectivityConfiguration = "ConnectivityConfiguration.xml";

Handler handler = new Handler(handlerSettings);

List<MarketSubscription> subscriptions = new List<MarketSubscription>();

MarketSubscription ipeGasOilFutures = new MarketSubscription(
    4,                       // market type id for IPE Gas Oil Futures.
    SecurityType.Futures,    // Type of product definitions
    BookDepth.FOD            // Build and maintain full-order-depth book.
);

subscriptions.Add(ipeGasOilFutures);

handler.Start(subscriptions);

..