OPEN-SOURCE SCRIPT

Average Volume Label

37
Average Volume Label Indicator
This TradingView Pine Script creates a customizable label that displays the average trading volume over a specified period directly on your price chart.
Core Functionality:

Calculates the simple moving average (SMA) of volume over a user-defined number of days (default: 20 days)
Displays this average in a positioned label at the top of the chart
The label shows text like "20-Day Avg Volume: 1.2M" with automatic volume formatting

Key Customization Options:
Volume Calculation:

Adjustable lookback period (1-200 days) for the volume average

Label Appearance:

Text color, background color, and transparency controls
Five size options (Tiny to Huge)
Configurable horizontal position (how many bars back from the current bar to place the label)

Technical Implementation:

Updates only on the most recent bar to optimize performance
Positions the label at the highest price point within the visible range for consistent top-of-chart placement
Includes safety checks to prevent runtime errors with lookback periods
Also plots the average volume data (visible in the data window for reference)

This indicator is useful for traders who want to quickly assess whether current volume is above or below the recent average without cluttering their chart with additional panes.

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.