applying trailing stop

 

Hello all,

I have finally created my first working EA in mql5. Now i want to code for trailing stop in it.

I know how to code for it in mql4 but mql5 is a completely different game according to the article https://www.mql5.com/en/articles/134, "How to create your own trailing stop". From what i get, it tells about creating a new trailing stop base class from scratch and then using it. 

It would be really helpful if someone can share an example code which utilizes the class CTrailingFixedPips which we just have to include instead of creating a whole new class for trailing.

Can anyone guide me here?

Thanks in advance 

How to Create Your Own Trailing Stop
How to Create Your Own Trailing Stop
  • 2010.08.12
  • Dmitry Fedoseev
  • www.mql5.com
The basic rule of trader - let profit to grow, cut off losses! This article considers one of the basic techniques, allowing to follow this rule - moving the protective stop level (Stop loss level) after increasing position profit, i.e. - Trailing Stop level. You'll find the step by step procedure to create a class for trailing stop on SAR and NRTR indicators. Everyone will be able to insert this trailing stop into their experts or use it independently to control positions in their accounts.