Saturday, 22 September 2012

USE TIME RANGE kedalam EA

ni kat atas skali (global variable)

double tempTimeStartTrade, tempTimeFinishTrade, tempCurrentTime;

ni sumbat dlm int init()

tempTimeStartTrade=(HoursStartTrade*100)+MinuteSta rtTrade;
tempTimeFinishTrade=(HoursFinishTrade*100)+MinuteF inishTrade;


ni dalam int start() ( mula2 skali lepas tanda "{" )

if (TradeTime()==false) return;

pastu last, paste sume2 ni kat bawahhhh skali... (new module)

bool TradeTime()
{
tempCurrentTime=(Hour()*100)+Minute();


if(tempTimeStartTrade<tempTimeFinishTrade)
{

if (tempCurrentTime>=tempTimeStartTrade && tempCurrentTime<=tempTimeFinishTrade)

return(true);
}
else if(tempTimeStartTrade>tempTimeFinishTrade)
{
if (tempCurrentTime>=tempTimeStartTrade || tempCurrentTime<=tempTimeFinishTrade)
return(true);
}

return(false);
}



ni kod aku la, tak tau kalo ada simple lagik...

No comments:

Post a Comment