OPEN-SOURCE SCRIPT
Güncellendi

Relative Volume Strategy

148
📈 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
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-repainting

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.