Thread: Ask!
View Single Post
  #887 (permalink)  
Old 12-13-2007, 10:18 AM
pgtips pgtips is offline
Junior Member
 
Join Date: Mar 2007
Posts: 6
pgtips is on a distinguished road
time calculation

Hi,

I've been working on a place pending order script but can't set the expiry time based on my entered time i.e if I want the order to expire at 15:30 I need to calculate distance between curr time and expiry time, this will give me a vlaue which is time to expire.

I've asked for the following values
extern int To_Hour = 15;
extern int To_Min = 30;

and used the following code to get the correct time distance but it doesn't work.
PHP Code:
//make time hr & min one value
int time_expire To_Hour 60 To_Min 60 60;
//get curr time as value
datetime curr TimeCurrent();
//subtract one from the other so 15:30 - 10:15 = 5hrs 15 mins to expire
expiry time_expire curr
I think I am right in understanding you can't just set time to expire as a time value but need to tell MQ4 number of hrs, mins and seconds to expire time.

Thanks in advance for help with this,

Kev
Reply With Quote