Download MetaTrader 5

Minutes elapsed

To add comments, please log in or register
Morteza Khorasani
111
Morteza Khorasani  

How to calculate the minute elapsed since opening a position

Can this be true:

if(TimeMinute(TimeCurrent())-TimeMinute(opentime)>60)
{

....

}


 

whroeder1
15925
whroeder1  
Morteza Khorasani: How to calculate the minute elapsed since opening a position
if(TimeMinute(TimeCurrent())-TimeMinute(opentime)>60)
{

....

}
That won't work because minutes rolls over at 60.
Perhaps you should read the manual. Datetime is seconds. Subtract two you get elapsed time in seconds.
if( (TimeCurrent() - opentime)/60 >60) // Open more than 60 minutes
{

....

}
To add comments, please log in or register