fxDreema

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

    Error 152 if constant defined

    Questions & Answers
    2
    3
    537
    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.
    • E
      emilio last edited by

      The E.A is working fine if I use the +50, but when I try to define a constant "intervalo" with the value +50 give me the error code "152 some operator expected". I´ve tryed to add / delete + and change the type to string/int/double but the result is the same error code.

      Updated a print screen of working fine when the field is directly filled with "+50" (up/left) green squared,

      error code (up /right) and constant definition --> center.

      http://prntscr.com/7gs1h5

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

        Well, Constants are variables, and as such they have values. +50 is a positive value that is actually 50. It will not give you an error if you give such value, it will simply assume that you want to assing the value of 50 and it will do exactly that.

        The Adjust field is a place where you can write any code. This code is then appended to the value of the operand (in MQL4). This code is like continuation of the operand and it must start with one of these + - * or /. But when you use a Constant for it, it does not start with these. The only way is to write it's name, or in your case you can write +intervalo. Yes, if you decide to rename the constant you should also rename it in this block, which is not very elegant

        1 Reply Last reply Reply Quote 0
        • E
          emilio last edited by

          It works with "+intervalo"

          Thanks !!!

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

          Online Users

          H
          H
          M

          13
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors