penberg / helix

Helix, a market data feed handler for C and C++.
Other
110 stars 35 forks source link

Unify order book event and trade event callbacks #32

Closed penberg closed 8 years ago

penberg commented 8 years ago

Currently, we have a separate callback for order book events and trades. This is a problematic API because a trade event obviously has an impact on the order book but it's impossible to tell whether a price level size changed because of an execution or an cancellation. Trade event callbacks, on the other hand, are invoked after order book has been updated which makes it difficult to see what the order book state was when the trade occurred.

The issue can be fixed by unifying the order book event and trade event callbacks into one callback that updates the order book (new order or cancellation), reports a trade (non-displayable order was executed or trade happened on another venue), or both updates the order book and reports a trade (order execution).