Minutes elapsed

 

How to calculate the minute elapsed since opening a position

Can this be true:

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

....

}


 

 
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
{

....

}