OPEN-SOURCE SCRIPT
已更新 Relative Volume Strategy

📈 Relative Volume Strategy by GabrielAmadeusLau
This Pine Script strategy combines volume-based momentum analysis with price action filtering, breakout detection, and dynamic stop-loss/take-profit logic, allowing for highly adaptable long and short entries. It is particularly suited for traders looking to identify reversals or continuation setups based on relative volume spikes and candle behavior.
🧠 Core Concept
At its core, this strategy uses a Relative Volume %R oscillator, comparing the current volume to its historical range using a Williams %R-like calculation. The oscillator is paired with dual moving average filters (Fast & Slow) to identify when volume is expanding or contracting.
Entries are further refined using a configurable price action filter based on the structure of bullish or bearish candles:
Simple: Basic up/down bar
Filtered: Range-based strength confirmation
Aggressive: Momentum-based breakout
Inside: Reversal bar patterns
Combinations of the above can be toggled for both long and short entries.
⚙️ Configurable Features
Trade Direction Control: Choose between Long Only, Short Only, or Both.
Directional Bar Modes: Set different conditions for long and short bar types (Simple, Filtered, Aggressive, Inside).
Breakout Filter: Optional filter to exclude trades near 5-bar highs/lows to avoid poor R/R trades.
Stop Loss & Take Profit System:
ATR-based dynamic SL/TP.
Configurable multipliers for both SL and TP.
Timed Exit: Optional bar-based exit after a fixed number of candles.
Custom Volume MA Smoothing: Choose from various smoothing algorithms (SMA, EMA, JMA, T3, Super Smoother, etc.) for both fast and slow volume trends.
Relative Volume Threshold: Minimum %R level for trade filtering.
📊 Technical Indicators Used
Relative Volume %R: A modified version of Williams %R, calculated on volume.
Dual Volume MAs: Fast and Slow MAs for volume trends using user-selected smoothing.
ATR: Average True Range for dynamic SL/TP calculation.
Breakout High/Low: 5-bar breakout thresholds to avoid late entries.
🚀 Trade Logic
Long Entry:
Volume > Fast MA > Slow MA
Relative Volume %R > Threshold
Price passes long directional filter
Optional: below recent breakout high
Short Entry:
Volume < Fast MA < Slow MA
Relative Volume %R < 100 - Threshold
Price passes short directional filter
Optional: above recent breakout low
Exits:
After N bars (configurable)
ATR-based Stop Loss / Take Profit if enabled
📈 Visualization
Orange Columns: Relative Volume %R
Green Line: Fast Volume MA
Red Line: Slow Volume MA
💡 Use Case
Ideal for:
Reversal traders catching capitulation or accumulation spikes
Momentum traders looking for volume-confirmed trends
Quantitative strategy developers wanting modular MA and price action filter logic
Intraday scalpers or swing traders using relative volume dynamics
Created by: GabrielAmadeusLau
License: Mozilla Public License 2.0
🔗 mozilla.org/MPL/2.0
This Pine Script strategy combines volume-based momentum analysis with price action filtering, breakout detection, and dynamic stop-loss/take-profit logic, allowing for highly adaptable long and short entries. It is particularly suited for traders looking to identify reversals or continuation setups based on relative volume spikes and candle behavior.
🧠 Core Concept
At its core, this strategy uses a Relative Volume %R oscillator, comparing the current volume to its historical range using a Williams %R-like calculation. The oscillator is paired with dual moving average filters (Fast & Slow) to identify when volume is expanding or contracting.
Entries are further refined using a configurable price action filter based on the structure of bullish or bearish candles:
Simple: Basic up/down bar
Filtered: Range-based strength confirmation
Aggressive: Momentum-based breakout
Inside: Reversal bar patterns
Combinations of the above can be toggled for both long and short entries.
⚙️ Configurable Features
Trade Direction Control: Choose between Long Only, Short Only, or Both.
Directional Bar Modes: Set different conditions for long and short bar types (Simple, Filtered, Aggressive, Inside).
Breakout Filter: Optional filter to exclude trades near 5-bar highs/lows to avoid poor R/R trades.
Stop Loss & Take Profit System:
ATR-based dynamic SL/TP.
Configurable multipliers for both SL and TP.
Timed Exit: Optional bar-based exit after a fixed number of candles.
Custom Volume MA Smoothing: Choose from various smoothing algorithms (SMA, EMA, JMA, T3, Super Smoother, etc.) for both fast and slow volume trends.
Relative Volume Threshold: Minimum %R level for trade filtering.
📊 Technical Indicators Used
Relative Volume %R: A modified version of Williams %R, calculated on volume.
Dual Volume MAs: Fast and Slow MAs for volume trends using user-selected smoothing.
ATR: Average True Range for dynamic SL/TP calculation.
Breakout High/Low: 5-bar breakout thresholds to avoid late entries.
🚀 Trade Logic
Long Entry:
Volume > Fast MA > Slow MA
Relative Volume %R > Threshold
Price passes long directional filter
Optional: below recent breakout high
Short Entry:
Volume < Fast MA < Slow MA
Relative Volume %R < 100 - Threshold
Price passes short directional filter
Optional: above recent breakout low
Exits:
After N bars (configurable)
ATR-based Stop Loss / Take Profit if enabled
📈 Visualization
Orange Columns: Relative Volume %R
Green Line: Fast Volume MA
Red Line: Slow Volume MA
💡 Use Case
Ideal for:
Reversal traders catching capitulation or accumulation spikes
Momentum traders looking for volume-confirmed trends
Quantitative strategy developers wanting modular MA and price action filter logic
Intraday scalpers or swing traders using relative volume dynamics
Created by: GabrielAmadeusLau
License: Mozilla Public License 2.0
🔗 mozilla.org/MPL/2.0
發行說明
I updated the chart.發行說明
I typically use either the Double Smooth or the Band Pass. I added inputs for both.發行說明
I made it non-repainting開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Gabriel Amadeus
The Real World - Stocks Campus:
Stocks, Options, Futures, Forex, Crypto, this is what we trade.
Learn profitable trading systems or build your own, just like I did.
jointherealworld.com/?a=f7jkjpg8kh
The Real World - Stocks Campus:
Stocks, Options, Futures, Forex, Crypto, this is what we trade.
Learn profitable trading systems or build your own, just like I did.
jointherealworld.com/?a=f7jkjpg8kh
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Gabriel Amadeus
The Real World - Stocks Campus:
Stocks, Options, Futures, Forex, Crypto, this is what we trade.
Learn profitable trading systems or build your own, just like I did.
jointherealworld.com/?a=f7jkjpg8kh
The Real World - Stocks Campus:
Stocks, Options, Futures, Forex, Crypto, this is what we trade.
Learn profitable trading systems or build your own, just like I did.
jointherealworld.com/?a=f7jkjpg8kh
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。