OPEN-SOURCE SCRIPT

Trend Filtered MACD Strategy

This trading strategy is designed to work on the 4-hour timeframe, using the MACD indicator to identify potential buy (long) or sell (short) signals by detecting overbought or oversold conditions, confirmed with a trend filter based on the EMA (Exponential Moving Average). If the price is above the EMA, it only considers buying opportunities; if below, it looks for selling opportunities. Stop-loss levels are calculated using market volatility (ATR) to minimise risk, while profit targets are based on predefined risk-reward ratios.
Average True Range (ATR)Exponential Moving Average (EMA)Trend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer