(1) The following codes need DateTime function :
startDateTime01 = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 8, 00, 0);
endtDateTime01 = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 00, 0);
int startBarsAgo01 = GetBar(startDateTime01);
int endBarsAgo01 = GetBar( endDateTime01);
hi01.Set (MAX(High, startBarsAgo01 - endBarsAgo01)[endBarsAgo01]);
lo01.Set (MIN( Low, startBarsAgo01 - endBarsAgo01)[endBarsAgo01]);
(2) The following codes get the last n bars HighestHigh/LowestLow :
double HH = MAX(High, 200)[0];
double LL =MIN(Low,200)[0];
(3)
int bar = Bars.BarsSinceSession;
What if I'd like to obtain the HighestHigh/LowestLow from bar=0 to bar=200 and bar=201 to bar=400 etc in a rolling basis. How should I define the startBarsAgo and endBarsAgo ?
Your advice is much appreciated.

Comment