OPEN-SOURCE SCRIPT
Telah dikemas kini

Relative Volume Strategy

250
📈 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
Nota Keluaran
I updated the chart.
Nota Keluaran
I typically use either the Double Smooth or the Band Pass. I added inputs for both.
Nota Keluaran
I made it non-repainting

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.