calculating time difference

 

I need my slave EA to calculate the time difference between The master Time and Slave Time. If the difference is more than 10 min. then slave must return(0),


Any feed back about the code please.

 
forexrus:

I need my slave EA to calculate the time difference between The master Time and Slave Time. If the difference is more than 10 min. then slave must return(0),

Any feed back about the code please.


datetime says all

http://www.metatrader.info/node/128

 
forexrus:

I need my slave EA to calculate the time difference between The master Time and Slave Time. If the difference is more than 10 min. then slave must return(0),

Any feed back about the code please.

Did you mean, Master's position open time ?, However what data that are transferred/read from Master to Slave, - symbol(), open price, SL, TP - and what else ? Try https://docs.mql4.com/dateandtime

 
onewithzachy:

Did you mean, Master's position open time ?, However what data that are transferred/read from Master to Slave, - symbol(), open price, SL, TP - and what else ? Try https://docs.mql4.com/dateandtime


Yes, the time which is send to slave by master program. Then slave must subtract the Mater Time from it's current time. For example Master Time is 2012.05.22 12:30:27' and salve time is 2012.05.22 12:31:28' Then the result or time difference will be 1 min. and 1 second. I need to write a code to calculate the minute difference only and if it is above 10 min it should return (0).
 
forexrus:

Yes, the time which is send to slave by master program. Then slave must subtract the Mater Time from it's current time. For example Master Time is 2012.05.22 12:30:27' and salve time is 2012.05.22 12:31:28' Then the result or time difference will be 1 min. and 1 second. I need to write a code to calculate the minute difference only and if it is above 10 min it should return (0).

I gave you the link, didn't I. Let's see ... 10 minutes are equal with 600 seconds. So if Master Time minus Slave Time is bigger-or-equal than 600 second, then you must do something.

Script sample :

double gap = TimeLocal() - TimeCurrent();
Alert ("Local - Server ",gap," seconds ",(gap/60)," minutes ",(gap/3600)," hours");
 
onewithzachy:

I gave you the link, didn't I. Let's see ... 10 minutes are equal with 600 seconds. So if Master Time minus Slave Time is bigger-or-equal than 600 second, then you must do something.

Script sample :

Thank you very much. I will try it out and see if it works. Thanks again. By the way, I am sending the signal from master to slave using the same computer. Is there any other system that I could use to link the master and slave on two separate systems?
 
forexrus:
Thank you very much. I will try it out and see if it works. Thanks again. By the way, I am sending the signal from master to slave using the same computer. Is there any other system that I could use to link the master and slave on two separate systems?


and please onewithzachy can you write me that code also .....

LOL

 
deVries:


and please onewithzachy can you write me that code also .....

LOL

He he he, I'm the slave, deVries the master, and time difference is "Back to the Future"
 
deVries:


and please onewithzachy can you write me that code also .....

LOL

lol. of course not. I know this is not poosible by forex trader. I believe I need some sort of email organizer.
 
forexrus:
Thank you very much. I will try it out and see if it works. Thanks again. By the way, I am sending the signal from master to slave using the same computer. Is there any other system that I could use to link the master and slave on two separate systems?

Ever heard FTP ?, Look at MetaEditor on common function. I never use it so I can't really answer that.

 
forexrus:
Thank you very much. I will try it out and see if it works. Thanks again. By the way, I am sending the signal from master to slave using the same computer. Is there any other system that I could use to link the master and slave on two separate systems?

I don't know if named pipes can be used across different PCs . . . use the search box top right of this page and search for named pipes.