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. קרא עוד בתנאים וההגבלות.