So I created an "AddOn" type processor (Singleton really) which opens the desire instrument using:
marketData = new MarketData(instrument);
marketDepth = new MarketDepth<MarketDepthRow>(instrument);
marketData.Update += OnMarketData;
marketDepth.Update+= OnMarketDepth;
This is because if I passed the Data/Depth from the indicators directly to the Singleton, it would get 4 copies if I have 4 indicators and I don't know ahead of time how many will be connected. This also avoids the need to add these OnEvents to each indicator.
I got all this working fine, but what I am seeing is that the Data/Depth events do not happen at the same time. It seems like the AddOn's events are ASYNC to those of the indicators.
How do I force the events to happen synchronously?
I really need the processing to be in this sequence. In {} any order:
{
OnMarketData -> AddOn
OnMarketData -> Indicator1
OnMarketData -> Strategy1
OnMarketData -> Indicator2
OnMarketData -> Indicator3
OnMarketData -> Strategy2
}
OnBarUpdate()
Generally this happens if you are using just indicators, but seems like with this external subscription, the "AddOn" marketData/Depth seems to flow as it feels.

Comment