Handler EventsTable of ContentLogging

Best Bid-Ask Tracking

To process only top of the book changes (best bid and best ask) user should subscribe to corresponding events and setup tracking options.

Handler has three book types: regular order book, implied order book and consolidated order book. According to this handler have three events:

Each of those events has Handler..::..TopOfTheOrderBookUpdatedEventArgs which contains top bid and top ask price levels.

Top of the book changes could be tracked using three parameters: price, quantity and number of orders. To setup tracking options user should use BestBidAskTrackingOptions property. BestBidAskTrackingParameters could be aggregated with bitwise or operator. PriceThreshold, QuantityThreshold and OrdersCountThreshold should be used to specify thresholds for each tracking parameter. All thresholds are are given in percentage.

Examples

Next example shows how to detect any changes of top of the books.

CopyC#
handler.RegularOrderBookTopOfTheBookUpdated = new EventHandler<Handler.TopOfTheOrderBookUpdatedEventArgs>(topOfTheBookUpdated);
handler.ImpliedOrderBookTopOfTheBookUpdated = new EventHandler<Handler.TopOfTheOrderBookUpdatedEventArgs>(topOfTheBookUpdated);
handler.ConsolidatedOrderBookTopOfTheBookUpdated = new EventHandler<Handler.TopOfTheOrderBookUpdatedEventArgs>(topOfTheBookUpdated);
handler.BestBidAskTrackingOptions.PriceThreshold = 0;
handler.BestBidAskTrackingOptions.QuantityThreshold = 0;
handler.BestBidAskTrackingOptions.OrdersCountThreshold = 0;
handler.BestBidAskTrackingOptions.BestBidAskTrackingParameters = BestBidAskTrackingParameter.All;

Next example shows how to detect changes if best bid or best ask price changed more that 10% or quantity changed more than 20%.

CopyC#
handler.RegularOrderBookTopOfTheBookUpdated = new EventHandler<Handler.TopOfTheOrderBookUpdatedEventArgs>(topOfTheBookUpdated);
handler.ImpliedOrderBookTopOfTheBookUpdated = new EventHandler<Handler.TopOfTheOrderBookUpdatedEventArgs>(topOfTheBookUpdated);
handler.ConsolidatedOrderBookTopOfTheBookUpdated = new EventHandler<Handler.TopOfTheOrderBookUpdatedEventArgs>(topOfTheBookUpdated);
handler.BestBidAskTrackingOptions.PriceThreshold = 10;
handler.BestBidAskTrackingOptions.QuantityThreshold = 20;
handler.BestBidAskTrackingOptions.OrdersCountThreshold = 0;
handler.BestBidAskTrackingOptions.BestBidAskTrackingParameters = BestBidAskTrackingParameter.Price | BestBidAskTrackingParameter.Quantity;