Download MetaTrader 5

Can someone please add time option to this ea

To add comments, please log in or register
Do you have idle PCs? Connect them to MQL5 Cloud Network and earn money!
Forex Trader
114257
Forex Trader 2010.01.06 18:39 
I need to be able to set the time the EA trades? Any help would be greatly appreciated!
Forex Trader
114257
Forex Trader 2010.01.07 10:56  
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