coyky Posted July 17, 2009 Report Share Posted July 17, 2009 aloo pls donk gimana buat mqlnya tuk ea supaya bd di set time pemakaiannnya thnks Quote Link to comment Share on other sites More sharing options...
profdixi Posted July 17, 2009 Report Share Posted July 17, 2009 Re: (req )cara buat timer di ea pertama. di setting parameter kita bikin dulu, untuk input datanya misalnya extern string Time_Inputs = " Timing parameters "; extern int StartHour = 0; // Start Hour of Trade Session extern int StartMinute = 0; // Start Minute of Trade Session extern int EndHour = 23; // End Hour of Trade Session extern int EndMinute = 0; // End Hour of Trade Session extern int CloseTimeMode = 0; // CloseTime mode: 0-off,1-on extern int CloseHour = 24; // Trade Close Hour extern int CloseMinute = 0; // Trade Close Minute terus, di logicnya kita masukan saja dibawaha baris int init() bool TimeCondition() { bool result = false; datetime SessionStart = StrToTime(StartHour+":"+StartMinute); datetime SessionEnd = StrToTime(EndHour+":"+EndMinute); if (StartHour < EndHour) result = TimeCurrent() >= SessionStart && TimeCurrent() < SessionEnd; else if (StartHour > EndHour) result = (TimeCurrent() > SessionStart && TimeHour(TimeCurrent()) < 24) ||(TimeHour(TimeCurrent()) >= 0 && TimeCurrent() < SessionEnd); return(result); } macam2 sih tekniknya, bisa juga model simpel begini input parameternya extern bool UseHourTrade = True; extern int FromHourTrade = 8; extern int ToHourTrade = 18; logic nya int start() { if (UseHourTrade){ if (!(Hour()>=FromHourTrade && Hour()<=ToHourTrade)) { Comment("Time for trade has not come else!"); return(0); } } mudah2an bisa membantu.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.