OPEN-SOURCE SCRIPT
Updated

Sessions BrockJava

56
This script is a flexible, timezone-aware Session High/Low indicator for TradingView. It is based on the original work of kurtsmock (Mozilla Public License 2.0) and includes enhancements for UTC offset handling and autoscale compatibility.

Features:
  • Tracks and plots the highest and lowest prices within user-defined trading sessions.
  • Session times default to UTC, but you can set a custom UTC offset (e.g., -4 for New York, 0 for London, +8 for Singapore).
  • Reset modes: by session, by a set number of hours, or daily.
  • Backtesting support: specify a date range to limit indicator activity to historical periods.
  • Session constraint: restricts operation to specific sessions, with optional weekend inclusion for crypto or 24/7 markets.
  • Visual customization: choose to display session high/low as lines, background color, or filled regions. All colors and transparencies are user-configurable.
  • Efficient plotting: session levels are always included in TradingView’s autoscale, so you never lose sight of key levels.


Technical details:
  • Session definition uses TradingView’s session string format (e.g., 1800-1500).
  • Timezone handling is automatic and accurate, even with custom offsets.
  • Designed for high efficiency, supporting up to 5000 bars back and 500 lines.


Credit:
Major credit to kurtsmock, the original author. This version adds UTC offset and improved autoscale support.
License: Mozilla Public License 2.0

If you need session-based high/low levels that always fit your chart and your trading hours, this script is for you.
Release Notes
This script is a flexible, timezone-aware Session High/Low indicator for TradingView. It is based on the original work of kurtsmock (Mozilla Public License 2.0) and includes enhancements for UTC offset handling and autoscale compatibility.

Features:
  • Tracks and plots the highest and lowest prices within user-defined trading sessions.
  • Session times default to UTC, but you can set a custom UTC offset (e.g., -4 for New York, 0 for London, +8 for Singapore).
  • Reset modes: by session, by a set number of hours, or daily.
  • Backtesting support: specify a date range to limit indicator activity to historical periods.
  • Session constraint: restricts operation to specific sessions, with optional weekend inclusion for crypto or 24/7 markets.
  • Visual customization: choose to display session high/low as lines, background color, or filled regions. All colors and transparencies are user-configurable.
  • Efficient plotting: session levels are always included in TradingView’s autoscale, so you never lose sight of key levels.


Technical details:
  • Session definition uses TradingView’s session string format (e.g., 1800-1500).
  • Timezone handling is automatic and accurate, even with custom offsets.
  • Designed for high efficiency, supporting up to 5000 bars back and 500 lines.


Credit:
Major credit to kurtsmock, the original author. This version adds UTC offset and improved autoscale support.
License: Mozilla Public License 2.0

If you need session-based high/low levels that always fit your chart and your trading hours, this script is for you.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.