OnixS C++ CME Market Data Handler  2.56.0.0

Order book cloning has been redesigned to be more efficient in terms of resource (memory) allocations. New features have also been added.

Instead, book snapshot can be constructed single time and updated afterwards:

using OnixS::CME::MarketData;
// To avoid memory re-allocations it's better to have snapshot
// pre-constructed to store books of given capacity.
const MarketDepth InitialSnapshotCapacity = 10;
DirectBookSnapshot snapshot(InitialSnapshotCapacity);
...
void
onDirectBookUpdated(
const DirectBook& book,
const ChannelId& channelId)
{
// Book is fully copied to snapshot.
snapshot = book;
}

Limiting Coping Depth

Previously, entire book was copied to book snapshot. Sometimes, it's desired to limit number of levels being copied to particular number (like one in case of best bid/ask copying). To make this happen, snapshot provides OnixS::CME::MarketData::BookSnapshot::assign member allowing to specify maximal number of price levels to be copied:

void
onDirectBookUpdated(
const DirectBook& book,
const ChannelId& channelId)
{
// Copies best bid/ask only.
const MarketDepth NumberOfLevelsToCopy = 1;
snapshot.assign(book, NumberOfLevelsToCopy);
}

Handler allows to obtain book snapshot of any type for any instrument by using corresponding members like OnixS::CME::MarketData::Handler::directBookSnapshot, OnixS::CME::MarketData::Handler::impliedBookSnapshot, OnixS::CME::MarketData::Handler::consolidatedBookSnapshot. All members also provide ability to have limited copy instead of full one.

Current Limitations

Currently, OnixS::CME::MarketData::ConsolidatedBook cloning is restricted to copying primary data only. Consolidated book can only cloned as implied book and thus it will be no access to direct and implied book instances making consolidated book. It will be no extended data on a price level available - only results on consolidation.