Can't see what's wrong with the formula
-
I created this simple testing EA (please ignore the custom indicator) and I find a weird behaviour I can't explian.
https://fxdreema.com/shared/VBpv0qycb
I need to calculate te distance for the initial stop loss of my pending orders. I created a formula to include the spread in the calculation that works well for the pending buys but it doesn't for the pending sells (blocks 12, 13 and 23).
I need the initial SL to be 10 pips plus spread above the high of the current Heiken Ashi candle ID 0. When backtesting it. That distance is not added and the HA's high is considered only. I can't see why. Could someone plesse help?
-
@l-andorrà
Hi, this is just a supposition but, from what i see you are trying to add the "spread+10pips" to your high in pips units. But if the spread isn't expressed in pips units but in absolute value like : 1.0003-1.0001 = 0.0002 , then your total value is gona be : 0.0002+0.0010(10pips) = 0.0012 and 0.0012 pips = 0.00000012 so a very little value ^^ and it can be the issue
But maybe that's not -
Thanks for your answer. That's what I guessed, but when I backtested it I saw that thos 10 pips were never added. The SL is sistematically considered the High of the candle no matter what. Maybe I'm missing something in the logic?

-
@l-andorrà
In your block 13 you writted in adjust : +shift_SL_sell pips
which will be something like : +0.0012 pips
The 0.0012 is actually the value you want, so just try to remove the "pips" at the end of the value,
like that : +shift_SL_sell
Maybe it is considered but like that the value added would be too little to be seen. If you express in pips a value which was already expressed in pips, its pips of pips, you divide it 2 times by 10.000 -
Interesting. I will try it. Thanks a lot.