how can I graphically put the bid and ask of Top of Book (Level 1) on a chart?
For these values (Bid and Ask) Depth of Market (Level 2) I used this script but it doesn't work with Top of Book (Level 1):
protected override void OnMarketDepth(MarketDepthEventArgs e)
{
if (e.MarketDataType==MarketDataType.Ask)
{
string priceask=string.Format("{0}",e.MarketDepth.Ask[0].Price.ToString("F"+decimali));
DrawText("PriceAsk",true,priceask,-100,e.MarketDepth.Ask[0].Price,0,Color.IndianRed,textfont2,StringAlignment .Center,Color.Transparent,Color.Transparent,0);
string volumeask=string.Format("{0}",e.MarketDepth.Ask[0].Volume);
DrawText("VolumeAsk",true,volumeask,-100,e.MarketDepth.Ask[0].Price+2*TickSize,0,Color.IndianRed,textfont1,Stri ngAlignment.Center,Color.Transparent,Color.Transpa rent,0);
}
}
Thanks for your help
Comment