Bid and Ask from the DOM

Questions about MultiCharts .NET and user contributed studies.
TopGuy
Posts: 11
Joined: 20 Nov 2012
Has thanked: 1 time
Been thanked: 7 times

Bid and Ask from the DOM

Postby TopGuy » 25 Nov 2012

Is the proper way of obtaining the current Bid and Ask is accessing it from the DOM such as:

Code: Select all

Bars.DOM.Bid[0].Price


This is not working with me, is there any other way of obtaining the bid and ask?

User avatar
Henry MultiСharts
Posts: 8479
Joined: 25 Aug 2011
Has thanked: 1211 times
Been thanked: 2720 times

Re: Bid and Ask from the DOM

Postby Henry MultiСharts » 27 Nov 2012

Hello TopGuy,

You need to make sure that the bid values are not null and the array of values is not empty.
Please try this code:

Code: Select all

if(!object.Equals(Bars.DOM.Bid, null))
 if(Bars.DOM.Bid.Count() > 0)
     plot1.Set(Bars.DOM.Bid[0].Price);

Dru
Posts: 107
Joined: 28 Aug 2007
Has thanked: 4 times
Been thanked: 171 times

Re: Bid and Ask from the DOM

Postby Dru » 29 Nov 2012

TopGuy wrote:is there any other way of obtaining the bid and ask?

Bars.StatusLine.Ask
Bars.StatusLine.Bid


Return to “MultiCharts .NET”