OPEN-SOURCE SCRIPT
Volume Oscillator

Description
The Volume Oscillator measures the momentum of trading volume by calculating the percentage difference between a fast and a slow Simple Moving Average (SMA) of daily volume. It helps traders identify periods of increasing or decreasing market participation, often signaling potential trend strength or exhaustion.
Key Features:
Adaptive to Trading Session:
Automatically adjusts SMA periods based on the actual trading session length (default: 8.5 hours for FTSEMIB, customizable for any market — e.g., 6.5h for US stocks, 24h for crypto).
Fast & Slow SMAs:
Compares a short-term SMA (default 10 days) with a longer-term SMA (default 25 days) of volume.
Oscillator Formula:
100 × (Fast SMA / Slow SMA - 1)
→ Positive values = increasing volume momentum (bullish)
→ Negative values = decreasing volume momentum (bearish)
Signal Line (optional):
A moving average of the oscillator (default 7 days) for smoother trend identification and crossover signals.
Overbought/Oversold Levels:
User-defined horizontal lines (default +40 / -40) to highlight extreme volume conditions.
Customizable Colors:
Change the oscillator and signal line colors to match your chart style.
How to Interpret:
Bullish Conditions:
Oscillator crosses above the zero line
Oscillator crosses above the signal line
Readings near or above +40 may indicate strong buying pressure (watch for possible exhaustion if too extreme)
Bearish Conditions:
Oscillator crosses below the zero line
Oscillator crosses below the signal line
Readings near or below -40 may indicate selling pressure or capitulation
Divergences:
Look for divergences between price and the Volume Oscillator (e.g., price makes new highs but oscillator fails to confirm with higher highs) — a classic sign of weakening momentum.
Best Use Cases:
Indices (FTSEMIB, DAX, CAC, SPX, etc.), stocks and futures with defined trading hours, crypto (set session duration to 24 hours).
Works well on intraday (e.g., 15m, 30m, 1h) and daily charts.
Customization Tips:
- Shorten fast/slow lengths for faster signals (more noise)
- Lengthen them for smoother, longer-term analysis
- Adjust session duration for non-standard market hours
- Enable/disable the signal line in the settings
Note: Volume data quality can vary by symbol and exchange. Always combine this indicator with price action and other tools. Use proper risk management.
The Volume Oscillator measures the momentum of trading volume by calculating the percentage difference between a fast and a slow Simple Moving Average (SMA) of daily volume. It helps traders identify periods of increasing or decreasing market participation, often signaling potential trend strength or exhaustion.
Key Features:
Adaptive to Trading Session:
Automatically adjusts SMA periods based on the actual trading session length (default: 8.5 hours for FTSEMIB, customizable for any market — e.g., 6.5h for US stocks, 24h for crypto).
Fast & Slow SMAs:
Compares a short-term SMA (default 10 days) with a longer-term SMA (default 25 days) of volume.
Oscillator Formula:
100 × (Fast SMA / Slow SMA - 1)
→ Positive values = increasing volume momentum (bullish)
→ Negative values = decreasing volume momentum (bearish)
Signal Line (optional):
A moving average of the oscillator (default 7 days) for smoother trend identification and crossover signals.
Overbought/Oversold Levels:
User-defined horizontal lines (default +40 / -40) to highlight extreme volume conditions.
Customizable Colors:
Change the oscillator and signal line colors to match your chart style.
How to Interpret:
Bullish Conditions:
Oscillator crosses above the zero line
Oscillator crosses above the signal line
Readings near or above +40 may indicate strong buying pressure (watch for possible exhaustion if too extreme)
Bearish Conditions:
Oscillator crosses below the zero line
Oscillator crosses below the signal line
Readings near or below -40 may indicate selling pressure or capitulation
Divergences:
Look for divergences between price and the Volume Oscillator (e.g., price makes new highs but oscillator fails to confirm with higher highs) — a classic sign of weakening momentum.
Best Use Cases:
Indices (FTSEMIB, DAX, CAC, SPX, etc.), stocks and futures with defined trading hours, crypto (set session duration to 24 hours).
Works well on intraday (e.g., 15m, 30m, 1h) and daily charts.
Customization Tips:
- Shorten fast/slow lengths for faster signals (more noise)
- Lengthen them for smoother, longer-term analysis
- Adjust session duration for non-standard market hours
- Enable/disable the signal line in the settings
Note: Volume data quality can vary by symbol and exchange. Always combine this indicator with price action and other tools. Use proper risk management.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.