ATR multiplier in adjust field so SL or TP
-
ATR multiplier in adjust field for SL or TP I need to be optimized. But you have to turn the entire adjust field into a variable and then optimization will work. But the adjust field needs to say *2.8 (for example). If I put * in the adjust field and just type the variable after, then the optimization box won't show up. So basically the * part also needs to be inside the variable when it is defined so optimization box shows up. What data type do I use to make a variable that has a value of *2.8 or is there another way to do this? I already have the ATR with adjust field working just fine and just need this for optimization.
Thanks
-
@kizerage212 You can create a constant and a variable and then do this on the 'on init' tab:

And then this on the 'on tick' tab:

That way it can be optimized.
-
Oh okay. I figured out some other way after I posted this. Actually I just created the ATR multiplier constant as a double data type and simply stuck it in the adjust field like you have there but set to custom (price fraction) and the variable shows up in the optimization settings in mt4 strategy tester (even though you can't tick the optimization box in the adjust field). I assumed if you couldn't tick the optimization checkbox then it wouldn't show up in the strategy tester but if you create a constant variable it automatically shows up in strategy tester (no ticking checkbox required in that case). So then I could easily optimize the value from the strategy tester. It seems to be working. I don't really know anything about the On-init tab. How would that be different?
-
@kizerage212 Well, if it works, it works,
There is no one only way to do things with fxDreema. I suggested this one because this is how I would do it, but that doesn't mean yours is wrong. Good for you for having achieved it!