OPEN-SOURCE SCRIPT
Cập nhật Sessions & Key Levels {basic}

Introduction
Sessions & Key Levels {basic} is a streamlined key level indicator designed to provide traders with clear visual structure around intraday trading sessions and essential higher timeframe reference levels.
The {basic} version focuses on the most commonly used session and price levels, helping traders identify important areas of interest without overwhelming the chart. It is ideal for traders who want a clean, reliable framework for session-based and timeframe-based analysis.
Description
The indicator plots the Asia, London and New York trading sessions directly on the chart, including session boxes and key session levels. Session highs and lows update dynamically while the session is active, providing real-time context as price develops.
In addition to session levels, the indicator includes current and previous period levels from a single configurable timeframe. These levels highlight important open, high, low and midpoint references that are frequently respected by price and commonly used for intraday bias, structure and trade planning.
The {basic} version is designed to remain visually minimal, with fixed styling and simplified settings, making it easy to use straight out of the box.
Features
Global session windows
Session levels
Previous period levels
Current period levels
Simplified design
Terms & Conditions
Sessions & Key Levels {basic} is a streamlined key level indicator designed to provide traders with clear visual structure around intraday trading sessions and essential higher timeframe reference levels.
The {basic} version focuses on the most commonly used session and price levels, helping traders identify important areas of interest without overwhelming the chart. It is ideal for traders who want a clean, reliable framework for session-based and timeframe-based analysis.
Description
The indicator plots the Asia, London and New York trading sessions directly on the chart, including session boxes and key session levels. Session highs and lows update dynamically while the session is active, providing real-time context as price develops.
In addition to session levels, the indicator includes current and previous period levels from a single configurable timeframe. These levels highlight important open, high, low and midpoint references that are frequently respected by price and commonly used for intraday bias, structure and trade planning.
The {basic} version is designed to remain visually minimal, with fixed styling and simplified settings, making it easy to use straight out of the box.
Features
Global session windows
- Asia, London and New York sessions.
- Custom session times.
- Session boxes with adaptive highs and lows.
Session levels
- Open, high, low and midpoint per session.
- Automatically updates during active sessions.
- Clean, consistent labelling.
Previous period levels
- One configurable timeframe.
- Open, high, low and midpoint of the prior period.
- Useful for daily or intraday reference levels.
Current period levels
- Tracks live open, high, low and midpoint of the selected timeframe.
- Updates dynamically as the timeframe progresses.
Simplified design
- Fixed line styles and colors for clarity.
- Dark and light theme support.
- Minimal settings for ease of use.
Terms & Conditions
- This indicator is provided for educational and informational purposes only and does not constitute financial advice.
- Trading involves risk and past performance is not indicative of future results.
- The user assumes full responsibility for any trading decisions made using this indicator.
Phát hành các Ghi chú
Minor improvements.Phát hành các Ghi chú
This update consolidates the {premium} & {basic} versions of this indicator into one single version - free and accessible to the whole TradingView community.New Features (from {premium} version)
- Custom theme - customize all aesthetics (lines, boxes, labels) to your liking.
- Allowance for 2 more customizable session windows (5 in total now).
- Show up to 3 configurable timeframes each for previous & current levels.
- Sweep recognition - ability to change line style & positioning when a high/low level has been swept.
- Label overlap management - the indicator automatically removes overlapping labels when 2 or more levels are the same.
Phát hành các Ghi chú
Updated the publication chart image to better showcase the features implemented in the most recent update.Phát hành các Ghi chú
Fixes- Fixed a runtime error that could occur when the chart timeframe was much lower than a selected level timeframe — for example viewing previous week levels on a 1 minute chart. Levels are now anchored by time rather than bar position, which removes the limit on how far back a level can sit.
- Fixed levels being drawn at zero when the required history was not available. If your chart does not load enough bars to cover a full period — a previous month level on a 1 minute chart, for instance — that level is now simply not drawn until the data is there.
- Improved the accuracy of previous period levels. High and low positions are now taken from the bars themselves as each period builds, rather than searched for afterwards, so the line always begins exactly at the bar that formed the level.
Additions
- Added 30 minute timeframe as an option for previous and current levels.
Changes
- The Light theme is now the default.
Phát hành các Ghi chú
Additions- Opening price levels — the midnight, 8:30, 9:30 and 10:00 opens, each toggled on or off individually in the new Opening Prices group. They follow the same line styling as every other open level.
- Label size — labels can now be set to tiny, small, normal, large or huge in Label Settings.
Changes
- Overlapping labels are now merged rather than hidden. Where two or more levels sit at exactly the same price, their names are joined into a single label separated by a slash — for example `ny pm low / prev 4H low` — so every level at that price is still identified. Previously only one label was kept and the rest were removed, which left lines on the chart with nothing to name them.
- Where the lines themselves are identical as well as the price — same starting bar, same style — they are now drawn once instead of stacked.
- Levels must be at exactly the same price to be merged. Levels a tick or two apart are left as they are.
Fixes
- Overlap handling now applies to open and midpoint labels. Previously only highs and lows were checked, so a current day open sitting on a current 4 hour open, or any open against a midpoint, would stack unreadably.
- Levels at the same price are now recognised regardless of which bar formed them. Previously two levels were only treated as overlapping if their high or low came from the same bar, so a level retested at exactly the same price later in the period went undetected.
- Session levels are now compared against each other. Previously a session level was only checked against timeframe levels, never against another session.
Note on opening prices
On a chart timeframe where one of those times does not start a bar — 9:30 on a 1 hour chart, for example — that level is not drawn at all, rather than being taken from whichever bar happens to contain the time. The opens are New York time and follow daylight saving.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.