Modification of Stoploss

I'm working on my own EA based on my trading plan, which is 90% working. When conditions are met it opens a order which a 2:1 reward-risk ratio

The problem is modifying the Stoploss to set to Order price after it passes 50% reward 
Show your attempt if you need coding help.
Alain Verleyen #:
Show your attempt if you need coding help.
Sorry I'm new to the mql4 language 

If your program does not do what it should the debugger will tell you where and why:

Code debugging:
Error Handling and Logging in MQL5:
Tracing, Debugging and Structural Analysis of Source Code, scroll down to: "Launching and Debuggin":

Code debugging - Developing programs - MetaEditor Help
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code...