how can i add timefilter in ea

 
Abdul Salam:
can someone help me to add time filter in my ea.

This is a general topic, you can research it.

extern int StartHour=1;

extern int StopHour=24;

.

.

.

BuyMode= .... &&  Hour()>=StartHour  && Hour()<=StopHour;

--------------------------------------------------------------------------------

extern int StartDay=1;

extern int StopDay=31;

.

.

.

BuyMode= .... && Day()>StartDay  && Day()< StopDay ;

----------------------------------------------------------------------------------

extern int week=1;     //  (0-Sunday,1,2,3,4,5,6)

.

.

.

BuyMode= .... && DayOfWeek()==week ;


----------------------------------------------------------------------------------

Be sure to read this     https://docs.mql4.com/dateandtime

Date and Time - MQL4 Reference
Date and Time - MQL4 Reference
  • docs.mql4.com
This is the group of functions for working with data of datetime type (an integer that represents the number of seconds elapsed from 0 hours of January 1, 1970). What's new in MQL5 Thus, the new...
 

Time Filter Code Sample => https://sites.google.com/site/AIS1SUPERROBOT

See MODULE 3 : CONTROL

1

2

Files:
 
Abdul Salam: can someone help me to add time filter in my ea.
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum