Access DOM Data example code

Questions about MultiCharts and user contributed studies.
vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Access DOM Data example code

Postby vking » 22 Apr 2012

Hello MC Team - I am trying to access DOM Data in 8 beta 2. This code doesn't pull the data for some reason. I am using OEC data and can see level 2 data in the DOM but when I run it as an indicator in the chart - this doesn't pull level 2 data(shows 0 always). Would you please provide a working example for this?

Thanks

Code: Select all

Vars: var0(0);
if dom_isconnected then var0 = dom_askprice(0);
print(var0);

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Access DOM Data example code

Postby TJ » 22 Apr 2012

Hello MC Team - I am trying to access DOM Data in 8 beta 2. This code doesn't pull the data for some reason. I am using OEC data and can see level 2 data in the DOM but when I run it as an indicator in the chart - this doesn't pull level 2 data(shows 0 always). Would you please provide a working example for this?

Thanks

Code: Select all

Vars: var0(0);
if dom_isconnected then var0 = dom_askprice(0);
print(var0);
Have you tried Intrabarpersist ?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Access DOM Data example code

Postby JoshM » 23 Apr 2012

I'm not sure if this is the case here, but on BMT there was a post saying:
Played with this for a minute, first problem I ran into is that you have to have a DOM window open to the instrument being charted for it to work.
(..)
I can also confirm it is only updating on a Last change. No update on all the depth changes.

vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Re: Access DOM Data example code

Postby vking » 23 Apr 2012

Thanks Josh & TJ.

I had a chance to check this out and works fine as expected. Didn't have to have the DOM open for this and also doesn't have to be intrabarpersist.

Example code - built in study - "-- Market Depth on Chart --"

Thanks


Return to “MultiCharts”