Dmitry Fedoseev / Profile
- Information
14+ years
experience
|
60
products
|
57
demo versions
|
120
jobs
|
0
signals
|
0
subscribers
|
Учебник MQL5 (электронная версия): https://play.google.com/store/books/details?id=M0oREAAAQBAJ
Учебник MQL5 (электронная и бумажная версии): https://ridero.ru/books/programmirovanie_na_yazyke_mql5_ot_osnov_do_indikatorov_i_ekspertov

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.

The problem of calculation of the total position volume of the specified symbol and magic number is considered in this article. The proposed method requests only the minimum necessary part of the history of deals, finds the closest time when the total position was equal to zero, and performs the calculations with the recent deals. Working with global variables of the client terminal is also considered.

In MQL5 you can write an indicator both from a scratch and on the basis of another already existing indicator, in-built in the client terminal or a custom one. And here you also have two ways - to improve an indicator by adding new calculations and graphical styles to it , or to use an indicator in-built in the client terminal or a custom one via the iCustom() or IndicatorCreate() functions.