Ask, Bid, Volume of the best bid and ask only

Created at 31 May 2013, 00:12
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
AD

adrian

Joined 27.09.2012

Ask, Bid, Volume of the best bid and ask only
31 May 2013, 00:12


how to retreive the ask, bid, volume only of the best market bid and ask, without having to loop through all the entries by using foreeach

/api/marketdepthentry


@adrian
Replies

cAlgo_Fanatic
31 May 2013, 11:15

AskEntries and BidEntries are ordered in ascending and descending order of price, respectively. You may just index the first position of each.

price = marketDepth.AskEntries[0].Price; 
volume = marketDepth.AskEntries[0].Volume; 


 


@cAlgo_Fanatic