Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update market close of JPX to 15:30 #351

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pandas_market_calendars/calendars/jpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ class JPXExchangeCalendar(MarketCalendar):

Open Time: 9:31 AM, Asia/Tokyo
LUNCH BREAK :facepalm: : 11:30 AM - 12:30 PM Asia/Tokyo
Close Time: 4:00 PM, Asia/Tokyo
Close Time: 3:30 PM, Asia/Tokyo

Market close of Japan changed from 3:00 PM to 3:30 PM on November 5, 2024
Reference:
https://www.jpx.co.jp/english/equities/trading/domestic/tvdivq0000006blj-att/tradinghours_eg.pdf
"""

aliases = ["JPX", "XJPX"]
regular_market_times = {
"market_open": ((None, time(9)),),
"market_close": ((None, time(15)),),
"market_close": ((None, time(15)), ("2024-11-05", time(15, 30))),
"break_start": ((None, time(11, 30)),),
"break_end": ((None, time(12, 30)),),
}
Expand Down
34 changes: 34 additions & 0 deletions tests/test_jpx_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,37 @@ def test_jpx_trading_days_since_1949(request):
actual = pd.date_range(start_date, end_date, freq=day_generator)

assert_index_equal(expected, actual)


def test_jpx_change_in_market_close():
"""
The market close of Japan changed from 3:00 PM to 3:30 PM on November 5, 2024, make sure the
calendar reflects this change.
"""
jpx_calendar = JPXExchangeCalendar()
jpx_schedule = jpx_calendar.schedule(start_date="2024-10-28", end_date="2024-11-08")

business_dates_before_change = [
"2024-10-28",
"2024-10-29",
"2024-10-30",
"2024-10-31",
"2024-11-01",
]

business_dates_after_change = [
"2024-11-05",
"2024-11-06",
"2024-11-07",
"2024-11-08",
]

for date in business_dates_before_change:
assert jpx_schedule.loc[date, "market_close"] == pd.Timestamp(
f"{date} 15:00", tz="Asia/Tokyo"
)

for date in business_dates_after_change:
assert jpx_schedule.loc[date, "market_close"] == pd.Timestamp(
f"{date} 15:30", tz="Asia/Tokyo"
)
Loading