OPEN-SOURCE SCRIPT
Williams %R w/ BB Ultimate [MTF + Hidden Divs]

Williams %R with Bollinger Bands Ultimate [MTF + Hidden & Regular Divergences]
This advanced indicator combines the classic Williams %R oscillator with Bollinger Bands applied to its smoothed value. It is designed to solve the common issues of the standard strategy (whipsaws and lag) by adding Multi-Timeframe capabilities, Confluence Filters, and Dual Divergence detection.
🚀 Key Features
Multi-Timeframe (MTF) Support: Calculate the entire logic (WPR, Bands, Divergences) on a higher timeframe (e.g., 4H) while viewing a lower timeframe chart (e.g., 15m).
No-Repaint Mode: Optional "Wait for closed bar" setting ensures signals are permanent and reliable for alerts.
Dual Divergences: Detects both Regular (Reversal) and Hidden (Trend Continuation) divergences.
Label "R" (Yellow) = Regular Divergence
Label "H" (Orange) = Hidden Divergence
Hybrid Filtering: Filter signals using EMA 200 (Trend), ADX (Volatility), and Volume. Unique feature: choose to calculate these filters on the Indicator's MTF or the Current Chart.
Smart Smoothing: Uses HMA (Hull Moving Average) by default to significantly reduce lag compared to SMA.
Dynamic Visuals: Bars are colored (Green/Red) only when Momentum, Trend, and Volatility filters all align.
💡 How to Trade (Strategy Concept)
This tool is ideal for Swing and Trend Following.
Long Entry: Look for a Green Triangle (Breakout). A stronger signal occurs if preceded by a "D" (Regular Divergence) or "H" (Hidden Bullish Divergence).
Short Entry: Look for a Red Triangle (Breakout).
The "Grey Zone": If the chart bars are grey, the filters (ADX < 20 or Counter-Trend) are actively suppressing low-quality signals. Do not trade.
⚙️ Recommended Settings
Indicator Timeframe: Set to a higher timeframe than your chart (e.g., use "240" (4H) while trading on 15m).
Wait for closed bar: ON (Recommended for validity).
Filter Context: "Current Chart Timeframe" (Allows for precise entries on the lower timeframe while respecting the higher timeframe momentum).
⚠️ Disclaimer This tool is for educational purposes only. Past performance does not guarantee future results. Always manage your risk properly.
Open Source under Mozilla Public License 2.0. Feel free to study the code and adapt it to your needs!
Technical Note regarding Originality & Compliance: To ensure compliance with House Rules regarding Script Originality and Repainting, please note:
Originality: While inspired by the concept of Williams %R + Bollinger Bands, this code is a custom implementation. It introduces original logic not present in standard library scripts, including:
A custom calc_indicator() wrapper to handle complex Multi-Timeframe (MTF) logic.
A hybrid filtering system allowing users to mix contexts (MTF Signal + Current Chart Filter).
A strictly non-repainting state memory for Divergence detection (var variables) specifically adapted for this setup.
Repainting: The script includes a gaps parameter (exposed as "Wait for closed bar") in the request.security() call. The description explicitly warns users that disabling this feature causes repainting, adhering to the publication guidelines.
This advanced indicator combines the classic Williams %R oscillator with Bollinger Bands applied to its smoothed value. It is designed to solve the common issues of the standard strategy (whipsaws and lag) by adding Multi-Timeframe capabilities, Confluence Filters, and Dual Divergence detection.
🚀 Key Features
Multi-Timeframe (MTF) Support: Calculate the entire logic (WPR, Bands, Divergences) on a higher timeframe (e.g., 4H) while viewing a lower timeframe chart (e.g., 15m).
No-Repaint Mode: Optional "Wait for closed bar" setting ensures signals are permanent and reliable for alerts.
Dual Divergences: Detects both Regular (Reversal) and Hidden (Trend Continuation) divergences.
Label "R" (Yellow) = Regular Divergence
Label "H" (Orange) = Hidden Divergence
Hybrid Filtering: Filter signals using EMA 200 (Trend), ADX (Volatility), and Volume. Unique feature: choose to calculate these filters on the Indicator's MTF or the Current Chart.
Smart Smoothing: Uses HMA (Hull Moving Average) by default to significantly reduce lag compared to SMA.
Dynamic Visuals: Bars are colored (Green/Red) only when Momentum, Trend, and Volatility filters all align.
💡 How to Trade (Strategy Concept)
This tool is ideal for Swing and Trend Following.
Long Entry: Look for a Green Triangle (Breakout). A stronger signal occurs if preceded by a "D" (Regular Divergence) or "H" (Hidden Bullish Divergence).
Short Entry: Look for a Red Triangle (Breakout).
The "Grey Zone": If the chart bars are grey, the filters (ADX < 20 or Counter-Trend) are actively suppressing low-quality signals. Do not trade.
⚙️ Recommended Settings
Indicator Timeframe: Set to a higher timeframe than your chart (e.g., use "240" (4H) while trading on 15m).
Wait for closed bar: ON (Recommended for validity).
Filter Context: "Current Chart Timeframe" (Allows for precise entries on the lower timeframe while respecting the higher timeframe momentum).
⚠️ Disclaimer This tool is for educational purposes only. Past performance does not guarantee future results. Always manage your risk properly.
Open Source under Mozilla Public License 2.0. Feel free to study the code and adapt it to your needs!
Technical Note regarding Originality & Compliance: To ensure compliance with House Rules regarding Script Originality and Repainting, please note:
Originality: While inspired by the concept of Williams %R + Bollinger Bands, this code is a custom implementation. It introduces original logic not present in standard library scripts, including:
A custom calc_indicator() wrapper to handle complex Multi-Timeframe (MTF) logic.
A hybrid filtering system allowing users to mix contexts (MTF Signal + Current Chart Filter).
A strictly non-repainting state memory for Divergence detection (var variables) specifically adapted for this setup.
Repainting: The script includes a gaps parameter (exposed as "Wait for closed bar") in the request.security() call. The description explicitly warns users that disabling this feature causes repainting, adhering to the publication guidelines.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。