Skip to content

[XKRX] Add Korea Exchange (KRX) market holiday calendar #261

Description

@davejoyce

Module(s) Affected

holiday-calendar-apac

Problem / Motivation

No Korea Exchange (KRX) market calendar exists in this library today. KRX observes all South Korean national holidays (including daecheday substitutes) plus a market-only full-day closure on December 31 (year-end) that is not a national public holiday.

Proposed Solution

Create HolidayCalendarServiceXKRX (MIC code XKRX), reusing KR's full holiday list via KRHolidays, plus one new market-only closure.

Holidays

  • All entries from KR (see sibling sub-issue), via KRHolidays, including daecheday substitutes
  • December 31 year-end closure — confirm this is a full-day non-trading closure (Holiday.Type.FIXED, appears in calculate()), not an EARLY_CLOSE; research fixture data described it as "full closure" but this needs confirming against KRX's own published market schedule before implementation, since the design prose alone was ambiguous on this point

Scope

  • Confirm Dec 31 closure type (full-day vs. half-day) against KRX's official market schedule (krx.co.kr)
  • Confirm Dec 31 is the only KRX-specific addition beyond the national KR list (verify no other market-only closures exist)
  • Create HolidayCalendarServiceXKRX, consuming KRHolidays for the base list plus the Dec 31 closure
  • Register in module-info.java

Testing

  • HolidayCalendarServiceXKRXTestisProvided("XKRX") true, isProvided("KR") false from this class's perspective
  • testYearEndClosurePresentEveryYearRegardlessOfWeekday() for 2024 (Tue), 2025 (Wed), 2026 (Thu) — confirms the closure is unconditional, not day-of-week-gated
  • testDec31ClosureIsFullDayNotEarlyClose() — assert the entry appears in calculate(), not calculateEarlyCloses() (write this to fail loudly if the confirmed type turns out to be EARLY_CLOSE instead — don't silently adapt the test to match an unverified assumption)
  • testXKRXSameHolidaysAsKRPlusYearEndClosure(int year) — set-equality check: XKRX.calculate(year) equals KR.calculate(year) plus the Dec 31 entry
  • testKRHasNoYearEndClosure() — confirm the Dec 31 closure does not leak into the national KR calendar
  • testHolidayCalendarFactoryCreate()factory.create("XKRX").getCode() equals "XKRX"
  • Add XKRX to HolidayCalendar30YearIT's allCalendarCodes()

Verification

  • mvn -pl holiday-calendar-apac clean install
  • mvn -pl tests clean verify

Related

Alternatives Considered

None — market-only Dec 31 closure content is straightforward given KR's base list already exists.

Additional Context

None.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnew-marketRequest for creation of a holiday calendar for a new "market" (central bank / market / nation)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions