OPEN-SOURCE SCRIPT

W%R Pullback+EMA Trend [TS_Indie]

250
🔰 Core Concept of the Strategy
The main idea is “Trend-Following with Momentum Pullback.”
This means trading in the direction of the main trend (defined by EMA) while using Williams %R to identify pullback entries (buying the dip or selling the rally) where momentum returns to the trend direction.

📊 Indicators Used
1. EMA Fast – Defines the short-term trend.
2. EMA Slow – Defines the long-term trend (used as a trend filter).
3. Williams %R
• Overbought zone: above -20
• Oversold zone: below -80

⚙️ Entry Rules
🔹 Buy Setup
istantanea
1. EMA Fast > EMA Slow → Uptrend condition.
2. Williams %R on the previous candle dropped below -80, and on the current candle, it crosses back above -80 → indicates momentum returning to the upside.
3. Current close is above EMA Fast.
4. Entry Buy at the close of the candle where %R crosses above -80.

🎯 Entry, Stop Loss, and Take Profit
1. Entry: At the candle close where the signal occurs.
2. Stop Loss: At the lowest low between the current and previous candles.
3. Take Profit: Calculated based on entry price and stop loss distance multiplied by the Risk/Reward Ratio.

🔹 Sell Setup
istantanea
1. EMA Fast < EMA Slow → Downtrend condition.
2. Williams %R on the previous candle went above -20, and on the current candle, it crosses back below -20 → indicates renewed selling momentum.
3. Current price is below EMA Fast.
4. Entry Sell at the close of the candle where %R crosses below -20.

🎯 Entry, Stop Loss, and Take Profit
1. Entry: At the candle close where the signal occurs.
2. Stop Loss: At the highest high between the current and previous candles.
3. Take Profit: Calculated based on entry price and stop loss distance multiplied by the Risk/Reward Ratio.

⚙️ Optional Parameters
istantanea
• Custom Risk/Reward Ratio for Take Profit.
• Option to add ATR buffer to Stop Loss.
• Adjustable EMA Fast period.
• Adjustable EMA Slow period.
• Adjustable Williams %R period.
• Option to enable Long only / Short only positions.
• Customizable Backtest start and end date.
• Customizable trading session time.

Alert Function
Alerts display:
• Entry price
• Stop Loss price
• Take Profit price

Guys, try adjusting the parameters yourselves!
I’ve been tweaking the settings for several days and managed to get great results on XAU/USD in the 5-minute timeframe.
I think this strategy is quite interesting and could potentially deliver good results on other instruments as well.

⚠️Disclaimer
This indicator is designed for educational and research purposes only.
It does not guarantee profits and should not be considered financial advice.
Trading in financial markets involves significant risk, including the potential loss of capital.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.