How to find Time frame of current chart

Andriy Moraru  
No, but there are only 21 different timeframes, so you could write your own function that would return string values.
elektor  
enivid:
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 

Andriy Moraru  
elektor:

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");

Reason: