In order to tell to the caller whether the websocket connection is open or not, TryOpenSocketConnection now returns a bool. ApiDataQueueHandler also now operates on BaseData in order to handle all types of securities.
This includes updating all usages of symbol as a security identifier to use the new type.
The type includes a unique field, SID, as well as the current ticker's value. This allows
for consistent addressability while also allowing the ticker to evolve over time with the
mapping changes.
Effort was made to maintain compile and runtime backwards compatibility.
DataFeeds now expose a single bridge (BlockingCollection<TimeSlice>)
- IDataFeed now responsible for all time syncing, DataStream was removed
- BlockingCollection allows for easy throttling of data feed thread without sleeps (internally using semaphore slim)
- Slimmed down IDataFeed interface to not include members unused externally
DataFeeds now use raw IEnumerator<BaseData> instead of subscription data readers directly
- Simplifies fill forward logic (see FillForwardEnumerator.cs and FillForwardEnumeratorTest.cs)
- Allows for composition (raw reader -> fill forward, user/market filters)
- SubscriptionDataReader now handles refreshing source (continuous enumeration)
LiveTradingDataFeed cleaned up to work with time slice bridge
- RealTimeSynchronizedTimer handles pushing time slices into bridge every second, with or without data
- Subscriptions with tick resolution get their data pushed directly into the bridge immediately
Fill forward changes
- Implemented as an IEnumerator<BaseData>
- Fill forward lower res on higher res (daily gets filled forward on second/minute/hour bars)
- Second/minute/hour will not be filled forward on daily bars (at midnight) in line with current behavior
MISC:
- Performance boost in backtesting brokerage via not checking _pending.Count, instead use local bool to determine if there's pending orders
- Added a FakeDataQueue to aid in testing LiveTradingDataFeed
- FileSystemDataFeed now uses CancellationTokenSource to handle thread exits
- Added logging