bars, high,low

Created at 26 Nov 2012, 14:17
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!
TH

thx1140

Joined 31.03.2012

bars, high,low
26 Nov 2012, 14:17


Hello,

 

can someone post how to get the high and low values from the previous bar?

I was using something like this but it is not working:

Print("close="+MarketSeries.Close[MarketSeries.Close.Count-1]);

 

many thanks


@thx1140
Replies

admin
26 Nov 2012, 17:55

Just correct it to this: Print("close=", MarketSeries.Close[MarketSeries.Close.Count-2]); 

 

int index = MarketSeries.Close.Count-1;

int prevIndex = index - 1;

open: MarketSeries.Open[prevIndex]

high: MarketSeries.High[prevIndex]

low: MarketSeries.Low[prevIndex]

close:MarketSeries.Close[prevIndex]

 

 


@admin

thx1140
26 Nov 2012, 19:01

RE:

many thanks!


@thx1140