SL = X pips + spread?
-
Hello all,
Can someone tell me how to set SL 7 pips + spread
thanks in advance!
-
try this:
... that SymbolInfoDouble() returns value in points, that means spread 2 pips is returned as 20points, and it is why I divide it with 10 in calculation ... just try it

-
But why?
-
-
Maybe you can check the spread before opening new trade (Spread filter)
-
@fxDreema - But I want the EA to always open the trade, just not get stopped out early because the spread is high
-
This works: http://prntscr.com/e3cfjb Well, it's a little bit ugly that I need to put the SL as a value such as 0.0010
-
And how can i do the formula using ATR, meaning:
SL = ATR + Spread?
-
@jferreira You can adjust accordingly in ATR similar to what fxDreema did above.
However, adding to the SL doesn't account for spread, it just makes SL larger by the spread and the price still needs to account for the spread. So all this does is make a bigger SL.
-
i tried somethin similar and the ea did not load in MT4
i want to have a break even of 1 time the spread and i want it to be activated when the profit is X amount higher/lowerDoes any of you know why the EA did not wanted to load?
Maybe wrong equation? -
If the EA gives error, then something is wrong with the code you wrote
-
That is correct
I was able to fix the issue and now all is working fine