Example:

Since i want to be real time and also historic (using tick replay already) i came two issues
1)i get the Ask&Bid price from OnMarketDepth. But there my plot doesnt work. I created also a public variable for each of these values and plot it on OnMarketData were plots do work. But it didnt so each Bid and Ask price it show last price.
When i print onMarketDepth i get the values correct in realtime.
2) I want the plot to be plotted in the whole time like line 2 of the image. Line 1 is my plot.
My code:
protected override void OnMarketDepth(MarketDepthEventArgs e)
{
//Get Bid and Ask
int position = e.Position;
if (e.MarketDataType == MarketDataType.Bid){
if(position==0){
Print(position+" Bid "+e.Price);
}
}
if (e.MarketDataType == MarketDataType.Ask){
if(position==0){
Print(position+" Ask "+e.Price);
}
}
}


Comment