Question about 'Adjust'
-
I have been spending hours trying to figure the following out, but I am still not getting it to work.
-
I am using a condition block where the Stop-loss is below Candle low 1, -8pips (see picture 1), this works correctly.
-
Now I want to replace -8pips by the Constant value (marked in picture 2), but it also needs to be multiplied by " -1" as it needs to check previous candle low -8pips (the constant value is 8, so it should become -8).
How can I achieve this best?

-
-
I dont see whole name for your marked constant, lets say name is Pips_plus_for_trail_Ca
you have at least 3 possibilities how to do ittype into adjust field:
-Pips_plus_for_trail_Ca
and your constant must be typed as 0.0008 (8 pips price fraction for EURUSD, or 0.08 for GBPJPY)or you can make it from mql functions (SymbolInfoDouble(....)) but that is not so elegant

...
admin was thinking about this solution, but I have not tried it yet if it is done:
https://fxdreema.com/forum/topic/4286/10pips/6
so in adjust try this:
-Pips_plus_for_trail_Ca pips
or
-(Pips_plus_for_trail_Ca) pipsor maybe this?
but this is probably not working yet (I have not tried) :
-Pips_plus_for_trail_Ca@pipsif none of them is working for you, try this not recommended solution with function from fxdreema (admin dont recomended this because it must not working 4-ever, after fxdreema update when is here name change of this function it stop working (only project compiling, not previously created EA) and you need rename it if you made some changes in project
) ...
in adjust type:
-(toDigits(Pips_plus_for_trail_Ca,SYMBOL))
or
-(toDigits(Pips_plus_for_trail_Ca,symbol))
or
-(toDigits(Pips_plus_for_trail_Ca,Symbol()))
or
-(toDigits(Pips_plus_for_trail_Ca))...
-
Unfortunately only the not recommended option worked. I ended up using: -toDigits(Pips_plus_for_trail_CandleLow)
I will have to keep this in mind for the future, if it is not supported anymore. Thank you!
-
But I don't recommend using any custom function that I have created. toDigits() is just one of them and I can change it in future without asking anyone.
ConstantName pips should work, this is the official way. If it doesn't work, then I need to know why. But in my little test that I did now it works...
-
I wish I could tell you why it doesn't work with ConstantName pips. I also tried -(ConstantName) pips.
I use two conditions after eachother. Picture one shows it using toDigits, picture 2 shows it with ConstantName pips.
toDigits works correclty. With ConstantName pips, nothing happens. I didn't get any error though.
I hope this helps.

-
Oh no! Completely my fault. I was convinced that I did everything right, but I used the wrong MQL function for this. Indtead of toDigits() I was using toPips()... probably because it sound more like pips. Anyway, it should work now, at least I hope.
-
Seems to work now, thanks!
-
I just noticed that the issue described above in this topic still applies when using the adjust field with Variables instead of Constants. toDigits works VariableName pips doesn't. Any chance you can have a look at this?