Sidelining EA's programmer's requested...

 

I would like to know if someone has already developed a code that can be attached to any EA which allows for the user to define trading times of day for the EA to go into standby mode and not execute.

It's obvious that certain times of day are better for different strategies. It seems self evident that having such a code which would allow the user to toggle the strategy on and off based on preset times of day would make it easy to manage.

I'm thinking it would be good to be able to define how many times you want it to turn on and off and then define the specific time periods of on times and off times.

Is this already available or would someone like to do it for us?

 

It is timefilter.

For example this one.

in the beginning of the code:

extern bool UseHourTrade = True;

extern int FromHourTrade = 8;

extern int ToHourTrade = 19;[/CODE]

And after int start()

[CODE]if (UseHourTrade){

if(!(Hour()>=FromHourTrade&&Hour()<=ToHourTrade)){

Comment("Non-Trading Hours!");

return(0);

}

}

It is just for example.

 

wow, thanks ND!

hey I just put that on my first EA and it looks like it works. I'm not a programmer ya know, it's confused me alot i've just been looking at code, staring at it and perhaps some of it starting to make some kind of sense, at least I can follow directions eh?

now if I just knew why this doesn't seem to be executing ANY orders?

Files:
1-2_punch_1.mq4  11 kb
Reason: