OPEN-SOURCE SCRIPT
تم تحديثه

W%R Pullback+EMA Trend [TS_Indie]

1 294
🔰 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.
ملاحظات الأخبار
Add a Trading Result Table so that everyone can see the results more easily.
لقطة
In this section, the Profit Factor is calculated using the formula:
(Number of Wins × Risk-Reward Ratio) / Number of Losses
This formula is based on a fixed-risk model, where every losing trade risks the same amount — for example, each loss equals 1% of the account.
Because of this assumption, the calculated Profit Factor will not match the TradingView result, which is based on:
Gross Profit / Gross Loss
In TradingView, each losing trade does not necessarily have the same loss size, since the system doesn’t enforce a fixed-risk amount for every loss.
ملاحظات الأخبار
Expand the TP and SL boxes.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.