datetime difference between two points

 

If I have two points with two different times can I know the time difference in minutes?

 

 

Subtract one time from the other. That is the difference in seconds.

Divide by 60 to get the difference in minutes. 

 
I can take the time from an indicator simply by declaring it the code:

double time1= icustom () 
double time2= icustom () 

(time1-time2) /60
 
  1. ICustom returns buffer values. Not time.
  2. If you know the two indexes, you know the times (Time[i])
 

thanks for the answers, give me a tremendous help. But I have a doubt, I use:

iTime (Symbol(), PERIOD_CURRENT,i)

 but do not understand how to take the time on:

iCustom(Symbol(), PERIOD_CURRENT, "::Indicators\\myindicator.ex4", 0, i)

Thanks for your help

 
  1. iTime(Symbol(), PERIOD_CURRENT, i) is the same as Time[i].
  2. There is no time with iCustom. You have the "i" use Time[i].
 

Ok thanks WHRoeder, a small step understand the code. With this formula, I should have found the solution

double A= (Time[1+i] - Time[2+i]) /60; //Minutes between Candle1 and Candle2

Correct?!?

But I still have a problem, I can not understand how to read a time of an out buffer, with Time[i]

 
fly7680:

But I still have a problem, I can not understand how to read a time of an out buffer, with Time[i]

Already answered by WHRoeder in the post above yours
Reason: