Timeframe Constant (input)
-
Hi guys
I´m new to fxDreema and having a little problem trying to create a timeframe constant (input) in MT5. I did some search but couldn´t find an answer.
I tried to set it as text and integer, with diferent display names, and with different values like 60 (in minutes) or H1 (as it appears on the chart in periodicity) or PERIOD_H1. Every way I try I get an error message when I try to compile and generate the ex5 file.
The message says:'MyTimeframe' - cannot convert enum variable 'w' not used
This is an example where I set the MAs timeframes with the constant.
https://fxdreema.com/shared/8GCBtLald
I would appreciate your help
-
Timeframes are integer (whole number) values: http://docs.mql4.com/constants/chartcon ... timeframes As you can see, there are also predefined constants that can be used, like PERIOD_M1 and so on...
Well, their datatype appears to be ENUM_TIMEFRAMES, but you can't set this in fxDreema right now. But int or double should work, everything that is numeric. -
Thanks for your answer.
I did see reference to the constant ENUM_TIMEFRAMES that you mentioned and cannot be set as an option in the Constant type.
Like I said before I did try as integer with different values and it always show the error message when I try to compile it. You can see that in the exampe I posted in my fist post.So if I understood wright you say that we cannot use the timeframe constant in fxDreema at the moment?
Is that somethng that it will be implemented soon?Thanks
-
I see, the compiler wants it to be exactly ENUM_TIMEFRAMES. I will see what can I do for this.
-
I´m glad you understood what I meant.
Really enjoying using fxDreema. Great tool.Will wait for your solution.
Regards
-
I unlocked this field. It's not really intuitive now for all the people that does not know what is this, but I will deal with this later

-
Hmmm. I can now add the type as ENUM_TIMEFRAMES by writing it. However it seems that created some other problems.
Now the type is not drop down anymore and it creates other error messages when I try to compile it that we didn´t have before.Please check it again.
-
Also put proper value for this data type: http://prntscr.com/6c6iwm
-
Yes you wright. I thought I should use it in minutes as in 60 but the correct is PERIOD_H1.
Now is compiling fine. Are you going to leave like this?
Thank you very much.
-
Let's see what the other people will say
I'm not completely sure how it will be better - with drop-down or with free input field. But one is for sure, exotic data types must be available. -
OK agree. Thank you for that.
-
Hi
Another small issue I found.
I´m trying to create a Constant (input) as a boolean type to choose to use or not trailing stop. When I enter bool on the type and click Update, it changes the type to string. Still works that way but the problem is that on the EA parameters you have to write True or False instead o selecting it from a drop down menu. Could you please have a look at that?
Thanks
-
It works for me. Just type true or false (lowercase) under Value
-
Hi
Yes I know the EA works fine but the Constant type is string when it should be bool. When you go to configure the parameters of the EA on the chart you have to type true or false instead of selecting it from a drop down menu. I haven´t tried it but I assume you can´t optimize it that way either. Anyway I changed the constant type manually on the mq5 file on the Metaeditor and now it works as it should.
It would be nice though to be able to choose bool type on the fxDreema Constant (input).
Thanks
-
When you save Constants/Variables, some checks and fixes are done. Checks... because many things needs to be checked, and fixes... because people do things against them and something should fix their errors.
What was your error? It's right here, the very fist letter of False: http://prntscr.com/6d0njg
Yes, %(#0000FF)[false] is one of the two possible values for every boolean values, but it's %(#0000FF)[false], not False. Lowercase! If you try False in MQL4/MQL5 it will give you this error:
__%(#FF0000)['False' - undeclared identifier][/quote:1uu8j1l0]In short, **False **(with capital letter) is considered string. In MQL4/MQL5 this word is not the same as the keyword %(#0000FF)[false].
-
I´m sorry you are completelly wright.
I just realised what you meant by the lowercase. Yes when I set the type as bool and the value as false (lowercase) it does updates as bool and doesn´t change to string.Thank you.