I am trying to calculate the minimum of the duration of the last 10 candles, without adding an additional series. Is there similar to MIN() that doesn't get error?
Thanks!
TimeSpan time1 = Time[0] - new DateTime(1970,1,1,0,0,0);
TimeSpan time2 = Time[1] - new DateTime(1970,1,1,0,0,0);
double diff=(double)time1.TotalSeconds-(double)time2.TotalSeconds;
double diff2=0.00;
double diff3=0.00;
if (Bars.IsFirstBarOfSession)
{
diff2=diff2;
}
else
{
diff2= diff;
}
diff3 = MIN(diff2, 10);
Comment