Onbarupdate
Onmarketdata
Onmarketdepth
I am only collecting data into my queue when the update event occurs.
I thought if you apply these 3 seperatly you will get streaming data?
But at the moment I am not, is it the update event that makes the queue fill up?
I am also going to try to include the below code, i just want to snapshot the depth volume at position zero
Tinkerz
protected override void OnMarketDepth(MarketDepthEventArgs e) { if (e.MarketDataType == MarketDataType.Ask && e.Position == 0) { AskStack.Enqueue((double)e.Volume); int countC=AskStack.Count; AskTime.Enqueue(Math.Round(DateTime.Now.TimeOfDay.TotalSeconds,0)); if (countC>128) { AskStack.Dequeue(); AskTime.Dequeue(); } } if (e.MarketDataType == MarketDataType.Bid && e.Operation == Operation.Update && e.Position == 0) { BidStack.Enqueue(e.Volume); int countD=BidStack.Count; if (countD>128) BidStack.Dequeue(); } if (timestart<(DateTime.Now.TimeOfDay.TotalSeconds)); try{ChartControl.Refresh();} catch {} timestart = (DateTime.Now.AddSeconds(1).TimeOfDay.TotalSeconds); }
Comment