Skip to content

charton API


charton API / @chart-on/core / index / marketPhase

Function: marketPhase() ​

marketPhase(regular, extended, zone, now): MarketStatus

Defined in: packages/core/src/util/market.ts:35

Market phase at now for regular hours regular and, optionally, wider extended hours extended, both in zone. Each takes a SessionSchedule or a CompiledSession from compileSession.

A null regular, or one that is always open, means the market never closes. A null extended means no extended hours; an always-open SessionSchedule (e.g. ALWAYS_OPEN) means extended hours around the clock. Extended hours are pre until regular hours open within the same stretch, and post once regular hours have closed in it.

Parameters ​

regular ​

SessionSchedule | CompiledSession | null

extended ​

SessionSchedule | CompiledSession | null

zone ​

Zone

now ​

number

Returns ​

MarketStatus