Skip to content

weekofyear - PineScript Variable

The week number of the year, in the exchange time zone, calculated from the bar’s opening UNIX timestamp.

int

series

  • This variable always references the week number corresponding to the bar’s opening time. Consequently, for symbols with overnight sessions (e.g., “EURUSD”, where the “Monday” session starts on Sunday at 17:00 in exchange time), the value may represent a previous calendar week rather than the week of the session’s primary trading day.