Hi coders, please advise how to get the iTime automatically for other respective timeframe's datetime ?
Note that the above example of "PERIOD_M1" is not fixed, I may use other period for my purposes.
If the Print output is "2025.02.14 18:57", I should expect a set of codes to get me the following answers automatically for respective timeframes such as :-
M5 : 2025.02.14 18:55
M15 : 2025.02.14 18:45
M30 : 2025.02.14 18:30
H1 : 2025.02.14 18:00
H4 : 2025.02.14 16:00
D1 : 2025.02.14 00:00
W1 : 2025.02.09 00:00
MN : 2025.02.01 00:00
Thanks
Inserted Code
datetime iTm=iTime(sym,PERIOD_M1,15); // Shift=15 Print(TimeToStr(iTm)); // Output : 2025.02.14 18:57
Note that the above example of "PERIOD_M1" is not fixed, I may use other period for my purposes.
If the Print output is "2025.02.14 18:57", I should expect a set of codes to get me the following answers automatically for respective timeframes such as :-
M5 : 2025.02.14 18:55
M15 : 2025.02.14 18:45
M30 : 2025.02.14 18:30
H1 : 2025.02.14 18:00
H4 : 2025.02.14 16:00
D1 : 2025.02.14 00:00
W1 : 2025.02.09 00:00
MN : 2025.02.01 00:00
Thanks