Download MetaTrader 5
To add comments, please log in or register
What is a social trading? Read the article to find that out!
fly7680
347
fly7680 2016.10.13 12:16 

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

 

honest_knave
969
honest_knave 2016.10.13 12:48  

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

Divide by 60 to get the difference in minutes. 

fly7680
347
fly7680 2016.10.13 15:13  
I can take the time from an indicator simply by declaring it the code:

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

(time1-time2) /60
whroeder1
13644
whroeder1 2016.10.13 15:27  
  1. ICustom returns buffer values. Not time.
  2. If you know the two indexes, you know the times (Time[i])
fly7680
347
fly7680 2016.10.13 19:06  

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

whroeder1
13644
whroeder1 2016.10.14 12:30  
  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].
fly7680
347
fly7680 2016.10.14 19:03  

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]

Keith Watford
Moderator
7990
Keith Watford 2016.10.14 21:19  
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
/
To add comments, please log in or register