Day Trading Time

 

I have an EA and I want to open trades from 05:30 to 12:45

How can we code this?



Ionathan

 

M

Something like this to get you started - OTTOMH!


extern int StartHour=5;

extern int EndHour=5;





start()

{

if(TimeHour(TimeCurrent()) < StartHour) return(0); // stop execution



if(TimeHour(TimeCurrent()) > EndHour) return(0); // stop execution



// else carry on here with your process



...

...

}

FWIW

-BB-

 
motocross49:

I have an EA and I want to open trades from 05:30 to 12:45

How can we code this?



Ionathan

Thanks for your help.

Can you add and the minutes?

 
Reason: