std_time

6 388
std_time is a full calendar for Pine Script v6: the class of time infrastructure other ecosystems get from java.time, C++20 chrono and exchange_calendars, written natively in Pine. Civil dates, durations and periods, time zones with real daylight-saving rules, twelve exchange calendars (NYSE, LSE, CME, JPX, EUREX, HKEX, ASX, TSX, SSE, BSE, SGX, and 24/7 crypto) with holidays, half days and lunch breaks, trading-day arithmetic, sessions with on-the-bar close markers, option expiries including VIX settlement, ISDA day counts and business-day conventions, an economic release calendar, and an ISO-8601 formatter and parser. A calendar, not a bag of helpers.

One conversion sits at the bottom: Hinnant's civil-to-epoch pair, the algorithm C++20 chrono adopted. Weekdays, ISO weeks, DST boundaries, adjusters and holiday rules all derive from it, so no second implementation exists to quietly disagree with the first. The API keeps calendar arithmetic and instant arithmetic as separate families, because plus one day across a clock change is not plus 24 hours, and it treats an offset and a zone as different things, because they are. When a DST transition makes a local time impossible or ambiguous, you choose the resolution policy instead of inheriting one.

Rules do the work wherever the world runs on rules: VIX settlement is derived, not tabled, and reproduces every published Cboe settlement from 2021 through 2026, including all four Tuesday exceptions. The calendars are checked date-by-date against reference records over their stated ranges: NYSE and LSE on every single day from 1976 to 2035, HKEX through 2049, EUREX across its full window with zero differences. Every calendar declares the years it answers exactly, and past that horizon it returns UNKNOWN, a real three-valued answer, rather than reading an untabled holiday as a trading day. Completeness is a claim with a date on it, and every calendar states its date.

Full documentation, per-calendar coverage windows, the error model, and design rationale: github.com/hikari112/std_time/wiki

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.