Accessing Market Depth

Login or Register

Please login or register in order to view and post in the Forum.

3 posts / 0 new
Last post
Robert Maierle
Last seen: 1 year 2 weeks ago
Joined: 04/15/2018 - 09:34
Accessing Market Depth
0
cpayne
Last seen: 1 year 8 months ago
Joined: 03/30/2009 - 00:00
Robert,

Robert,

You declare an instance of class MARKET_DEPTH. 

MARKET_DEPTH    depth;

You can ensure that it's available with...

if (depth.available() == false)
    return RTX_FAIL;   

You can then access the max number of levels with...

int iMaxLevels = depth.maxLevels;

Then ....

int                xBid = 0;

while(xBid < iMaxLevels )
                {
                bidTotal += depth[xBid].bidsize;
                askTotal += depth[xBid].asksize;
                xBid++;
                }

Let me know if that answers your question.

 

 

 

Robert Maierle
Last seen: 1 year 2 weeks ago
Joined: 04/15/2018 - 09:34
_

_