Start bar of Highest/Lowest price.

Created at 06 Nov 2015, 03:20
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!
SA

SaifBD

Joined 05.01.2014

Start bar of Highest/Lowest price.
06 Nov 2015, 03:20


I can use this code to get highest & lowest price of last bars. And it's starting from last (0) bar.

             highest = MarketSeries.High.Maximum(int Bars);
            lowest = MarketSeries.Low.Minimum(int Bars);

but how can I use a bar number to start? I want to use from bar 1, not 0.

Anyone help me please!!!


@SaifBD
Replies

Spotware
06 Nov 2015, 03:36

Dear Trader,

In the square brackets you write the index of the historical trend bar. The index is always the trend bar you want to use - 1.

The following code snippet illustrates it:

double high = MarketSeries.High[0];
double low = MarketSeries.Low[0];

 


@Spotware

craig.bobbin
07 Jul 2016, 06:44

RE:

Spotware said:

Dear Trader,

In the square brackets you write the index of the historical trend bar. The index is always the trend bar you want to use - 1.

The following code snippet illustrates it:

double high = MarketSeries.High[0];
double low = MarketSeries.Low[0];

 

 

does this mean

double high = MarketSeries.High[50] 

 

will return the highest price traded in the last 50 bars?


@craig.bobbin