AlgoWay Blog

Guides, manuals and platform references.

Core
JSON & Alerts
MT5 / Expert Advisors
Errors
Integrations
Other Publications
AlgoWay Strategy Lab

Pine Script Session Timezones: Chart Clock and DST Rules

Pine Script Session Timezones: Chart Clock and DST Rules illustration

A session filter that is an hour wrong can still look perfectly tidy. The candles line up, the code runs, and the strategy trades the wrong part of the day with admirable consistency.

Pine normally interprets a session in the symbol's exchange timezone, unless the function call supplies a timezone explicitly. The clock selected on the TradingView chart is a separate display setting. Start with that distinction before moving a session boundary to compensate.

Decide which clock owns the rule

TradingView distinguishes the exchange timezone, available as syminfo.timezone, from the chart timezone. Pine cannot read the chart's timezone setting. Changing that setting changes displayed times, not the script's calculations. The official time documentation explains these separate roles.

Intended ruleTimezone choiceWhat to check
Follow the current symbol's exchange clockDefault timezone, or syminfo.timezoneChanging symbols may change the exchange timezone.
Follow New York local business hoursAmerica/New_YorkThe UTC equivalent changes with daylight saving time.
Follow an unchanging UTC scheduleUTC+0Local wall-clock hours may shift seasonally.

A fixed offset such as UTC-5 is not a year-round substitute for New York. IANA region names account for daylight saving changes. For example, 09:30 New York corresponds to 14:30 UTC at UTC-5 and 13:30 UTC at UTC-4. Those are clock conversions, not two different trading rules.

Make the session and weekdays explicit

This small Pine v6 illustration shades bars whose opening time belongs to a weekday New York window:

//@version=6
indicator("Weekday NY session window", overlay = true)
string window = "0930-1600:23456"
bool inside = not na(time(timeframe.period, window, "America/New_York"))
bgcolor(inside ? color.new(color.teal, 88) : na)

In a session string, 1 means Sunday and 7 means Saturday, so 23456 selects Monday through Friday. Omitting the day suffix applies the window every day. time() returns na outside the specified session. See TradingView's session-string reference.

This is an illustrative filter, not a tested trading strategy. It has no entry, exit or alert command. A weekday clock window is also not a holiday calendar or a guarantee that the destination market is open. Use the broker's actual schedule when deciding whether orders may be sent.

A bar can straddle your cutoff

On an hourly chart, a session ending at 11:30 may include the bar opening at 11:00 even though the chart bar closes at 12:00. TradingView documents that time() and time_close() construct their own session-based bar representations; the latter can report 11:30 for that final session bar. It does not make the chart candle close early.

Align session boundaries with chart-bar boundaries where possible. Separately decide whether your rule concerns a bar's opening time, the signal calculation time or the eventual fill. An opening-time filter alone does not promise execution before the session ends. The strategy alert timing guide covers that next step.

Check the rule before reconnecting alerts

  1. Write down the intended clock, weekday set, timeframe and cutoff behavior. “Morning session” is not precise enough.
  2. On an intraday chart, inspect the highlighted opening and final bars on dates in both standard and daylight time. Compare their UTC times with their local times.
  3. Change only the chart display timezone. The highlighted bars should stay attached to the same events. Then change the symbol and check whether an exchange-default rule still expresses your intention.
  4. Check dates near clock changes and market holidays separately. Inspect the actual alert and fill times before treating the session filter as an execution limit.

TradingView's time and session FAQ provides additional session-filter examples. After changing a script's session inputs, follow the guide to replacing alerts with old settings. A corrected chart is useful evidence; it is not evidence that an already running alert has adopted the correction.

Last updated: October 7, 2026