OPEN-SOURCE SCRIPT
Trading Sessions with High/Low Levels

Trading Sessions with High/Low Levels
A comprehensive Pine Script indicator for TradingView that provides visual background coloring for major trading sessions along with dynamic high/low level tracking and labeling.
Overview
This advanced indicator combines session background highlighting with precise high/low level detection for each trading session. It tracks and displays the highest and lowest price levels reached during Asia, London, and USA trading sessions, with customizable visual elements including lines, labels, and background colors.
Features
Configuration Options
Background Options:
Session Definition:
Line Options:
Label Options:
High/Low Lines Options
Global Options
Timezone Configuration
Examples:
Key Functionality
Session Tracking
Visual Elements
Display Modes
Limitations
A comprehensive Pine Script indicator for TradingView that provides visual background coloring for major trading sessions along with dynamic high/low level tracking and labeling.
Overview
This advanced indicator combines session background highlighting with precise high/low level detection for each trading session. It tracks and displays the highest and lowest price levels reached during Asia, London, and USA trading sessions, with customizable visual elements including lines, labels, and background colors.
Features
- Three Major Trading Sessions: Asia, London, and USA sessions with default time ranges.
- High/Low Level Tracking: Automatic detection and display of session highs and lows.
- Dynamic Line Drawing: Horizontal lines marking key levels with customizable styling.
- Price Labels: Optional labels showing exact high/low values.
- Session Background Colors: Customizable background highlighting for active sessions.
- Historical Session Display: View multiple previous sessions simultaneously.
- Current Day Filter: Option to display only today's sessions.
- Line Extension Control: Choose between session-bound or current bar extension.
- Timezone Adjustment: Built-in UTC offset adjustment for local timezone compatibility.
- Comprehensive Customization: Individual control over colors, styles, and visibility for each session.
Configuration Options
- Session-Specific Settings: Each trading session includes the following configurable parameters:
Background Options:
- Show session background: Toggle to enable/disable background coloring.
- Session background color: Background color with transparency control.
Session Definition:
- Name: Custom label for the session.
- Session time: Time range in HHMM-HHMM format.
Line Options:
- Show High/Low lines: Toggle to enable/disable level lines.
- Line/Label color: Color for both lines and labels.
- Line width: Thickness of the lines (1-5 pixels).
- Line style: Choose between Solid, Dashed, or Dotted lines.
Label Options:
- Show High/Low labels: Toggle to enable/disable price labels.
- Label text color: Text color for price labels.
- Label size: Choose between Tiny, Small, Normal, or Large.
High/Low Lines Options
- Number of sessions to show lines: Display 1-21 previous sessions (ignored when current day filter is active).
- Only show current day sessions: Filter to display only today's sessions.
- Extend lines to current bar: Choose between session-bound lines or extension to current price action.
Global Options
- UTC Time Zone Adjustment: Offset value (-12 to +14) to match your local timezone.
Timezone Configuration
- The indicator uses a custom UTC offset system. To configure for your timezone:
Examples:
- New York (EST): Set UTC offset to `-5` (or `-4` during DST).
- London (GMT): Set UTC offset to `0` (or `+1` during BST).
- Tokyo (JST): Set UTC offset to `+9`.
- Sydney (AEST): Set UTC offset to `+10` (or `+11` during AEDT).
Key Functionality
Session Tracking
- Real-time Detection: Automatically identifies session start/end times.
- High/Low Calculation: Tracks extreme values throughout each session.
- Historical Storage: Maintains chronological record of completed sessions.
Visual Elements
- Background Coloring: Independent control for each session's background.
- Horizontal Lines: Precise level marking with customizable styling.
- Price Labels: Centered labels showing exact high/low values.
- Line Management: Automatic cleanup of old visual elements.
Display Modes
- Historical View: Show multiple previous sessions for pattern analysis.
- Current Day Focus: Filter to display only today's activity.
- Line Extension: Choose between session-specific or current bar alignment.
Limitations
- Intraday Only: The indicator will display an error on daily, weekly, or monthly timeframes.
- Session Overlap: Multiple sessions may overlap, with colors and lines layering based on execution order.
- Maximum of three sessions: Currently supports three configurable sessions.
- Line Limit: Maximum of 500 lines enforced by TradingView platform.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。