OPEN-SOURCE SCRIPT
Aggiornato 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
Note di rilascio
I updated the chart.Note di rilascio
I typically use either the Double Smooth or the Band Pass. I added inputs for both.Note di rilascio
I made it non-repaintingScript open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
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
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
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
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.