fxDreema

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

    Compilation error

    Questions & Answers
    2
    3
    734
    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.
    • R
      Robinfx5 last edited by

      Hi.
      When I compile a test of EA with a Custom Indicator, fxdreema, I did not allow the compilation and pulled out a compilation error message.
      Annex the error message and the file mq4 to please help me identify the cause.

      Thank you very much.

      ......
      Diapositiva1.JPG
      Diapositiva2.JPG
      Solar_Wind_1.mq4

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

        The problem is in this input:
        http://img.prntscr.com/img?url=http://i.imgur.com/BPYtVCt.png

        While everything is fine inside the indicator itself, the EA does not know about this datatype that is defined in the indicator ENUM_PRICE, it also does not know variable/constant with name PRICE__MEDIAN. This enumeration is defined and used in the indicator, but the EA does not have access to it, so from the EA it looks like something undefined.

        I will suggest to change the datatype from ENUM_PRICE to int and the value from PRICE__MEDIAN to 0.

        You can see where possible values of that enumeration are defined up there - PRICE__MEDIAN, PRICE__OPEN, PRICE__CLOSE.... as a numbers they are 0, 1, 2, 3, 4, 5, 6 and 7.

        Enumerations are good because when you add indicator to the chart, you can select from all possible values in that enumeration. There is no need for you to know what value to add - 0, 1, 2, 3... this is hard to remember. So enumerations are way to make input parameters more intuitive. But when when you use that indicator in an EA, they does not seem to work the same way 🙂

        1 Reply Last reply Reply Quote 0
        • R
          Robinfx5 last edited by

          Thank you very much.
          Make the changes you suggested me and compile without error. 🙂 😉

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

          Online Users

          S
          P
          K
          M
          M
          E
          L
          S
          M

          17
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors