OPEN-SOURCE SCRIPT
Session Volume Analyzer [JOAT]

Session Volume Analyzer — Global Trading Session and Volume Intelligence System
This indicator addresses the analytical challenge of understanding market participation patterns across global trading sessions. It combines precise session detection with comprehensive volume analysis to provide insights into when and how different market participants are active. The tool recognizes that different trading sessions exhibit distinct characteristics in terms of participation, volatility, and volume patterns.
Why This Combination Provides Unique Analytical Value
Traditional session indicators typically only show time boundaries, while volume indicators show raw volume data without session context. This creates analytical gaps:
1. **Session Context Missing**: Volume spikes without session context provide incomplete information
2. **Participation Patterns Hidden**: Different sessions have different participant types (retail, institutional, algorithmic)
3. **Comparative Analysis Lacking**: No easy way to compare volume patterns across sessions
4. **Timing Intelligence Absent**: Understanding WHEN volume occurs is as important as HOW MUCH volume occurs
This indicator's originality lies in creating an integrated session-volume analysis system that:
**Provides Session-Aware Volume Analysis**: Volume data is contextualized within specific trading sessions
**Enables Cross-Session Comparison**: Compare volume patterns between Asian, London, and New York sessions
**Delivers Participation Intelligence**: Understand which sessions are showing above-normal participation
**Offers Real-Time Session Tracking**: Know exactly which session is active and how current volume compares
Technical Innovation and Originality
While session detection and volume analysis exist separately, the innovation lies in:
1. **Integrated Session-Volume Architecture**: Simultaneous tracking of session boundaries and volume statistics creates comprehensive market participation analysis
2. **Multi-Session Volume Comparison System**: Real-time calculation and comparison of volume statistics across different global sessions
3. **Adaptive Volume Threshold Detection**: Automatic identification of above-average volume periods within session context
4. **Comprehensive Visual Integration**: Session backgrounds, volume highlights, and statistical dashboards provide complete market participation picture
How Session Detection and Volume Analysis Work Together
The integration creates a sophisticated market participation analysis system:
**Session Detection Logic**: Uses Pine Script's time functions to identify active sessions
// Session detection based on exchange time
bool inAsian = not na(time(timeframe.period, asianSession))
bool inLondon = not na(time(timeframe.period, londonSession))
bool inNY = not na(time(timeframe.period, nySession))
// Session transition detection
bool asianStart = inAsian and not inAsian[1]
bool londonStart = inLondon and not inLondon[1]
bool nyStart = inNY and not inNY[1]
**Volume Analysis Integration**: Volume statistics are calculated within session context
// Session-specific volume accumulation
if asianStart
asianVol := 0.0
asianBars := 0
if inAsian
asianVol += volume
asianBars += 1
// Real-time session volume analysis
float asianAvgVol = asianBars > 0 ? asianVol / asianBars : 0
**Relative Volume Assessment**: Current volume compared to session-specific averages
float volMA = ta.sma(volume, volLength)
float volRatio = volMA > 0 ? volume / volMA : 1
// Volume classification within session context
bool isHighVol = volRatio >= 1.5 and volRatio < 2.5
bool isVeryHighVol = volRatio >= 2.5
This creates a system where volume analysis is always contextualized within the appropriate trading session, providing more meaningful insights than raw volume data alone.
Comprehensive Session Analysis Framework
**Default Session Definitions** (customizable based on broker timezone):
- **Asian Session**: 1800-0300 (exchange time) - Represents Asian market participation including Tokyo, Hong Kong, Singapore
- **London Session**: 0300-1200 (exchange time) - Represents European market participation
- **New York Session**: 0800-1700 (exchange time) - Represents North American market participation
**Session Overlap Analysis**: The system recognizes and highlights overlap periods:
- **London/New York Overlap**: 0800-1200 - Typically the highest volume period
- **Asian/London Overlap**: 0300-0300 (brief) - Transition period
- **New York/Asian Overlap**: 1700-1800 (brief) - End of NY, start of Asian
**Volume Intelligence Features**:
1. **Session-Specific Volume Accumulation**: Tracks total volume within each session
2. **Cross-Session Volume Comparison**: Compare current session volume to other sessions
3. **Relative Volume Detection**: Identify when current volume exceeds historical averages
4. **Participation Pattern Analysis**: Understand which sessions show consistent high/low participation
Advanced Volume Analysis Methods
**Relative Volume Calculation**:
float volMA = ta.sma(volume, volLength) // Volume moving average
float volRatio = volMA > 0 ? volume / volMA : 1 // Current vs average ratio
// Multi-tier volume classification
bool isNormalVol = volRatio < 1.5
bool isHighVol = volRatio >= 1.5 and volRatio < 2.5
bool isVeryHighVol = volRatio >= 2.5
bool isExtremeVol = volRatio >= 4.0
**Session Volume Tracking**:
// Cumulative session volume with bar counting
if londonStart
londonVol := 0.0
londonBars := 0
if inLondon
londonVol += volume
londonBars += 1
// Average volume per bar calculation
float londonAvgVol = londonBars > 0 ? londonVol / londonBars : 0
**Cross-Session Volume Comparison**:
The system maintains running totals for each session, enabling real-time comparison of participation levels across different global markets.
What the Display Shows
- Session Backgrounds — Colored backgrounds indicating which session is active
- Pink: Asian session
- Blue: London session
- Green: New York session - Session Open Lines — Horizontal lines at each session's opening price
- Session Markers — Labels (AS, LN, NY) when sessions begin
- Volume Highlights — Bar coloring when volume exceeds thresholds
- Orange: High volume (1.5x+ average)
- Red: Very high volume (2.5x+ average) - Dashboard — Current session, cumulative volume, and averages
Color Scheme
- Asian — #E91E63 (pink)
- London — #2196F3 (blue)
- New York — #4CAF50 (green)
- High Volume — #FF9800 (orange)
- Very High Volume — #F44336 (red)
Inputs
Session Times:
- Asian Session window (default: 1800-0300)
- London Session window (default: 0300-1200)
- New York Session window (default: 0800-1700)
Volume Settings:
- Volume MA Length (default: 20)
- High Volume threshold (default: 1.5x)
- Very High Volume threshold (default: 2.5x)
Visual Settings:
- Session colors (customizable)
- Show/hide backgrounds, lines, markers
- Background transparency
How to Read the Display
- Background color shows which session is currently active
- Session open lines show where each session started
- Orange/red bars indicate above-average volume
- Dashboard shows cumulative volume for each session today
Alerts
- Session opened (Asian, London, New York)
- High volume bar detected
- Very high volume bar detected
Important Limitations and Realistic Expectations
- Session times are approximate and depend on your broker's server timezone—manual adjustment may be required for accuracy
- Volume data quality varies significantly by broker, instrument, and market type
- Cryptocurrency and some forex markets trade continuously, making traditional session boundaries less meaningful
- High volume indicates participation level only—it does not predict price direction or market outcomes
- Session participation patterns can change over time due to market structure evolution, holidays, and economic conditions
- This tool displays historical and current market participation data—it cannot predict future volume or price movements
- Volume spikes can occur for numerous reasons unrelated to directional price movement (news, algorithmic trading, etc.)
- Different instruments exhibit different session sensitivity and volume patterns
- Market holidays and special events can significantly alter normal session patterns
Appropriate Use Cases
This indicator is designed for:
- Market participation pattern analysis
- Session-based trading schedule planning
- Volume context and comparison across sessions
- Educational study of global market structure
- Supplementary analysis for session-based strategies
This indicator is NOT designed for:
- Standalone trading signal generation
- Volume-based price direction prediction
- Automated trading system triggers
- Guaranteed session pattern repetition
- Replacement of fundamental or sentiment analysis
Understanding Session Analysis Limitations
Session analysis provides valuable context but has inherent limitations:
- Session patterns can change due to economic conditions, holidays, and market structure evolution
- Volume patterns may not repeat consistently across different market conditions
- Global events can override normal session characteristics
- Different asset classes respond differently to session boundaries
- Technology and algorithmic trading continue to blur traditional session distinctions
— Made with passion by officialjackofalltrades
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
#1 Full Stack AI Trading Community — jackofalltrades.vip | 2026: The Era of AI Trading Mastery📈 AI Automation • AI Trading Bots • Indicators • Strategies • Limitless Potential • Institutional Grade Products • t.me/jackofalltradesvip
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
#1 Full Stack AI Trading Community — jackofalltrades.vip | 2026: The Era of AI Trading Mastery📈 AI Automation • AI Trading Bots • Indicators • Strategies • Limitless Potential • Institutional Grade Products • t.me/jackofalltradesvip
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.