// Timer
BDT = BarDateTime; // Timestamp of the current bar
PrevBDT = BarDateTime[1]; // Timestamp of the previous bar
TimeinBar = maxlist(Absvalue((BDT - PrevBDT).Totalseconds astype double),1); // Time in bar in seconds, Maximum of either 1 second or number of seconds it took for the bar to form.
Thank you for any assistance.

Comment