How to find Time frame of current chart
No, but there are only 21 different timeframes, so you could write your own function that would return string values.
But I would need some function which could atleast return a symbolic representation of the time frame so that I can use it to return. Is there a function which can do this?
I see the enumeration ENUM_TIMEFRAMES, is there some way to use this?
Regards
But I would need some function which could atleast return a symbolic representation of the time frame so that I can use it to return. Is there a function which can do this?
I see the enumeration ENUM_TIMEFRAMES, is there some way to use this?
Regards
Thanks Amir,
I ran the code over the 5minute time frame versus a 1Hour time frame. I correctly got the 5 in the 5 min Time frame but I get 16385 when I run it over the 1 hour timeframe. How is this to be interpreted?
Thanks Amir,
I ran the code over the 5minute time frame versus a 1Hour time frame. I correctly got the 5 in the 5 min Time frame but I get 16385 when I run it over the 1 hour timeframe. How is this to be interpreted?
Are you trying to Print() it? Try doing it this way:
if (Period() == PERIOD_H1) Print("1 hour");
You could check out
int PeriodSeconds(PERIOD_CURRENT) /it returns the timeframe in seconds and you can convert from there/

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Is there a function to get the time frame of the current chart in string format?
Regards