Subscribes to one or more markets (market IDs may be passed on the command line) and traces market data events so the locally maintained order books can be compared against a reference such as the WebICE portfolio.
Source code
#include "../Common/Defaults.h"
#include "../Common/MarketDataEventTracer.h"
#include "../Common/ServiceEventTracer.h"
#include "../Common/Utils.h"
#include <cstdlib>
int main(int argc, char* argv[])
{
try
{
introduceMyself("Local Book Verification");
handler.bindFeedEngine(feedEngine);
ServiceEventTracer serviceEventTracer;
serviceEventTracer.attachTo(handler);
MarketDataEventTracer marketDataEventTracer;
marketDataEventTracer.attachTo(handler);
);
for (int i = argc - 1; i > 0; --i)
{
brentFutures.marketIds.insert(atoi(argv[i]));
}
subscriptions.insert(brentFutures);
handler.start(subscriptions);
readUserResponse();
std::cout << "Shutdown the Handler..." << std::endl;
handler.stop();
std::cout << "Done." << std::endl;
}
catch (const std::exception& ex)
{
std::cout << "Error: " << ex.what() << std::endl;
return EXIT_FAILURE;
}
catch (...)
{
std::cout << "Unknown exception." << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}