You MUST read the Documentation and make sure you understand what it is saying . . don't assume.
Click this link --> Minute() "Returns the current minute (0,1,2,..59) of the last known server time by the moment of the program start (this value will not change within the time of the program execution)." . . . . so for a Server time of 12:34 Minute() will return 34
"this value will not change within the time of the program execution" I think this means from tick to tick, i.e. execution of start() NOT execution of the EA.
string var1=TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES);
Print (var1, " var1");
Produces this print out ? What am I looking at here, seems like it prints randomly skipping days etc.
2011.12.07 08:23:17 2011.10.14 11:55 Time_sampling EURUSD,M15: 2011.10.14 11:55 var1
2011.12.07 08:23:17 2011.10.14 11:55 Time_sampling EURUSD,M15: 2011.10.14 11:55 var1
2011.12.07 08:23:17 2011.10.14 11:55 Time_sampling EURUSD,M15: 2011.10.14 11:55 var1
2011.12.07 08:23:17 2011.10.14 11:55 Time_sampling EURUSD,M15: 2011.10.14 11:55 var1
2011.12.07 08:23:16 2011.10.12 00:59 Time_sampling EURUSD,M15: 2011.10.12 00:59 var1
2011.12.07 08:23:16 2011.10.12 00:59 Time_sampling EURUSD,M15: 2011.10.12 00:59 var1
2011.12.07 08:23:16 2011.10.12 00:59 Time_sampling EURUSD,M15: 2011.10.12 00:59 var1
2011.12.07 08:23:16 2011.10.12 00:58 Time_sampling EURUSD,M15: 2011.10.12 00:58 var1
2011.12.07 08:23:16 2011.10.12 00:58 Time_sampling EURUSD,M15: 2011.10.12 00:58 var1
2011.12.07 08:23:16 2011.10.12 00:58 Time_sampling EURUSD,M15: 2011.10.12 00:58 var1
2011.12.07 08:23:16 2011.10.12 00:57 Time_sampling EURUSD,M15: 2011.10.12 00:57 var1
2011.12.07 08:23:16 2011.10.12 00:57 Time_sampling EURUSD,M15: 2011.10.12 00:57 var1
2011.12.07 08:23:15 2011.10.07 06:51 Time_sampling EURUSD,M15: 2011.10.07 06:51 var1
2011.12.07 08:23:15 2011.10.07 06:51 Time_sampling EURUSD,M15: 2011.10.07 06:51 var1
2011.12.07 08:23:15 2011.10.07 06:51 Time_sampling EURUSD,M15: 2011.10.07 06:51 var1
2011.12.07 08:23:15 2011.10.07 06:51 Time_sampling EURUSD,M15: 2011.10.07 06:51 var1
2011.12.07 08:23:15 2011.10.07 06:51 Time_sampling EURUSD,M15: 2011.10.07 06:51 var1
2011.12.07 08:23:15 2011.10.07 06:51 Time_sampling EURUSD,M15: 2011.10.07 06:51 var1
2011.12.07 08:23:15 2011.10.07 06:51 Time_sampling EURUSD,M15: 2011.10.07 06:51 var1
2011.12.07 08:23:15 2011.10.07 06:50 Time_sampling EURUSD,M15: 2011.10.07 06:50 var1
2011.12.07 08:23:14 2011.10.04 17:42 Time_sampling EURUSD,M15: 2011.10.04 17:42 var1
2011.12.07 08:23:14 2011.10.04 17:42 Time_sampling EURUSD,M15: 2011.10.04 17:42 var1
2011.12.07 08:23:14 2011.10.04 17:42 Time_sampling EURUSD,M15: 2011.10.04 17:42 var1
2011.12.07 08:23:14 2011.10.04 17:42 Time_sampling EURUSD,M15: 2011.10.04 17:42 var1
2011.12.07 08:23:14 2011.10.04 17:42 Time_sampling EURUSD,M15: 2011.10.04 17:42 var1
2011.12.07 08:23:14 2011.10.04 17:42 Time_sampling EURUSD,M15: 2011.10.04 17:42 var1
2011.12.07 08:23:14 2011.10.04 17:42 Time_sampling EURUSD,M15: 2011.10.04 17:42 var1
2011.12.07 08:23:14 2011.10.04 17:42 Time_sampling EURUSD,M15: 2011.10.04 17:42 var1
What am I looking at here,
Take the first line at the top . . . . figure it out . . . here is a clue . .
2011.12.07 08:23:17 | 2011.10.14 11:55 | Time_sampling | EURUSD, | M15: | 2011.10.14 11:55 var1 |
Today/Now | Time in the ST | EA/Script/Indicator name | Instrument | Time Period | Same as "Time in the ST" |
Not sure what your problem is ? if it's why your ST seems to running what ever it is you are running sporadically then I can't help as I can't see your code . . . or what you are doing with it.
I might be looking at this all wrong.
Maybe I simply need to refer to something like if(Time[1] >= 18:00 && Time[1] < 21:00) or some such scheme for creating a timed trade
Can I create a time range using this method ?
I'm really not sure what is a most typical method to create a range of time for placing trades
Thanks for the help everyone, I'll keep reading
Ok, thanks all
I might be looking at this all wrong.
Maybe I simply need to refer to something like if(Time[1] >= 18:00 && Time[1] < 21:00) or some such scheme for creating a timed trade
No, because Time[x] returns a datetime . . . but you can do . . .
if(TimeHour(Time[1]) >= 18 && TimeHour(Time[1]) < 21)
read up on TimeHour
I'll read up and make some code
Thanks
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
https://docs.mql4.com/dateandtime/Hour
Is that all there is to it ?
Please advise
Thanks