Trailing Stop - Cant seem to get it to work
-
Hi,
I am trying to get a trailing stop to move the stop after it reaches a 1:1 profit and it is not working.
I set my stop loss for a sell, based on the high of the candle the the trade is entered on. Then once the trade gets to 1:1 I want the trade to move to BE and every time the profit jumps 100 percent I want the stop to move again.
So for example, lets say the stop is set to 10 points because that is how far away the current candle high is from the open price of my sell. Then I would like, once my trade is at 10 points profit (1R), the stop to be moved to Break even. Then when my trade moves to 20 points profit (2R), I want the stop to move up 10 more points, which would put the SL at 10 points of profit (1R) and I need this to keep going until I get stopped out.
Here is a link to how I have the sell and then the trailing stop setup, I do not know what part I have wrong.
This is obviously not my whole project just the sell portion, everything works except the trailing stop.
https://fxdreema.com/shared/jxgtqF39c
Any help would be greatly appreciated.
-
You will need variables on a loop to do that. Are you familiar with variables on loops?
-
@l-andorrà yes. That’s what I need to do to get the percent of stop to work?
Thanks for the response!
-
The structure on the left will store the distance in pips of the recently open trade (you will need one variable for buys and another one for sells). Then that value can be used on the trailing stop block as per my example:
https://fxdreema.com/shared/zRIA8st2d
You will need to reset the value of those variables when considered, of course. -
@l-andorrà Ok, I will give that a try. Thanks for the help
-
You're welcome.
-
I’ve had similar issues with trailing stops in fxDreema before, and it’s usually down to how the conditions are set to update. One thing that worked for me was using a variable to track when the trade hits 1R, then adjusting the stop based on that instead of relying on fixed steps. Make sure your trailing stop logic is recalculating on every tick or whenever the profit hits a new level, otherwise, it might not trigger properly. I’d also double-check that your break-even logic isn’t conflicting with the trailing stop—it’s easy to accidentally overwrite one with the other. If nothing else works, sometimes scripting that part directly in MQL can give you more control.