OPEN-SOURCE SCRIPT
Güncellendi 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
Sürüm Notları
I updated the chart.Sürüm Notları
I typically use either the Double Smooth or the Band Pass. I added inputs for both.Sürüm Notları
I made it non-repaintingAçık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
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
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
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
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.