fxDreema

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

    Proper inputs for Custom indicator

    Questions & Answers
    2
    3
    1383
    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.
    • J
      Jnmr1 last edited by

      Hello,
      I have a custom indicator that i'm trying to use in an EA that I don't have the source code to (.EX5). I think the issue i'm having is properly defining the input parameters, I have no problems doing this in MT4 but this is my first attempt at creating one in MT5 and it has dropdown menu options for 3 of the inputs. I have tried many different things but usually the result is error 4002 when testing, changing the data type (int, string), changing the input from how it is named in the indicator to Standard Constants (Typical price, PRICE_TYPICAL).
      I will upload screen shots for reference.

      Any help is greatly appreciated.
      James

      ......
      Untitled1.png
      Untitled2.png
      Untitled3.png

      1 Reply Last reply Reply Quote 0
      • J
        Jnmr1 last edited by

        and the 4th pic

        ......
        Untitle4.png

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

          First check if the number of input parameters is correct.

          Then, for parameter names, you should use the original names, but they are not actually visible. They look like variable names - only latin letters and numbers, no empty space. What you see, for example "Applied Price" is not the real name. In the code you have something like this:

          input ENUM_APPLIED_PRICE AppliedPrice = PRICE_TYPICAL; // Applied Price
          

          I'm not sure about "AppliedPrice", because this exists in the source code.
          ENUM_APPLIED_PRICE is the data type, also known as enumeration, which is some kind of integer data type, but not exactly. You can use "int" anyway, I think there will be no problem.
          PRICE_TYPICAL is the name of one predefined constant that has value of 5. No, "Open price" doesn't mean nothing here.

          Here is about the ENUM_APPLIED_PRICE enumeration: https://docs.mql4.com/constants/indicat ... price_enum

          Parameter values must be correct as well. For example "Open price" is a string value, it is not an "int" or ENUM_APPLIED_PRICE value. You can use PRICE_TYPICAL or even 5 here, but not "Open price" or any other non-numeric value.

          The next thing is the data types, but I don't think this is the problem here. Yes, in the indicator each input parameter probably have different data type (or enumeration), but when you use the indicator form the EA, there should be no problem to use "int" instead of enumeration that is in nature an integer value.

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

          Online Users

          S
          K
          M
          R
          D
          S
          B
          D

          16
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors