The
sixth part of the article about the universal Expert Advisor describes
the use of the trailing stop feature. The article will guide you through
how to create a custom trailing stop module using unified rules, as
well as how to add it to the trading engine so that it would
automatically manage positions.
A Trailing Stop is a kind of algorithm, and its only task is to move a
stop-loss order to a certain price level in order to protect a position
from excessive loss. Trailing stop algorithms are external in relation to the trading
engine. This means that their presence, as well as their absence in no
way should affect the functionality of CStrategy. In addition, the trailing algorithms require the configuration of
certain parameters. For example, for a classic trailing stop we need to
specify the distance in pips between the reached extreme price values
and the stop-loss level, which we want to be managed. Therefore, in
addition to the algorithms themselves, we need to store their operation
parameters somewhere.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
New article Universal Expert Advisor: A Custom Trailing Stop (Part 6) has been published:
The sixth part of the article about the universal Expert Advisor describes the use of the trailing stop feature. The article will guide you through how to create a custom trailing stop module using unified rules, as well as how to add it to the trading engine so that it would automatically manage positions.
A Trailing Stop is a kind of algorithm, and its only task is to move a stop-loss order to a certain price level in order to protect a position from excessive loss. Trailing stop algorithms are external in relation to the trading engine. This means that their presence, as well as their absence in no way should affect the functionality of CStrategy. In addition, the trailing algorithms require the configuration of certain parameters. For example, for a classic trailing stop we need to specify the distance in pips between the reached extreme price values and the stop-loss level, which we want to be managed. Therefore, in addition to the algorithms themselves, we need to store their operation parameters somewhere.
Author: Vasiliy Sokolov