Hi
Is there a way to limit the periods available in the ea input for the ENUM_TIMEFRAMES like to only show and PERIOD_H1?
I tried few ways but could not get it to work.
Thanks
You can refer to https://www.mql5.com/en/docs/basis/variables/inputvariables, specifically, under the header:
Enumerations as input Parameters

- www.mql5.com
Something like
enum tf { H1=60, H4=240, };
Something like
enum tf { H1=PERIOD_H1, H4=PERIOD_H4 };Don't hardcode period values.
Hi
Is there a way to limit the periods available in the ea input for the ENUM_TIMEFRAMES like to only show and PERIOD_H1?
I tried few ways but could not get it to work.
Thanks
Enums are based on integers, so you can just create new
1 . enum like sugested above
2. # define
3 .just use integer variable
4 .do mix of define and enum - my advice is to use #define ...this is very very very very very very very very very very usfull. I recomend to invest time to lern everything about it :)

- 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 way to limit the periods available in the ea input for the ENUM_TIMEFRAMES like to only show and PERIOD_H1?
I tried few ways but could not get it to work.
Thanks