I am calculating the time of a future bar (for reporting purposes) with the following code where lastBarOfPeriod is a percentage of the total number of historical bars
idx = CurrentBar - lastBarOfPeriod;
Print("Calculated Time of last bar in period" + Time[idx].ToString());
This works perfectly but it seems I could have an issue at some point using a negative index. Is there a built in or better way to do this?
Best Regards,
Scott

Comment