Date timing and stop / start trading

 

Hi All,

I'm looking for a bit of code which I could put into my EA which would stop trading if there's a certain date and start again. I would have a remote text file with these dates. 

Does anyone have anything which i could use?

 
Alan Lee:

Hi All,

I'm looking for a bit of code which I could put into my EA which would stop trading if there's a certain date and start again. I would have a remote text file with these dates. 

Does anyone have anything which i could use?

The simplest would be to check current date : 

string day = TimeToString(TimeCurrent(),TIME_DATE);

and compare it with a string in the same format extracted from the text file 

if (day == datefromtextfile) { EnableTrading = false; }
Reason: