Session Killzone Shading
Traders in decentralized forex and cryptocurrency markets operate across three major global sessions: Asia (Tokyo), London, and New York. Each session has distinct volatility patterns and participation levels. A session killzone is a low-activity period when established traders take breaks, typically occurring in the gaps between major session closures. This indicator shades the chart background with distinct colors for each session and optionally highlights the expected killzones, quiet periods where volatility historically compresses and false breakouts become common. Forex and crypto traders monitoring multiple sessions find this overlay useful for timing entry and exit decisions around session transitions.
//@version=6
indicator(title="Session Killzone Shading", overlay=true)
// ======= SESSION TIME INPUTS (UTC) =======
group_times = "Session Times (UTC)"
asia_start_h = input.int(0, "Asia Start Hour", 0, 23, group=group_times)
asia_start_m = input.int(0, "Asia Start Minute", 0, 59, group=group_times)
asia_end_h = input.int(9, "Asia End Hour", 0, 23, group=group_times)
asia_end_m = input.int(0, "Asia End Minute", 0, 59, group=group_times)
london_start_h = input.int(8, "London Start Hour", 0, 23, group=group_times)
london_start_m = input.int(0, "London Start Minute", 0, 59, group=group_times)
london_end_h = input.int(17, "London End Hour", 0, 23, group=group_times)
london_end_m = input.int(0, "London End Minute", 0, 59, group=group_times)
ny_start_h = input.int(13, "NY Start Hour", 0, 23, group=group_times)
ny_start_m = input.int(0, "NY Start Minute", 0, 59, group=group_times)
ny_end_h = input.int(22, "NY End Hour", 0, 23, group=group_times)
ny_end_m = input.int(0, "NY End Minute", 0, 59, group=group_times)
// ======= COLOR INPUTS =======
group_colors = "Colors"
col_asia = input.color(color.new(color.orange, 80), "Asia Session", group=group_colors)
col_london = input.color(color.new(color.blue, 80), "London Session", group=group_colors)
col_ny = input.color(color.new(color.red, 80), "New York Session", group=group_colors)
col_kz = input.color(color.new(color.gray, 90), "Killzone", group=group_colors)
// ======= DISPLAY OPTIONS =======
group_display = "Display"
show_killzones = input.bool(true, "Highlight Killzones", group=group_display)
// ======= HELPER FUNCTION =======
// Checks if current bar's time falls within a session window
// Handles midnight wrap (e.g., NY session 22:00 to 06:00 next day)
f_in_session(h, m, start_h, start_m, end_h, end_m) =>
current_mins = h * 60 + m
start_mins = start_h * 60 + start_m
end_mins = end_h * 60 + end_m
if start_mins <= end_mins
// Normal: session within same calendar day
current_mins >= start_mins and current_mins < end_mins
else
// Wrap: session spans into next day (e.g., 22:00 to 06:00)
current_mins >= start_mins or current_mins < end_mins
// ======= MAIN LOGIC =======
// Get current bar's hour and minute (respects chart timezone)
h = hour(time)
m = minute(time)
// Detect which session is active
in_asia = f_in_session(h, m, asia_start_h, asia_start_m, asia_end_h, asia_end_m)
in_london = f_in_session(h, m, london_start_h, london_start_m, london_end_h, london_end_m)
in_ny = f_in_session(h, m, ny_start_h, ny_start_m, ny_end_h, ny_end_m)
// Killzones: periods between sessions
in_killzone = false
if show_killzones
kz_asia_to_london = f_in_session(h, m, asia_end_h, asia_end_m, london_start_h, london_start_m)
kz_london_to_ny = f_in_session(h, m, london_end_h, london_end_m, ny_start_h, ny_start_m)
kz_ny_to_asia = f_in_session(h, m, ny_end_h, ny_end_m, asia_start_h, asia_start_m)
in_killzone := kz_asia_to_london or kz_london_to_ny or kz_ny_to_asia
// ======= BACKGROUND SHADING =======
// Session priority: Active sessions override killzones
if in_asia
bgcolor(col_asia)
else if in_london
bgcolor(col_london)
else if in_ny
bgcolor(col_ny)
else if in_killzone
bgcolor(col_kz)
How the code works
The indicator retrieves the current bar's hour and minute using Pine's hour() and minute() built-ins, which respect the chart's timezone (users should set the chart to UTC for consistency with default session times).
The f_in_session() helper function converts hours and minutes into elapsed minutes since midnight, then checks whether the current time falls within a session window. It handles the common case where sessions do not wrap midnight (Asia 00:00-09:00) with a simple range check: current_mins >= start_mins and current_mins < end_mins. When a session crosses midnight, as the New York session might (22:00 to 06:00 UTC when daylight saving time shifts things), it uses an OR condition: current_mins >= start_mins or current_mins < end_mins, which correctly identifies bars in the early morning hours.
Session detection then evaluates whether the current bar falls into any of the three major sessions. Killzone detection, if enabled, checks three gaps: from Asia close to London open, from London close to New York open, and from New York close to Asia open (the next day). If any killzone condition is true and no active session is running, the background is shaded gray.
The background shading uses a priority hierarchy: active sessions take precedence over killzones. This ensures that if a session and a neighboring killzone overlap (which is rare but possible depending on input values), the session color is displayed.
Reading it on a chart
When the indicator loads, the chart background will display four potential colors. The most common pattern is a gradual cycle: orange for Asia, blue for London, red for New York, with gray (killzone) bars appearing in the quiet gaps. Forex traders often watch for low-volatility price action during killzone shading, as these periods frequently precede explosive moves when the next session opens. Conversely, session overlaps, visible as a change of background color when two sessions are simultaneously active, tend to see elevated trading volume and volatility.
Traders typically adjust the session start and end times to match daylight saving time transitions in their region. For example, New York Eastern Time observes daylight saving, shifting its UTC offset twice yearly. By updating the inputs, the indicator automatically re-colors the chart.
The indicator is particularly useful on 1-hour, 4-hour, and daily timeframes, where session boundaries become visually apparent and meaningful. On very short timeframes (1-minute, 5-minute), the shading may update frequently and distract from price action; on weekly or monthly charts, sessions are less relevant.
Limitations
Timezone dependency. The indicator reads the chart's timezone setting directly. If the chart is set to New York time instead of UTC, all session times will be offset by the current New York UTC offset, producing incorrect shading. Users must explicitly set the chart to UTC for the default session inputs to work. If trading with a chart in local time, all session inputs must be manually adjusted.
Daylight saving time is not automated. The inputs are static hours and minutes. Twice yearly, when the US and UK observe daylight saving transitions, traders must manually update the New York and London session times (shift by one hour), or the shading will drift one hour off for several weeks. No automatic DST handling is built in.
Killzones are not universal. Traders define "killzone" in different ways: some mean any low-volatility gap, others refer to specific 15-30 minute windows during overlaps, and some use machine-learning-detected quiet periods. This indicator defines killzones only as the gaps between sessions. A trader who expects low volatility during the 10-minute London–NY handoff (even within overlapping hours) will not see that shading here.
Overlaps are not visually distinct. When two sessions are active simultaneously (London–New York overlap is 13:00-17:00 UTC), the background shows only the earlier session's color. Practitioners interested in overlap-specific dynamics may want additional visual cues.
No alert on session change. The indicator shades the bars but does not alert the trader when a new session begins. Traders monitoring multiple instruments must manually glance at the chart; an external alert system is recommended for automated notifications.
Chart-specific. The indicator runs independently on each chart. A trader monitoring five currency pairs across five charts will see the same session shading on each, but if one chart's timezone is misconfigured, that chart's shading will be wrong while others remain correct, a potential source of confusion.
Key definitions
Killzone: A period of expected low volatility and reduced trading activity between major market sessions, when few institutional traders are actively positioned.
Session: A defined trading window associated with a geographic market center (Asia, London, New York), during which local market participants are most active.
UTC/GMT: Coordinated Universal Time; the time standard by which global financial markets operate and against which session times are typically quoted.
Volatility: The magnitude and frequency of price movement; typically measured as standard deviation of returns over a period.
Overlay: A chart indicator that is displayed directly on top of the price bars, as opposed to a separate panel below the chart.
Daylight saving time: The seasonal shift of local clock time (forward in spring, backward in fall) used in the US, UK, and EU, which offsets UTC relationships twice yearly.
References
-
CME Group, "Globex, Session Times and Holiday Schedule", CME (2025). Https://www.cmegroup.com/markets/currencies/forex.html
-
ICE, "ICE Futures U.S., Session Hours", Intercontinental Exchange (2025). Https://www.theice.com/products/tradable-contracts
-
Financial Conduct Authority, "Forex Industry Overview", FCA Handbook (2024). Https://www.fca.org.uk/
-
TradingView, "Pine Script v6, Built-in Variables", TradingView Documentation (2025). Https://www.tradingview.com/pine-script-docs/
-
Nassim Taleb, "The Black Swan: The Impact of the Highly Improbable" (Random House, 2007). Print, cited for volatility regime concepts during low-volume periods [1].
-
LIFFE (Eurex), "Session Hours and Holiday Calendar", Eurex Exchange (2025). Https://www.eurex.com/
Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard.
Last reviewed by the PropLedger research pipeline: 2026-09-13. Educational research on historical data, not financial advice.
Keep reading
ATR-Based Volatility Bands
Free open-source Pine Script indicator: ATR-based volatility bands. Full code and a plain-English walkthrough.
Fair Value Gap Marker with Mitigation Tracking
Free open-source Pine Script indicator: fair value gap marker with mitigation tracking. Full code and a plain-English walkthrough.
Opening Range Box
Free open-source Pine Script indicator: opening range box with configurable minutes. Full code and a plain-English walkthrough.