One of the easy and most effective methods to reduce losses when trading Forex is Trailing Stop. Trailing Stop is an integrated algorithm in Metatrader but also it can be implemented as manual algorithm on MQL.
Trailing Stop works as follows. Let’s denote Trailing Stop as TS, Stop Loss – SL. If the price goes up and profit level reaches the TS level, a new Stop Loss value is set at the SL pips from the current price. And it keeps on going on like this every next pip while the price continues to go up. If the price starts to go down, then the Stop Loss value is not changed, remaining fixed. This is the essence of Trailing Stop.
Let’s look at an example. TS=10, SL=20. Current Bid price=1.4038, Ask=1.4040. Let’s set a BUY order. We get the following characteristics of the opened order: opening price is 1.4040, SL=1.4020. Current profit is -2 pips.
The price raised by 10 pips. Ask=1.4050. Current profit is +8 pips. Conditions for triggering of the Trailing Stop algorithm are not satisfied. The price raised by 3 pips more. Ask=1.4053. Current profit is +11 pips. Conditions for triggering of the Trailing Stop algorithm are satisfied. We change the Stop Loss value into new one. SL=Ask-20 pips=1.4033.
After the profit level of TS=10 pips was surmounted, the further price raise causes the SL value to change to new one all the time. However, if the new SL is lower than the current, then the value remains unchanged.
Let’s look at an example. After a short-term lowering, the price started moving up again. The current values of the order are: opening price is 1.4040, SL=1.4045, Ask=1.4055, current profit is 13 pips. Condition for triggering of the Trailing Stop algorithm is satisfied. New SL value=1.4035. As the previous SL value is higher than the new one, then SL doesn’t need to be changed as per the definition of the algorithm.
For the SELL case, the algorithm works in the same way but it considering the direction.
Let’s look at the non-standard values of TS.
TS=0. With such configuration the SL value will start changing at once as soon as it surmounts the zero barrier of the profit. In our example it starts from the value of current Ask price=1.4042 and higher.
TS=TP. From the condition we see that for such configuration the order has to use the exit condition as per Take Profit. With such configuration the Trailing Stop is disabled. In other words, in order to disable Trailing Stop function, one has to set the TS value as equal or higher than the TP. Before the Trailing Stop algorithm is triggered, an order will be automatically closed at the TP level. This configuration is convenient in a way that there is no necessity to use a separate Trailing Stop disabling algorithm.
Metatrader. Protection from MQL decompiling
The article is dedicated to those who encountered such a phenomenon as decompiling and looks for an effective means of protection for their trading strategy.Metatrader Overview. Time Zone Correction.
Time correction functions are useful in Forex trading. MQL allows set correction between desired time and broker server time. Let’s look in depth on time in Metatrader.Metatrader Overview. Break Even.
Break Even is a special logic to save profit while trading Forex. Break Even allows to close order when loss is on zero point.