Adding NBBO Exclusion Rules to Ticker Plants

High-Tech Greek Engine

Today I spent most of the day working into my NBBOEngine the concept that the exclusion rules for exchanges wasn't limited to the global exclusion of a single exchange - but that it might be targeted at a single stock, or it's options, or the entire family. These requests came in from the operations group, and they said they needed these rules before they could go live with the Greek Engine. As you might recall, the engine uses the embedded ticker plants, so that's the connection.

So I needed to come up with a way to easily allow the global defaults as well as instrument-level overrides to those defaults, and scope them to include just the instrument, it's options, or both. In general, it wasn't horribly hard - a boost::unordered_map with a std::string key of the SecurityKey, and then a simple object that would hold the scope (a uint16_t bit-masked word), and the array of bool values for the individual exchanges.

Then I needed to replicate the method calls - adding the SecurityKey and scope, and then work that into the framework, and then work that into the external API. Nothing terribly complex, but it's a lot of little pieces, and more than a little typing. In the end, it's all working pretty nicely, and the additional load on the NBBOEngine is zero. Actually, I improved a few things, and that offset the additional lookup of the map.

I then did a little fixing up of the code for visualizing these exclusions, so that it's clear what's being excluded - at the global or instrument levels, and this makes the update really complete. Lots of little things, but in the end a far better system for managing bad data from the exchanges.