Quote from nitro:
I could almost use this out of the box, but if I read the documentation correctly, it does not deal with B/A data, and it does not work where the system uses multiple data streams [e.g., for a pairs trading style system] ?
nitro
No, it currently doesn't send any B/A events to the strategy, but it would be a very easy change. All of the data is available at runtime and so we'd just use the same mechanism to pass along trade data.
Do you have any thoughts on how this should behave during backtesting runs? Do you have a data stream which includes changes in the B/A? It could be simulated much the way the tick data is simulated, but I doubt this would be of much value, and it would slow down backtesting even more (already CPU intensive because of the simulated trade data).
Multiple data streams is something that is also not yet present, but which I would also like to add. I was thinking of TICK data for trading the ES/YM, but pairs trading is another great example.
This would be easy to do using only onBar() events, but would take a bit more thought to simulate onTrade() methods so that the simulated trades are properly synchronized. Currently strategies are defined as having only one instrument, but I don't think it would take much to change.
Left to my own devices, I probably won't get around to coding these features for 4-6 months at least. I have a few other things I want to investigate and I'm planning on taking some vacation in the summer, but if you want to help code, I'll be happy to work with you on any rework of the architecture and to integrate your changes into the code base.