Download MetaTrader 5

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

To add comments, please log in or register
Siwakon Poonsawat
5933
Siwakon Poonsawat  

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
6099
Stuart Browne  

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
39
Ta Hai Hung  
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