fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Timeframe Constant (input)

    Questions & Answers
    2
    16
    5013
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      trooper last edited by

      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

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • T
          trooper last edited by

          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

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            I see, the compiler wants it to be exactly ENUM_TIMEFRAMES. I will see what can I do for this.

            1 Reply Last reply Reply Quote 0
            • T
              trooper last edited by

              I´m glad you understood what I meant.
              Really enjoying using fxDreema. Great tool.

              Will wait for your solution.

              Regards

              1 Reply Last reply Reply Quote 0
              • fxDreema
                fxDreema last edited by

                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 🙂

                1 Reply Last reply Reply Quote 0
                • T
                  trooper last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • fxDreema
                    fxDreema last edited by

                    Also put proper value for this data type: http://prntscr.com/6c6iwm

                    1 Reply Last reply Reply Quote 0
                    • T
                      trooper last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • fxDreema
                        fxDreema last edited by

                        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.

                        1 Reply Last reply Reply Quote 0
                        • T
                          trooper last edited by

                          OK agree. Thank you for that.

                          1 Reply Last reply Reply Quote 0
                          • T
                            trooper last edited by

                            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

                            1 Reply Last reply Reply Quote 0
                            • fxDreema
                              fxDreema last edited by

                              It works for me. Just type true or false (lowercase) under Value

                              1 Reply Last reply Reply Quote 0
                              • T
                                trooper last edited by

                                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

                                1 Reply Last reply Reply Quote 0
                                • fxDreema
                                  fxDreema last edited by

                                  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].

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    trooper last edited by

                                    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.

                                    1 Reply Last reply Reply Quote 0
                                    • 1 / 1
                                    • First post
                                      Last post

                                    Online Users

                                    12
                                    Online

                                    146.8k
                                    Users

                                    22.4k
                                    Topics

                                    122.6k
                                    Posts

                                    Powered by NodeBB Forums | Contributors