Download MetaTrader 5

How to set EA don't trade on Monday and Friday?

To add comments, please log in or register
Siwakon Poonsawat
5298
Siwakon Poonsawat 2015.03.30 09:01 

like this 

 extern monday trade = true/false 

 extern tuesday trade = true/false 

 extern wednesday trade = true/false 

 extern thurday trade = true/false 

 extern friday trade =true/false   

 

and start-end time of working

 extern start time = 00.00

 extern end time = 23.00

 

 Sorry for my Englsh

Thank you very much 

Stuart Browne
5887
Stuart Browne 2015.03.30 09:58  

Hi

Quite easy to do and a number of ways to do it. Check out TimeDayOfWeek and TimeHour for old style MQL4 or MQLDateTime for MQL4&5 structure


Cheers

Ta Hai Hung
37
Ta Hai Hung 2015.03.30 11:34  
zoom200_9:

like this 

 extern monday trade = true/false 

 extern tuesday trade = true/false 

 extern wednesday trade = true/false 

 extern thurday trade = true/false 

 extern friday trade =true/false   

 

and start-end time of working

 extern start time = 00.00

 extern end time = 23.00

 

 Sorry for my Englsh

Thank you very much 

You can use the following code

if(TimeDayOfWeek(TimeCurrent())==1 || TimeDayOfWeek(TimeCurrent())==5){return;}

To add comments, please log in or register