• Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)

Question How do I add a Timefilter to an EA? Please Help!

ERA

Member
Credits
0
I would love to Add a Timefilter to an EA so that when I am not home I don't risk losing my account. I don't wanna trade during NY session
 
I would love to Add a Timefilter to an EA so that when I am not home I don't risk losing my account. I don't wanna trade during NY session

This question should be posted in the "learning center" area.

upload_2022-9-3_15-10-26.png
 

Attachments

  • upload_2022-9-3_15-10-26.png
    upload_2022-9-3_15-10-26.png
    371.5 KB · Views: 162
I would love to Add a Timefilter to an EA so that when I am not home I don't risk losing my account. I don't wanna trade during NY session

here the code:

Code:
// MQL5
MqlDateTime mTime;
input int t_start = 8;  //Start
input int t_end   = 17; //End

bool time_filter() {
bool hour_limit = true;
if(mTime.hour >= t_start && mTime.hour <= t_end) hour_limit=false;
return(hour_limit);
}
 
here the code:

Code:
// MQL5
MqlDateTime mTime;
input int t_start = 8;  //Start
input int t_end   = 17; //End

bool time_filter() {
bool hour_limit = true;
if(mTime.hour >= t_start && mTime.hour <= t_end) hour_limit=false;
return(hour_limit);
}
Thank you very much! I really appreciate it. And thank you to the other persons for responding
 
here the code:

Code:
// MQL5
MqlDateTime mTime;
input int t_start = 8;  //Start
input int t_end   = 17; //End

bool time_filter() {
bool hour_limit = true;
if(mTime.hour >= t_start && mTime.hour <= t_end) hour_limit=false;
return(hour_limit);
}
Thank you for the information.

trade time

start hour:
start minute:
end hour:
end minute:


all trade hard close time

hard close hour:
hard close minute:

How do we add this?
 
Programing language is very complicated for me
It is the reason I like manual trading.
You could always get someone to program your manual strategy for you or look for EA's that are a good fit for you, and that way you dont have to be at the computer all the time.
 
extern int a=0;
extern int b=24;

simple ...find codition for buy sel and add
if(....................&&Hour()>a&&Hour()<b) .........
 
Back
Top