Skip to content

Documentation / @finchart/core / index / sessionStart

Function: sessionStart() ​

sessionStart(options): BarStart

Defined in: packages/core/src/time/session-start.ts:41

Where a session starts, for a market whose session is a calendar day in one place.

The time zone is required, and the reason is that this decides an x that gets stored. A tick strategy's zone decides where its boundaries fall and what they read, and a wrong one is wrong on the screen where it can be seen and changed; this one decides where a bar begins, and that number is written into a drawing's coordinates and into a history cursor. A default would let a server rendering in UTC and a browser in Seoul disagree about the same bar.

A session opens at its earliest real instant, not at midnight. Where a clock jumped over midnight the day opens an hour late, and where it ran through midnight twice the day opens at the first of the two — so that asking a session's own start returns it unchanged, everywhere and every year.

Only "a session is a calendar day" lives here. A holiday, a half day, or an open that crosses midnight is the app's knowledge, and this is the tool to write it with.

Parameters ​

options ​

timeZone ​

string

Returns ​

BarStart