Skip to content

Commit f7dba0b

Browse files
committed
update china calendar for the year 2019
1 parent 66ff525 commit f7dba0b

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

PyFin/DateUtilities/Calendar.pyx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,22 @@ cdef set sse_holDays = {Date(2005, 1, 3),
433433
Date(2018, 10, 2),
434434
Date(2018, 10, 3),
435435
Date(2018, 10, 4),
436-
Date(2018, 10, 5)}
436+
Date(2018, 10, 5),
437+
Date(2019, 1, 1),
438+
Date(2019, 2, 4),
439+
Date(2019, 2, 5),
440+
Date(2019, 2, 6),
441+
Date(2019, 2, 7),
442+
Date(2019, 2, 8),
443+
Date(2019, 4, 5),
444+
Date(2019, 5, 1),
445+
Date(2019, 6, 7),
446+
Date(2019, 9, 13),
447+
Date(2019, 9, 30),
448+
Date(2019, 10, 1),
449+
Date(2019, 10, 2),
450+
Date(2019, 10, 3),
451+
Date(2019, 10, 4)}
437452

438453
cdef class ChinaSseImpl(CalendarImpl):
439454
def __init__(self):
@@ -557,6 +572,12 @@ cdef set ib_working_weekends = {
557572
Date.westernStyle(28, Months.April, 2018),
558573
Date.westernStyle(29, Months.September, 2018),
559574
Date.westernStyle(30, Months.September, 2018),
575+
Date.westernStyle(29, Months.December, 2018),
576+
# 2019
577+
Date.westernStyle(2, Months.February, 2019),
578+
Date.westernStyle(3, Months.February, 2019),
579+
Date.westernStyle(29, Months.September, 2019),
580+
Date.westernStyle(12, Months.October, 2019),
560581
}
561582

562583
cdef ChinaSseImpl _sseImpl = ChinaSseImpl()

PyFin/tests/DateUtilities/testCalendar.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,22 @@ def testChinaSSE(self):
104104
Date(2018, 4, 29), Date(2018, 4, 30), Date(2018, 5, 1),
105105
Date(2018, 6, 16), Date(2018, 6, 17), Date(2018, 6, 18),
106106
Date(2018, 9, 22), Date(2018, 9, 23), Date(2018, 9, 24),
107-
Date(2018, 10, 1), Date(2018, 10, 2), Date(2018, 10, 3), Date(2018, 10, 4), Date(2018, 10, 5), Date(2018, 10, 6), Date(2018, 10 ,7)]
107+
Date(2018, 10, 1), Date(2018, 10, 2), Date(2018, 10, 3), Date(2018, 10, 4), Date(2018, 10, 5), Date(2018, 10, 6), Date(2018, 10, 7),
108+
# China Shanghai Securities Exchange holiday list in the year 2019
109+
Date(2019, 1, 1),
110+
Date(2019, 2, 4), Date(2019, 2, 5), Date(2019, 2, 6), Date(2019, 2, 7), Date(2019, 2, 8),
111+
Date(2019, 4, 5),
112+
Date(2019, 5, 1),
113+
Date(2019, 6, 7),
114+
Date(2019, 9, 13),
115+
Date(2019, 9, 30), Date(2019, 10, 1), Date(2019, 10, 2), Date(2019, 10, 3), Date(2019, 10, 4)]
108116

109117
cal = Calendar('China.SSE')
110118

111119
for day in expectedHol:
112120
self.assertEqual(cal.isHoliday(day), True, "{0} is expected to be a holiday in {1}".format(day, cal))
113121
self.assertEqual(cal.isBizDay(day), False,
114-
"{0} is expected not to be a working day in {1} ".format(day, cal))
122+
"{0} is not expected to be a working day in {1} ".format(day, cal))
115123

116124
def testChinaIB(self):
117125

@@ -146,7 +154,12 @@ def testChinaIB(self):
146154
Date(2018, 4, 8),
147155
Date(2018, 4, 28),
148156
Date(2018, 9, 29),
149-
Date(2018, 9, 30)]
157+
Date(2018, 9, 30),
158+
# China Inter Bank working weekend list in the year 2018
159+
Date(2019, 2, 2),
160+
Date(2019, 2, 3),
161+
Date(2019, 9, 29),
162+
Date(2019, 10, 12)]
150163

151164
cal = Calendar('China.IB')
152165

0 commit comments

Comments
 (0)