Extended Hours Volume Analysis (AVOL)

This Pine Script indicator calculates and visualizes the extended hours trading volume (premarket + after hours) as a percentage of the stock's average daily volume.
What This Indicator Does
The script:
1. Tracks volume during different market sessions (premarket: 4:00-9:30 AM, regular: 9:30 AM-4:00 PM, and after hours: 4:00-8:00 PM, Eastern Time)
2. Calculates the 21-day simple moving average of daily trading volume
3. Computes the ratio: (Premarket Volume + After Hours Volume) / Average Daily Volume
4. Displays this ratio as a percentage in a histogram format
5. Colors the histogram based on configurable thresholds to indicate low, medium, or high extended hours activity
6. Provides a detailed data table with current volume metrics
Key Features
- **Session Tracking**: Automatically detects and tracks volume in premarket, regular, and after-hours sessions
- **21-Day Average Volume**: Uses a 21-day lookback period (configurable) to establish the baseline average daily volume
- **Visual Alerts**: Color-coded histogram bars change from green to yellow to red as the extended hours volume percentage increases
- **Comprehensive Data Table**: Shows premarket volume, after hours volume, average daily volume, and the extended hours percentage
- **Customizable Thresholds**: Adjustable color-change thresholds to match your specific trading preferences
How to Use This Indicator
This indicator can help traders identify unusual extended hours activity relative to the stock's normal trading pattern. Higher-than-normal extended hours volume often precedes significant price movements in the regular session, potentially indicating where institutional interest lies or where retail traders are reacting to news events.
The color-coding system provides an immediate visual cue about the significance of the current extended hours volume:
- Green: Low extended hours activity (below first threshold)
- Yellow: Moderate extended hours activity (between first and second thresholds)
- Red: High extended hours activity (above second threshold)
Traders can use this information to prepare for potentially volatile opening moves or to identify stocks where significant news or events might be affecting after-hours trading sentiment.
Volumes now reset at the start of each session (PM, REG, AH) — not just once per day.
Fixes volume mixing across sessions.
2. Accurate Extended Hours Volume
extendedHoursVolume updates correctly from live session values, not stale or delayed data.
3. Synced Table Display
Table values now always reflect the current session's volume and AVOL %, without lag or mismatch.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.
Declinazione di responsabilità
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.