Trailing Stop for Metatrader 4

 
Hi guys, can someone help me with the trailing stop? I am not much of a coder. Managed to learn this from youtube. All works okay except for the trailing stop. If anyone could lend a hand it would be very helpful. I am looking for a trailing stop which trails upon +30pips or +300 points from the buy or sell line. Which means the moment it goes to +31 pips or +310 points. my Stop Loss would go above/below my buy/sell line by 1 pip or 10 points. And consecutively move up step by step. pip by pip. Therefore at +35 pips and if price moves towards my buy/sell line. it should close at +5 pips. I hope my explanation is detailed enough. Hope I can get some help in this.
Files:
 
avengers_assemble: Hi guys, can someone help me with the trailing stop? I am not much of a coder. Managed to learn this from youtube. All works okay except for the trailing stop. If anyone could lend a hand it would be very helpful. I am looking for a trailing stop which trails upon +30pips or +300 points from the buy or sell line. Which means the moment it goes to +31 pips or +310 points. my Stop Loss would go above/below my buy/sell line by 1 pip or 10 points. And consecutively move up step by step. pip by pip. Therefore at +35 pips and if price moves towards my buy/sell line. it should close at +5 pips. I hope my explanation is detailed enough. Hope I can get some help in this.
There are many trailing-stop examples in the CodeBase. Just to a search and study the code.
MQL5 Code Base
MQL5 Code Base
  • www.mql5.com
MQL5 Source Code Library for MetaTrader 5
Reason: