Candle high/low Upon/Below 15/-15 EMA Sell/Buy
-
Hello,
Thank you for your tool and congratulation, it's hard to find something not doable with your platform.
I am trying to create a robot which sells 15 pips upon 12 EMA and 15 pips below 12 EMA when the slope of the 150 EMA gives the right trend direction. The project is "BOH".
Reading previous posts I have seen how to do so, using adjust in the conditions. Now I would like to know if it is truly possible to use constants to set the adjustment amount in the optimisation.
Because if I try to it gives me an error 152 and says a parameter is expected.Can you advise me on what to do to get it running properly?
Thank you
-
It is possible, but not in the same way. You can write the MQL4/MQL5 name of the variable in the field and it should work. You can see the name in Constants, under "MQL name"
-
Thank you, you have been very clear. I am gonna try now
-
It's not working yet, I found MQL name but it keeps giving error, what am I doing wrong?
-
I'm looking at your projects, but I can't find one named "BOH" or even one that has Constants defined

-
I understood what was the problem. I used to put + or - into the constant, while I just should put a fixed value for the constant and to compile the ex4 file is needed adjust to have + or - before the name of the constant.
I was not putting the operator + or - into the adjust field.
-
Yes, this field is not only used to add a value, you can write whatever you want there and it will be put as it is in the final file. The content of this field is appended to the value of the operand, you can see how it works if you look at the code of that block.