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
![Documentation on MQL5: Language Basics / Variables / Input Variables Documentation on MQL5: Language Basics / Variables / Input Variables](https://c.mql5.com/36/26/documentation-on-mql5-language__2.png)
- 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 :)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- 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