Topics
21 Feb 2013, 17:53
 3254
 3
Replies

Rill
26 Feb 2013, 10:50

RE:
cAlgo_Fanatic said:

Hello,

The for loop means that it is looping from index - Periods (which is the current bar - Periods) to index - 1 (which is the previous to the last bar).

If you change this to be index - Periods - X to index - 1 - X, then you should get the desired outcome.

So,

for (int i = index - Periods - X; i <= index - 1 - X; i++)
{
       upper = Math.Max(MarketSeries.High[i], upper);
       lower = Math.Min(MarketSeries.Low[i], lower);
}



beautiful. Thank you very much.


@Rill