Exploit Strtotime - page 3 123 New comment [Deleted] 2012.11.19 12:03 #21 It's true yes, when there is not a time condition it open positions at every tick after starting EA. I didn't think about that... [Deleted] 2012.11.19 12:09 #22 But in other EA i set it:(OpenSellHour==Hour())&&(OpenSellMinutes==Minute())&&(OpenSellSeconds>=Seconds())) And orders are open on time i choose (opensellhour= 1 for example) Why? Where is the difference? Simon Gniadkowski 2012.11.19 12:42 #23 Kane59: But in other EA i set it: And orders are open on time i choose (opensellhour= 1 for example) Why? Where is the difference? Because of this . . .OpenSellSeconds>=Seconds() So the hour has to match, the minute has to match but the seconds can be more than one second . . . [Deleted] 2012.11.19 12:50 #24 So if i use:extern string TimeDayHighLow="12:43"; datetime Now= TimeCurrent(), TDHL= StrToTime(TimeDayHighLow); if (Now>=TDHL) { //Buy conditions if (O<H)// Si Open B0 < High B1 ou 2 { OrderSend(Symbol(),OP_BUYSTOP,Lot,H,0,0,H+TP1,NULL,MagicHL,iTime(Symbol(), PERIOD_D1, 0 ) + (J*2*86395)); OrderSend(Symbol(),OP_BUYSTOP,Lot,H,0,0,H+TP2,NULL,MagicHL,iTime(Symbol(), PERIOD_D1, 0 ) + (J*2*86395)); //Sell conditions if (O>L)// Si Open B0 > Low B1 ou 2 { OrderSend(Symbol(),OP_SELLSTOP,Lot,L,0,0,L-TP1,NULL,MagicHL,iTime(Symbol(), PERIOD_D1, 0 ) + (J*2*86395)); OrderSend(Symbol(),OP_SELLSTOP,Lot,L,0,0,L-TP2,NULL,MagicHL,iTime(Symbol(), PERIOD_D1, 0 ) + (J*2*86395)); Is it working?or maybe that: extern string TimeDayHighLow="12:43:00"; Simon Gniadkowski 2012.11.19 12:52 #25 Kane59: So if i use:Is it working? That should work for ANY time after 12:42:59 today . . . [Deleted] 2012.11.19 12:56 #26 Lol Ouch !Yes but it can be filtered by a counter example if ticket == 5 Allow open == false. [Deleted] 2012.11.19 13:06 #27 And can i do this and how?extern string TimeDayHighLow="12:43"; if ((Now>=TDHL)&&(Now<=TDHL+"00:00:05") So TDHL + 5 seconds for example.Can add time in string format and how?EDIT:Oh i think i know:string Add="00:00:05"; Addtime= StrToTime(Add) if ((Now>=TDHL)&&(Now<=TDHL+AddTime) Is it correct? Simon Gniadkowski 2012.11.19 14:14 #28 Kane59: And can i do this and how?EDIT:Oh i think i know: Is it correct? No . . . you need to read up on and understand how time is represented in mql4 . . . read up on what a datetime type variable is. If you want to add time you just add the extra time you want to add . . . Simon Gniadkowski 2012.11.19 14:17 #29 Kane59: And can i do this and how? So TDHL + 5 seconds for example.5 seconds is 5 seconds . . . "00:00:05" is 5 seconds past midnight . . . they are not the same. 123 New comment
But in other EA i set it:
And orders are open on time i choose (opensellhour= 1 for example) Why? Where is the difference?But in other EA i set it:
And orders are open on time i choose (opensellhour= 1 for example) Why? Where is the difference?Because of this . . .
OpenSellSeconds>=Seconds()So the hour has to match, the minute has to match but the seconds can be more than one second . . .
So if i use:
Is it working?
or maybe that:
So if i use:
Is it working?
Lol Ouch !
Yes but it can be filtered by a counter
example if ticket == 5
Allow open == false.
And can i do this and how?
So TDHL + 5 seconds for example.
Can add time in string format and how?
EDIT:
Oh i think i know:
Is it correct?And can i do this and how?
EDIT:
Oh i think i know:
Is it correct?And can i do this and how?
So TDHL + 5 seconds for example.