How to use Constant for Timeframe
-
Hi Guys,
The Timeframe data type is ENUM_TIMEFRAMES and in "Condition" block, when I choose "Indicator" -> "Moving Average" there is a dropdown list (Combo box) containing all Timeframes to choose. So, I would like Timeframe to be changeable as EAs input (Constant) for back testing. How to do that?
... many thanks in advance
-
@prot82 ENUM_TIMEFRAMES as type, PERIOD_CURRENT as value.
-
It already offer Current Timeframe, but I would like to use 2 Timeframe's Indicators at once, so it has to be some kind of Constant to be able to change in EA's inputs
-
@prot82 That is a constant changeable in the inputs, the timeframes you want to use must be next to each other to use only those 2 in strategy tester.
-
I want to use signals from H1 Timeframe as a main guide and signals from M1 as a local guide for trading
-
@prot82 This is done inside the blocks, you can set up more than 1 with different names, right click and add to the box you need, when in strategy tester set eah up how you like.
-
Sorry bro, but I don't understand you, I would like something like this in picture

-
I use FXDreema only for 3 weeks... I'm very inexperience, sorry
-
@prot82 That is correct but where you have H1/M1 in the constant list you need something like PERIOD_CURRENT instead.
In here you will see all the types:https://docs.mql4.com/constants/chartconstants/enum_timeframes
-
Many, many thanks bro, all works. I only had to enter "1" instead of "M1" and "60" instead of "H1", so no need even for PERIOD_CURRENT at all

-
@prot82 On MT4 you only need to use int as type then minutes in value, 1, 5, 15, 30, 60, 240 etc, doesn't work on mt5 though.
-
Yes, now I see, I only shouldn't use M and H letters
-
period current is the default that we all use regardless of what we want to use. Reason being, its easy to remember...what isn't easy, when you're in the heat of the moment...got on some tunes and you're cranking out some blocks, and you brain fart and say, "damn, was M1 or Month or Minute." This is why he said to just use period current, its a moot point because its selectable as an input later on.
-
Thank you very much