I'm wondering out loud how to calculate the difference between two bars on a tick chart in terms of the amount of time they take to form (in seconds).
Right now I'm using the following code, but I'm attempting (wrongly) to convert a built-in DateTime method into an int. Any advice?
int
bar_Time,
bar_TimePrev,
bar_TimeDiff;
bar_Time = Time[1];
bar_TimePrev = Time[2];
if (bar_TimePrev != 0)
{ bar_TimeDiff = bar_TimePrev - bar_Time; }
else
{ bar_TimeDiff = bar_Time; }
Thanks in advance!


Comment