If you need to add an advanced Trailing Stop to your positions opened manually or by an EA which source code cannot be changed (lost or no coding skills), I offer 4 ready-made most popular Trailing Stops: by High/Low of the previous candle, by Parabolic SAR, by MA and by Fractals. Just install GRat IndiTrade and apply the required template from the Trail.zip file to the required chart with the required timeframe (below is the file itself and a description of how these templates were configured). Or configure your own Trailing Stop by a couple of clicks from the infinite number of possible ones in GRat IndiTrade (e.g., by Ichimoku) by the examples below.
For any Trailing Stop the real SL is to be set at a level equal to the value of the left part of the first comparison of the closing condition:
Trailing Stop by High/Low of the previous candle
In the left part of the first and only comparison of the closing conditions, we set the extremes of the last closed candle (Low for closing Buy and High for closing Sell). The right part is not needed, we only set Empty so that the closing condition does not trigger:
Trailing Stop by Parabolic SAR
In the left part of the Buy and Sell closing conditions, select the Parabolic SAR indicator on the current candle (0):
Trailing Stop by MA
In the left part of the Buy and Sell closing conditions, select the Moving Average indicator on the last closed candle (1):
Trailing Stop by Fractals
In the left part of the closing conditions, select the Fractals indicator and set the extremes on the 3rd closed candle from the current one (Fractals Down to close Buy and Fractals Up to close Sell):
P.S. Add the opening conditions from here to the Trailing Stop by Parabolic SAR, and you'll get a full-fledged EA trading on Parabolic SAR (template TrailParabolicSAR_EA.tpl):