Download MetaTrader 5

Can someone please add time option to this ea

To add comments, please log in or register
Forex Trader
114297
Forex Trader  
I need to be able to set the time the EA trades? Any help would be greatly appreciated!
Forex Trader
114297
Forex Trader  
extern string startTime = "07:45";
extern string endTime = "19:45";

bool RightTime()
{
    if (( CurTime() >= StrToTime(startTime) && CurTime() <= StrToTime(endTime)) )
        return (true);
    else
        return (false);
}

in int start() just write

if(!RightTime()) return (0);
To add comments, please log in or register