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
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
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
