Creating a Trade Message Accumulator

bug.gif

I've run into a problem with my Ticker Plant feeds, and the best solution to the problem is to create a component that can fit in-line with the feeds and "promote" and "embellish" the trade messages (prints) with the current volume traded as well as per-exchange volumes traded. The issue is that if I allow these trade messages to conflate, information about the individual trade will be lost. Sure, the most recent data will survive, but the volume change represented by the conflated trade will be gone forever.

What I needed was a very simple, very lightweight, component that would take the stream of trades and aggregate the volumes - as well as the high, low, open values, and then "attach" those values to a new trade message - one that is a subclass of the original, and so can take it's place in all the processing, but also includes this cumulative volume and limit values.

Today has been spent creating this and fixing issues associated with it. There's a lot of little things to write including the serialization and deserialization of the component, and the handling of this new message type, as well as automated tests to make sure I'm accumulating things properly. It's close, and I just need to write a few more tests, but for now they day is over and I need a break.