This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community

Can someone please add time option to this ea


Back to topics list
avatar
6
gangsta1 2010.01.06 18:39 
I need to be able to set the time the EA trades? Any help would be greatly appreciated!
Attached files:
  Gangsta1_noBuffer.ex4 (8.09 KB)
avatar
2
SiFox 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);
Back to topics list  
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets