OPEN-SOURCE SCRIPT
Session Based Liquidity

# Session Based Liquidity Indicator - Educational Open Source
## 📊 Overview
The Session Based Liquidity indicator is a comprehensive educational tool designed to help traders understand and visualize liquidity concepts across major trading sessions. This indicator identifies Buy-Side Liquidity (BSL) and Sell-Side Liquidity (SSL) levels created during Asia, London, and New York trading sessions, providing insights into institutional order flow and potential market reversal zones.
## 🎯 Key Features
### 📈 Multi-Session Tracking
- **Asia Session**: Tokyo/Sydney overlap (20:00-02:00 EST)
- **London Session**: European markets (03:00-07:30 EST)
- **New York Session**: US markets (09:30-16:00 EST)
- Individual session toggle controls for focused analysis
### 💧 Liquidity Level Detection
- **Buy-Side Liquidity (BSL)**: Identifies stop losses above swing highs where short positions get stopped out
- **Sell-Side Liquidity (SSL)**: Identifies stop losses below swing lows where long positions get stopped out
- Advanced filtering algorithm to identify only significant liquidity zones
- Configurable pivot strength for sensitivity adjustment
### 🎨 Visual Management System
- **Unclaimed Levels**: Active liquidity zones that haven't been hit (default: black lines)
- **Claimed Levels**: Swept liquidity zones showing historical interaction (default: red lines)
- Customizable line styles, colors, and widths for both states
- Dynamic label system showing session origin and level significance
- Real-time line extension and label positioning
### ⚙️ Advanced Configuration
- **Pivot Strength**: Adjust sensitivity (1-20) for liquidity detection
- **Max Levels Per Side**: Control number of tracked levels (1-10) per session
- **Label Offset**: Customize label positioning
- **Style Customization**: Full control over visual appearance
## 📚 Educational Value
### Core Concepts Explained
- **Liquidity Pools**: Areas where stop losses and pending orders cluster
- **Liquidity Sweeps**: When price moves through levels to trigger stops, then reverses
- **Session-Based Analysis**: How different market sessions create distinct liquidity characteristics
- **Institutional Order Flow**: Understanding how large players interact with retail liquidity
### Trading Applications
- Identify high-probability reversal zones after liquidity sweeps
- Understand where stop losses are likely clustered
- Avoid trading into obvious liquidity traps
- Use session context for timing entries and exits
- Recognize institutional accumulation and distribution patterns
### Code Learning Opportunities
- **Pine Script v6 Best Practices**: Modern syntax and efficient coding patterns
- **Object-Oriented Design**: Custom types and methods for clean code organization
- **Array Management**: Dynamic data structure handling for performance
- **Visual Programming**: Line, label, and styling management
- **Session Detection**: Time-based filtering and timezone handling
## 🔧 Technical Implementation
### Performance Optimized
- Efficient memory management with automatic cleanup
- Limited historical level tracking to maintain responsiveness
- Optimized array operations for smooth real-time updates
- Smart filtering to reduce noise and focus on significant levels
### Code Architecture
- **Modular Design**: Clean separation of concerns with dedicated methods
- **Type Safety**: Custom SessionLiquidity type for organized data management
- **Extensible Structure**: Easy to modify and enhance for specific needs
- **Educational Comments**: Comprehensive documentation throughout
## 💡 Usage Guide
### Basic Setup
1. Add indicator to chart
2. Configure session times for your timezone
3. Adjust pivot strength based on timeframe (higher for lower timeframes)
4. Enable/disable sessions based on your trading focus
### Interpretation
- **Unclaimed levels**: Watch for price interaction and potential reversals
- **Claimed levels**: Use as potential support/resistance after sweep
- **External levels**: Beyond session range, higher significance
- **Internal levels**: Within session range, may indicate ranging conditions
### Best Practices
- Use higher timeframes (15m+) for cleaner signals
- Combine with price action analysis for confirmation
- Consider session overlap periods for increased significance
- Monitor multiple sessions for comprehensive market view
## 🎓 Educational Goals
This open-source project aims to:
- Demystify liquidity concepts for retail traders
- Provide practical coding examples in Pine Script v6
- Encourage understanding of institutional trading behavior
- Foster community learning and collaboration
- Bridge the gap between theory and practical application
## 📄 License & Usage
Released under Mozilla Public License 2.0 - free for educational and commercial use with proper attribution.
## 🤝 Contributing
As an open-source educational tool, contributions are welcome! Whether it's bug fixes, feature enhancements, or educational improvements, your input helps the trading community learn and grow.
## ⚠️ Disclaimer
This indicator is for educational purposes only. All trading involves risk, and past performance does not guarantee future results. Always practice proper risk management and never risk more than you can afford to lose.
---
*By studying and using this indicator, traders can develop a deeper understanding of market microstructure and improve their ability to read institutional order flow patterns.*
## 📊 Overview
The Session Based Liquidity indicator is a comprehensive educational tool designed to help traders understand and visualize liquidity concepts across major trading sessions. This indicator identifies Buy-Side Liquidity (BSL) and Sell-Side Liquidity (SSL) levels created during Asia, London, and New York trading sessions, providing insights into institutional order flow and potential market reversal zones.
## 🎯 Key Features
### 📈 Multi-Session Tracking
- **Asia Session**: Tokyo/Sydney overlap (20:00-02:00 EST)
- **London Session**: European markets (03:00-07:30 EST)
- **New York Session**: US markets (09:30-16:00 EST)
- Individual session toggle controls for focused analysis
### 💧 Liquidity Level Detection
- **Buy-Side Liquidity (BSL)**: Identifies stop losses above swing highs where short positions get stopped out
- **Sell-Side Liquidity (SSL)**: Identifies stop losses below swing lows where long positions get stopped out
- Advanced filtering algorithm to identify only significant liquidity zones
- Configurable pivot strength for sensitivity adjustment
### 🎨 Visual Management System
- **Unclaimed Levels**: Active liquidity zones that haven't been hit (default: black lines)
- **Claimed Levels**: Swept liquidity zones showing historical interaction (default: red lines)
- Customizable line styles, colors, and widths for both states
- Dynamic label system showing session origin and level significance
- Real-time line extension and label positioning
### ⚙️ Advanced Configuration
- **Pivot Strength**: Adjust sensitivity (1-20) for liquidity detection
- **Max Levels Per Side**: Control number of tracked levels (1-10) per session
- **Label Offset**: Customize label positioning
- **Style Customization**: Full control over visual appearance
## 📚 Educational Value
### Core Concepts Explained
- **Liquidity Pools**: Areas where stop losses and pending orders cluster
- **Liquidity Sweeps**: When price moves through levels to trigger stops, then reverses
- **Session-Based Analysis**: How different market sessions create distinct liquidity characteristics
- **Institutional Order Flow**: Understanding how large players interact with retail liquidity
### Trading Applications
- Identify high-probability reversal zones after liquidity sweeps
- Understand where stop losses are likely clustered
- Avoid trading into obvious liquidity traps
- Use session context for timing entries and exits
- Recognize institutional accumulation and distribution patterns
### Code Learning Opportunities
- **Pine Script v6 Best Practices**: Modern syntax and efficient coding patterns
- **Object-Oriented Design**: Custom types and methods for clean code organization
- **Array Management**: Dynamic data structure handling for performance
- **Visual Programming**: Line, label, and styling management
- **Session Detection**: Time-based filtering and timezone handling
## 🔧 Technical Implementation
### Performance Optimized
- Efficient memory management with automatic cleanup
- Limited historical level tracking to maintain responsiveness
- Optimized array operations for smooth real-time updates
- Smart filtering to reduce noise and focus on significant levels
### Code Architecture
- **Modular Design**: Clean separation of concerns with dedicated methods
- **Type Safety**: Custom SessionLiquidity type for organized data management
- **Extensible Structure**: Easy to modify and enhance for specific needs
- **Educational Comments**: Comprehensive documentation throughout
## 💡 Usage Guide
### Basic Setup
1. Add indicator to chart
2. Configure session times for your timezone
3. Adjust pivot strength based on timeframe (higher for lower timeframes)
4. Enable/disable sessions based on your trading focus
### Interpretation
- **Unclaimed levels**: Watch for price interaction and potential reversals
- **Claimed levels**: Use as potential support/resistance after sweep
- **External levels**: Beyond session range, higher significance
- **Internal levels**: Within session range, may indicate ranging conditions
### Best Practices
- Use higher timeframes (15m+) for cleaner signals
- Combine with price action analysis for confirmation
- Consider session overlap periods for increased significance
- Monitor multiple sessions for comprehensive market view
## 🎓 Educational Goals
This open-source project aims to:
- Demystify liquidity concepts for retail traders
- Provide practical coding examples in Pine Script v6
- Encourage understanding of institutional trading behavior
- Foster community learning and collaboration
- Bridge the gap between theory and practical application
## 📄 License & Usage
Released under Mozilla Public License 2.0 - free for educational and commercial use with proper attribution.
## 🤝 Contributing
As an open-source educational tool, contributions are welcome! Whether it's bug fixes, feature enhancements, or educational improvements, your input helps the trading community learn and grow.
## ⚠️ Disclaimer
This indicator is for educational purposes only. All trading involves risk, and past performance does not guarantee future results. Always practice proper risk management and never risk more than you can afford to lose.
---
*By studying and using this indicator, traders can develop a deeper understanding of market microstructure and improve their ability to read institutional order flow patterns.*
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Making haste Slowly
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Making haste Slowly
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。