Skip to content
StatePath
Tool Atlastime.day_of_week

Tool

Day of Week

time.day_of_week

MarketTime

Inputs

No typed inputs.

Outputs

Buffer (time series)

An integer day-of-week index for the current bar (for example Monday=1 through Friday=5). The same value repeats for every bar that shares the same calendar day.

Reports which weekday the current bar falls on, as a number (for example Monday through Friday). Traders use it to turn rules on or off depending on the day.

Day of Week overview diagramMonTueWedThuFri

How it works

For each bar it reads the bar's timestamp and returns the day-of-week index. Nothing about price is involved — it only looks at the calendar day of the bar being processed.

Modes

UTCUTC

Read the weekday on the UTC wall clock.

UTC diagramMonTueWedThuFri
Europe/Athens (feed clock)Europe/Athens

Read the weekday on the feed clock (Europe/Athens), the zone the data source writes its bars on.

Europe/Athens (feed clock) diagramMonTueWedThuFri
Europe/LondonEurope/London

Read the weekday on the Europe/London wall clock.

Europe/London diagramMonTueWedThuFri
America/New_YorkAmerica/New_York

Read the weekday on the America/New_York wall clock.

America/New_York diagramMonTueWedThuFri
Asia/TokyoAsia/Tokyo

Read the weekday on the Asia/Tokyo wall clock.

Asia/Tokyo diagramMonTueWedThuFri

Configuration

timezoneenum

The wall clock the weekday is read on: UTC by default, the feed clock (Europe/Athens, the zone the data source writes its bars on) or a session's own zone.

Choices:UTCEurope/AthensEurope/LondonAmerica/New_YorkAsia/Tokyo

Connects to

Feeds into

Examples

  • Filter: block new entries on Mondays by checking the day-of-week index against the Monday value.
  • Compare the weekday index with condition.compare eq to allow signals only on a chosen day.

Common mistakes

  • Assuming a fixed numbering scheme — confirm whether the index starts at 0 or 1 and whether weekends are included before hard-coding a value.
  • Forgetting which clock decides the day: it is read on the node's timezone (UTC by default), so a bar near midnight can fall on another weekday in another zone.

See also