Tool
Day of Week
time.day_of_week
Inputs
No typed inputs.
Outputs
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.
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
Read the weekday on the UTC wall clock.
Read the weekday on the feed clock (Europe/Athens), the zone the data source writes its bars on.
Read the weekday on the Europe/London wall clock.
Read the weekday on the America/New_York wall clock.
Read the weekday on the Asia/Tokyo wall clock.
Configuration
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.
Connects to
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.