I would like to calculate the highest and the lowest in a slice of time.
I use this formula.
startDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, StartHour, StartMinute, 0);
endDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, EndHour, EndMinute, 0);
int startBarsAgo = GetBar(startDateTime);
int endBarsAgo = GetBar(endDateTime);
Now, if I set the property default graphic, "session beguins" = 00, session ends "= 00, i use
double highestHigh = MAX(High, startBarsAgo - endBarsAgo)[endBarsAgo];
double lowestLow = MIN(Low, startBarsAgo - endBarsAgo)[endBarsAgo];
it works
But, if I set the property graphic, "session beguins" = 08, session ends "= 22, French Local Time
I must use this formula so that it works
double highestHigh = MAX(High, (startBarsAgo+1) - endBarsAgo)[endBarsAgo];
double lowestLow = MIN(Low, (startBarsAgo+1) - endBarsAgo)[endBarsAgo];
Comment