I standardized on one format.. so strategies I've written can all use the same code and, if needed, dig into the data structure I've stored in memory in the same way regardless of the source vendor. This means when I write a new 'connection agent' that handles a quote feed, I parse the quote data and rebroadcast it in my own format.Hi Jack,
No worries, I can understand. I was planning on doing something similar as I had to keep with multiple API's for different brokers.
Do you think you can share have you abstracted the incoming feed? (If you have any reference for incoming abstract.py it would be useful, it can avoid me potential rewrite of API multiple times)
An example flow:
- The vendor might use a websocket to broadcast a JSON object.
- That JSON object will be read by my agent and converted into a string that is formatted for my platform to use internally.
- The newly reformatted data gets broadcast to any strategy or code that's subscribed to it.
- If a strategy class had subscribed to it, up on reading the incoming broadcast, it stores a copy locally for ad-hoc reference, and then triggers an event.
- Should the event have user defined code set to run upon being triggered, that code runs (strategy logic, etc..)
I hope that helps.