OPEN-SOURCE SCRIPT
更新済

Average Session Range

386
Average Session Range
This indicator calculates and displays the average true range of the three major trading sessions (Tokyo, London, and New York) over a user-defined number of past sessions. It also shows the current session's range in real-time, helping traders quickly assess volatility expectations for the active session.
Key Features:

Three Major Sessions: Automatically detects and tracks Tokyo, London, and New York sessions
Flexible Session Handling: Choose between UTC (Auto DST) mode for accuracy across daylight saving changes, or Manual (AEST) mode with customizable session times
Multiple Display Modes:
Dollar ($) – Shows monetary value based on pointvalue (great for futures & CFDs)
Points – Raw price range
Pips – Converted to pips (ideal for forex)

Lookback Period: Average calculated over the last 1–20 sessions (user adjustable)
Clean Table Display: Elegant table in the bottom-right corner showing:
Current active session
Current session range (live updating)
Average range for the current session type


Why It's Useful:

Quickly see if the current session is expanding or contracting relative to its historical average
Better session-based volatility awareness
Ideal for day traders, scalpers, and breakout traders who trade around session opens and ranges
Particularly helpful on indices, forex majors, and futures contracts

Customization Options:

Number of sessions to average (1–20)
Display unit ($, Points, or Pips)
Session mode (UTC Auto DST or Manual AEST)
Full color customization for the table (header and values)

Perfect for traders who want a simple, at-a-glance view of how much movement to expect during each major trading session.
リリースノート
Average Session Range
A session-aware volatility tool that measures how far price travels during the Tokyo, London, and New York trading sessions, then compares the current session's movement against a rolling average of recent sessions.
What it does
The indicator watches each of the three major global trading sessions and tracks the price range — the distance between the session's high and low — from the moment a session opens until the moment it closes. When a session ends, that range is stored, and the indicator maintains a rolling window of the most recent N sessions (configurable, default 20) to calculate an average.
A small table in the bottom-right corner of the chart displays:

The currently active session (Tokyo, London, New York, or None)
How far price has moved so far in the current session
The rolling average range for that session

When two sessions overlap — Tokyo with London, or London with New York — the table expands to show both sessions side-by-side, so you can see how each is performing independently during the overlap period.
Features
Three display units. Range can be displayed in Dollar value (using the symbol's point value), raw Points, or Pips. Switch freely depending on the instrument and what's most meaningful to you — pips for FX, dollars for futures, points for indices.
Two timezone modes.

UTC (Auto DST) — Uses fixed UTC session windows. Daylight saving shifts in London and New York are handled automatically because UTC doesn't move; the sessions themselves shift relative to local time, which is the correct behaviour.
Manual (AEST) — Uses the chart's local timezone with editable session inputs. Useful if you prefer to define sessions yourself or trade from a fixed local schedule.

Per-session toggles. Tokyo, London, and New York can each be turned on or off individually. Disabled sessions are excluded from both tracking and the table.
Adjustable lookback. The rolling average window is user-configurable (minimum 1, default 20 sessions).
Compact adaptive table. The table only displays the rows it needs — three rows when one session is active, five rows during an overlap — and stays out of the way the rest of the time.
How the calculation works
For each session:

When the session opens, the high and low are seeded from that bar.
While the session is active, every bar updates the running high (max) and low (min).
When the session closes, the final range is calculated as high − low, converted to the selected display unit, and pushed into a rolling array.
If the array exceeds the lookback window, the oldest value is dropped.
The session average is the simple mean of all values currently in the array.

Current-session moves are only displayed while a session is active — they reset to a placeholder when the session ends, so the table never shows stale data from a closed session.
Notes

All values shown are intra-session ranges, not bar ranges. A "move" of 80 pips means price travelled 80 pips between the session's high and low — it does not imply directional bias.
The first few sessions after loading the indicator will show a partial average until the lookback window fills up. On lower timeframes with sufficient chart history this happens quickly; on higher timeframes it may take longer.
Pip size is calculated as mintick × 10, which is the standard convention for FX. Pip display on non-FX symbols is technically valid but may not be meaningful — Points or Dollar mode is recommended for indices, futures, and crypto.
Session detection uses TradingView's built-in time() function with session strings, so it correctly handles weekends, holidays, and the chart's native session calendar.
リリースノート
Added colour options for text, background and border

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。