Calendar
class Calendar
One venue's trading calendar over the range of dates it was loaded with.
- name
readonly name: string
The venue's MIC: a calendar's name, as
exchange_calendarsnames one by its code. - marketName
readonly marketName: string
The venue's name in the ISO 10383 registry.
- tz
readonly tz: string
The IANA zone the venue's sessions are quoted in.
- products
readonly products: readonly string[]
The product schedules the venue keeps; empty for almost every one.
- product
readonly product: string | undefined
The product schedule this calendar answers for, if one was chosen.
- from
readonly from: Temporal.PlainDate
The first and last dates loaded.
- to
readonly to: Temporal.PlainDate
- days
readonly days: readonly Day[]
Every day loaded, in order.
- day
day(date: DateLike): Day
The day, whatever its kind.
- isSession
isSession(date: DateLike): boolean
Whether the venue trades on the date.
- sessionsInRange
sessionsInRange(from: DateLike, to: DateLike): Temporal.PlainDate[]
The sessions from
fromtoto, inclusive. - nextSession
nextSession(date: DateLike): Temporal.PlainDate
The first session after
date, which need not be a session itself. - previousSession
previousSession(date: DateLike): Temporal.PlainDate
The last session before
date, which need not be a session itself. - dateToSession
dateToSession(date: DateLike, direction?: "none" | "next" | "previous"): Temporal.PlainDate
dateif it is a session; otherwise the next or previous one, or with"none",NotASession. - sessionsWindow
sessionsWindow(session: DateLike, count: number): Temporal.PlainDate[]
|count|sessions fromsession: forwards for a positive count, backwards and ending atsessionfor a negative one. - sessionsDistance
sessionsDistance(start: DateLike, end: DateLike): number
The number of sessions from
starttoend, both included; negative whenendis beforestart. A range with an unknown day throwsIndeterminate: a count that skipped it would be wrong. - isOpenAtTime
isOpenAtTime(at: InstantLike): boolean
Whether a session is running at the instant, outside its breaks.
- nextOpen
nextOpen(after: InstantLike): Temporal.ZonedDateTime
The first session open after the instant.
- nextClose
nextClose(after: InstantLike): Temporal.ZonedDateTime
The first session close after the instant.
- sessionOpen
sessionOpen(session: DateLike): Temporal.ZonedDateTime | undefined
The session's first open;
undefinedwhere Diurn holds no hours for it. - sessionClose
sessionClose(session: DateLike): Temporal.ZonedDateTime | undefined
The session's last close.
- sessionBreakStart
sessionBreakStart(session: DateLike): Temporal.ZonedDateTime | undefined
The start of the session's break (Tokyo's lunch);
undefinedwithout one. - sessionBreakEnd
sessionBreakEnd(session: DateLike): Temporal.ZonedDateTime | undefined
The end of the session's break.
- schedule
schedule(from: DateLike, to: DateLike, options?: { allDays?: boolean }): ScheduleRow[]
One row per session from
fromtoto; withallDays, one per day, so holidays and unknown days appear with their kind and no times.