Add trailing stop to the Tradingview strategy

Job ID: 34146322

Budget: €30 – €250 EUR

I need to add trailing in my Tradingview strategy based on MACD. The main issue is that strategy is working on the 4H timeframe, while trailing must be calculated on the less timeframe to be accurate for backtesting and real trading based on webhooks. Screenshots of the strategy are attached to the project description. I will be glad to provide any additional information if you need it.
Related categories: Risk Management Pine Script Trading