How to create Trailing Stoploss in Expert Advisor in MT5
1.Please insert code correctly: when editing a post, click and paste your code in the popup window
2. You are on the forum, no one will allow you to take the discussion aside (do not post your mail).

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
What is a Trailing Stop Loss ?
A trailing stop is a modification of a typical stop order that can be set at a defined percentage or dollar amount away from a security's current market price. For a long position, an investor places a trailing stop loss below the current market price. For a short position, an investor places the trailing stop above the current market price.
I have search online in almost every possible ways to find the code of trailing stop loss but I got nothing. So after making lots of effort and hard work I finally crack it. Now i am going to share with you all guys so that you also can use it. If you are reading this article that means you already knows how trailing works, so I am not going to explain its working.
I have created a trailing function in which I am calculating point and digit before using it because some times it doesn't work with JPY pairs, so I have calculate them separately and use variable later.