This non-trading Expert Advisor is designed for the simple trailing of take profit orders of open positions.
Principle of operation: when a new position is opened, the EA checks its take profit order. If there is none, the EA sets a take profit order at the size specified in the EA parameters. Then the EA starts to move the position take profit, if the price moves farther than the distance specified in the settings. Actions are similar to a simple stop loss trailing function.
You can set position type - any/buy/sell, the position symbol (any or the specified one), the magic number (any or the specified one) or the position ticket (any or the specified one). It is also possible to set the take profit trailing in the losing area - if this mode is not selected, take profit will not be trailed in the losing area, and will stop at the breakeven distance from the position open price. The breakeven value can be specified in the EA parameters.
The EA has nine input parameters:
Fig.1 Testing take profit trailing of a Buy position. Take profit is equal to 400 points, trailing step = 10, trailing is only applied in the profitable zone.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/19930
A Simple Expert Advisor The EA opens a position of the specified type at the time specified in the EA parameters. The position is closed at the time specified in the appropriate parameter.NTK 07
Implementation of multiple trailing types. Pending Buy Stop and Sell Stop orders. Limitation of the maximum total lot and the total number of positions. Several types of position volume calculation.