Help a newbie - Day and Time functions - page 4

 

If i want to make 4 external input fields for the 4 values 0, 23, 1 and 15. Should it look like this?


extern int StartDay=0;
extern int StopDay=1;
extern int StartTime=23;
extern int StopTime=15;


And then


bool sunday_cond = (TimeDayOfWeek(TimeCurrent())==StartDay) && (Hour()>=StartTime);
bool monday_cond = (TimeDayOfWeek(TimeCurrent())==StopDay) && (Hour()<=StopTime);


Will that work?


I've got no errors when i compile it :)

 
just the same i have written in the meantime, see attachment ;-) LOL
Files:
debug2.mq4  6 kb
 
meikel:
just the same i have written in the meantime, see attachment ;-) LOL

Ha ha funny same thought :-) LOL


Ok i will use your code then.


Thanks!

 

i havent checked the rest of the code, but a such simple return may be not the best way - if an order is open the start should not return.

moving the check if mytradeallowed to another point that doesnt prevent watching open orders would be better.

 
meikel:

i havent checked the rest of the code, but a such simple return may be not the best way - if an order is open the start should not return.

moving the check if mytradeallowed to another point that doesnt prevent watching open orders would be better.


Ok then you need to show me where to put that in.


I've sent u a PM

 

Hey,


Just want to tell that the EA did trade Sunday evening and only Sunday evening, so it works perfect.


Thanks!

Reason: