MetaTrader. Trailing Stop

During the years of Forex trading progress a lot of ways to make the trading process more efficient were developed with the help of MetaTrader programming. Among them are Stop Loss, Take Profit and Trailing Stop.

One of the easiest and most effective ways of reducing your losses while trading is Trailing Stop, which is also created by means of mql programming. It is an integrated algorithm and requires a Stop Loss Value for its implementation.

This is how Trailing Stop works. Let us denote Trailing Stop as TS and Stop Loss as SL. When the price increases and profit level reaches the TS level, a new Stop Loss value is set at the SL pips from the current price. Every time the price increases, the Stop Loss Value keeps on changing according to the price. If the price starts decreasing, the Stop Loss value does not change, remaining fixed. This is the nature of Trailing Stop.

Now take a look at the example.

Example of Trailing Stop for BUY order

TS=10, SL=20. Current Bid price=1.4038, Ask=1.4040. Let’s set a BUY order. We get the following features of the opened order: opening price is 1.4040, SL=1.4020. Current profit is -2 pips.

Picture 1. Initial values for the BUY orders.

Picture 1. Initial values for the BUY orders.

The price increased by 10 pips. Ask=1.4050. Current profit is +8 pips. Requirements for triggering of the Trailing Stop algorithm are not met. The price increased by 3 pips more. Ask=1.4053. Current profit is +11 pips. Requirements for triggering of the Trailing Stop algorithm are met. We set a new Stop Loss Value. SL=Ask-20 pips=1.4033.

Picture 2. Stop Loss trailed up for 3 pips.

Picture 2. Stop Loss trailed up for 3 pips.

As soon as the profit level of TS=10 pips is reached, the further price increase causes the SL value to change constantly. Nevertheless, in case the new SL appears to be below the current SL, the value remains unmodified.

Let’s take a look at the example. After a brief decrease the price started increasing again. The current values of the order are: opening price is 1.4040, SL=1.4045, Ask=1.4055, current profit is 13 pips. The requirement for triggering the Trailing Stop algorithm is met. New SL value=1.4033. Since the previous SL value is higher than the new one, it doesn’t get changed due to the work of the algorithm, which is developed on the basis of mql programming.

Picture 3. Order will be closed at current Stop loss position, not at the initial Stop Loss.

Picture 3. Order will be closed at current Stop loss position, not at the initial Stop Loss.

Example of Trailing Stop for SELL order

In case of operating a SELL order the algorithm works in the opposite direction.

Now let’s look at some special TS values.

TS=0. When the TS is set on this level, the SL value starts changing as soon as it surmounts the zero barrier of the profit, which is the value of the current Ask price=1.4042 in the given example.

TS=TP or TS>TP. In this case we can see that the order has to close using the Take Profit value as the closing condition. Under those circumstances the Trailing Stop is disabled. To put it in other words, one has to set the TS value equal to or above the TP value to disable the Trailing Stop, which makes the process more efficient as there is no need to use any additional Trailing Stop disabling algorithm developed through the use of mql programming.

Trailing Stop is the efficient technique in the Forex trading and mql programming.