Error 152 if constant defined
-
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.
-
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
-
It works with "+intervalo"
Thanks !!!