How to set auto modify SL when reach ở positive SL

 

Hi, I have X positions open and TP & SL preset when entering. I want MT5 to automatically correct SL for positions as soon as the profit condition exceeds Y pips.

For example:

+ With a BUY position if current price > entry Y pips then modify SL = entry + Z

+ With a SELL position if current price < entry Y pips, then modify SL = entry - Z

P/s: Z is the desired positive stop loss.

Please share the code with mql5, thanks 😍

 
hocnv09I want

You have only four choices:

  1. Search for it (CodeBase or Market). Do you expect us to do your research for you?

  2. Try asking at:

  3. MT4: Learn to code it.
    MT5: Begin learning to code it.

    If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

  4. Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2019)

We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help (2017)

 
hocnv09:

Hi, I have X positions open and TP & SL preset when entering. I want MT5 to automatically correct SL for positions as soon as the profit condition exceeds Y pips.

For example:

+ With a BUY position if current price > entry Y pips then modify SL = entry + Z

+ With a SELL position if current price < entry Y pips, then modify SL = entry - Z

P/s: Z is the desired positive stop loss.

Please share the code with mql5, thanks 😍

Vietnamese friend, me too!

If you ask such a question, no one will answer it, because those are so simple things, if you take the time to learn, you will certainly be able to do it yourself.

Good luck, fellow countrymen