Hi all. I am just starting to learn mql4. I want the ea I make to only work during certain times. I am struggling to get it right.
Here is my code:
extern datetime start_t = D'06:00';
extern datetime end_t = D'14:00';
int start()
{
if (TIME_MINUTES > start_t & TIME_MINUTES < end_t)
{
Print ("Trading Time");
return;
} // Exit from start()
}
Does this look right to anyone?
I think its working but I dont no how to check. Or is there a better way to do it?
Here is my code:
extern datetime start_t = D'06:00';
extern datetime end_t = D'14:00';
int start()
{
if (TIME_MINUTES > start_t & TIME_MINUTES < end_t)
{
Print ("Trading Time");
return;
} // Exit from start()
}
Does this look right to anyone?
I think its working but I dont no how to check. Or is there a better way to do it?