OPEN-SOURCE SCRIPT
W%R Pullback+EMA Trend [TS_Indie]

🔰 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

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

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

• 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.
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
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
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
• 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.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
Get access my indicator : bit.ly/411VJQB
telagram : t.me/Truth_indie
telagram : t.me/Truth_indie
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
Get access my indicator : bit.ly/411VJQB
telagram : t.me/Truth_indie
telagram : t.me/Truth_indie
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。