fxDreema

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

    Too much Warning!

    Bug Reports
    2
    4
    999
    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.
    • C
      ClauTrade last edited by

      Hallo,

      I know that are only "warning" and the EA work but**, if is possible, I would like to use a full compatible code for MT4.
      **
      Do you think is it possible please?

      These are all:
      http://i.imgur.com/JJD0Imq.png

      %(#FF0000)[The first is about constant/block with bool variable:]

      The worning: "expression is always false"

      This is the bool constant:
      http://i.imgur.com/KYOaRjw.png

      And this the block control:
      http://i.imgur.com/CwNxqw6.png

      And this the code:
      http://i.imgur.com/4dUdQFO.png

      Using bool in the constant I have not find a solution.

      %(#FF0000)[The second is using constant to set TIME FRAME:]

      I have try various solution but I cannot solve the warning!

      I use the set time frame in more block (custom indi too). If I use the setting of the block There are no warning!

      http://i.imgur.com/0aKWslR.png

      And this is the code warning...

      http://i.imgur.com/XZWXfY5.png

      Thanks. Regards.

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

        You can define those timeframe constants with data type ENUM_TIMEFRAMES and instead of values such as 60 and 15, you can use PERIOD_H1 and PERIOD_15. Plus, in the properties of the EA this parameter will appear in a better way, you will see

        1 Reply Last reply Reply Quote 0
        • C
          ClauTrade last edited by

          This is fantastic!! 😄 .. I tried this way buy I had mistake something! 😏 All is perfect now, many thanks!
          If someone want more info about ENUM_TIMEFRAMES constant type this is a good link:
          https://docs.mql4.com/constants/chartco ... timeframes


          Please could you give me a confirmation about the "first problem" too (see my post) ?

          I have find this solution, all work fine now without warning but I'm not sure if is the best way!! ❓

          I have set bool type for constant input but I have used int number (0,1) to compare in block:

          TRUE IS = 1
          FALSE IS = 0

          http://i.imgur.com/BnkwKVH.png

          Many thanks! 🙂

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

            Bool vs Int - this should work fine, even without warnings. 0 is false and 1 is true. Only when you start to mix floating numbers, strings or some exotics you can expect issues 🙂

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

            Online Users

            M
            M
            E
            L
            S
            M
            T
            A
            R

            14
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors