MarketDepth access to individual items

Created at 24 Oct 2013, 12:25
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!
RE

reivaj117

Joined 24.10.2013

MarketDepth access to individual items
24 Oct 2013, 12:25


Hi! im writting because im trying to create an indicator based on the market depth , but using the examples i only can access to the whole askentries or bid but i only wanted the first 5 orders in both sides , how can i do it? is possible?

 

Thank you


@reivaj117
Replies

virtuesoft
24 Oct 2013, 16:23

RE:

Hello,

You can loop through the bid and ask entries in the market depth (see code below). You can get the price and volume for each entry. You could use the price to get the top 5 orders. 

foreach (MarketDepthEntry entry in MarketData.GetMarketDepth(Symbol).AskEntries)
{
      double price = entry.Price;
      double volume = entry.Volume;
}

reivaj117 said:

Hi! im writting because im trying to create an indicator based on the market depth , but using the examples i only can access to the whole askentries or bid but i only wanted the first 5 orders in both sides , how can i do it? is possible?

 

Thank you

 


@virtuesoft

reivaj117
27 Oct 2013, 16:15

Thank you it works!
@reivaj117

iburakbirer
11 Mar 2015, 03:02

Hi reivaj were you able to create what you needed? Would you mind starting a market depth totals indicator project?

I published my idea here; /jobs/129

Best, 


@iburakbirer