OPEN-SOURCE SCRIPT
Güncellendi

Volume Oscillator

2 587
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.
Sürüm Notları
What’s New / Changed
Core Calculation Overhaul
The oscillator now calculates the fast and slow SMAs directly on the chart’s native volume instead of pulling daily volume via request.security.
This makes the indicator fully responsive to the selected timeframe while still scaling the SMA lengths according to the session duration (in “days”).

  • Signal Line Always Active
  • The signal line is now permanently enabled (the previous on/off toggle has been removed).
  • Simplified Styling
  • Color inputs have been removed. Oscillator → fixed purple
  • Signal line → fixed silver


New Weekly Background
A light purple background highlight is now drawn at the start of every new week (bgcolor on weekly change) for easier visual orientation.

Code Cleanup
Removed unused inputs and simplified the plotting section.

Notes
The “Session Duration (hours)” input remains and is still used to convert the desired SMA lengths (in days) into the correct number of bars for the current timeframe.
Default parameters (10 / 25 / 7) are unchanged.

Enjoy the cleaner and more timeframe-adaptive version!

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.