Not To Trade During News

 

Hi!

I want to write a function that will allow me to enter at least 3 dates with times as external variables, so that during those times (or for example for two hours after those times) my expert advisor would not make any trades.Can you please point me to the right material where I can learn how to write such code.

Thanks.


* Its for mt4.

 
t0mbfunk:

Hi!

I want to write a function that will allow me to enter at least 3 dates with times as external variables, so that during those times (or for example for two hours after those times) my expert advisor would not make any trades.Can you please point me to the right material where I can learn how to write such code.

Learn what a datetime is . . . and Date and Time functions.
 

https://book.mql4.com/functions/datetime

that should start you off

Reason: