|
From: Chongseok <or...@ha...> - 2008-04-11 00:21:15
|
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2004 FIMAT Group Copyright (C) 2007 StatPro Italia srl Copyright (C) 2008 Charles Chongseok Hyun (or...@ha...) This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email <qua...@li...>. The license is also available online at <http://quantlib.org/license.shtml>. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ /*! \file southkorea.hpp \brief South Korean calendars */ #ifndef quantlib_south_korean_calendar_hpp #define quantlib_south_korean_calendar_hpp #include <ql/time/calendar.hpp> namespace QuantLib { //! South Korean calendars /*! Public holidays with definite rules: <ul> <li>Saturdays</li> <li>Sundays</li> <li>New Year's Day, January 1st</li> <li>Independence Day, March 1st</li> <li>Children's Day, May 5th</li> <li>Memorial Day, June 6th</li> <li>Liberation Day, August 15th</li> <li>National Fondation Day, October 3th</li> <li>Christmas Day, December 25th</li> </ul> Other public holidays for which no rule is given (data available for 2004-2010 only): <ul> <li>Lunar New Year: The last day of the previous lunar year, January 1st, 2nd in lunar calendar</li> <li>Election Days <ul> <li>National Assembly: 2004-APR-15, 2008-APR-09</li> <li>Presidency: 2007-DEC-19</li> <li>Regional Election: 2006-MAY-31</li> </ul> <li>Buddha's birthday, April 8th in lunar calendar</li> <li>Harvest Moon Day: August 14th, 15th, 16th in lunar calendar</li> </ul> <B>Holidays for settlements</B>: <ul> <li>All public holidays listed above</li> <li>Labour Day, May 1st</li> </ul> <B>Holidays for the Korea exchange</B> (data from <http://www.krx.co.kr> or <http://www.dooriworld.com/daishin/holiday/holiday.html>): <ul> <li>All public holidays listed above <li>Labour Day, May 1st</li> <li>Year-end closing: 2004-DEC-31, 2005-DEC-30, 2006-DEC-29, 2007-DEC-31</li> </ul> <B>Important changes!!!</B>: <ul> <li>Arbour Day, April 5th: a holiday until 2005, not a holiday after 2005</li> <li>Constitution Day, July 17th: a holiday until 2007, not a holiday after 2008</li> </ul> \ingroup calendars */ class SouthKorea : public Calendar { private: //! SettlementImpl represents South Korean public holidays. class SettlementImpl : public Calendar::Impl { public: SettlementImpl() : calendarName_("South Korean settlement"){} virtual std::string name() const { return calendarName_; } virtual bool isWeekend(Weekday) const; virtual bool isBusinessDay(const Date&) const; protected: //! Constructor /*! This constructor is for the sake of calling from subclasses. */ SettlementImpl(const std::string& calendarName) : calendarName_(calendarName){} protected: std::string calendarName_; }; /*! KrxImpl inherits SettlementImpl because all KRX business days are also settlement business days. */ class KrxImpl : public SettlementImpl { public: KrxImpl() : SettlementImpl(std::string("South Korean settlement")){} virtual bool isBusinessDay(const Date&) const; }; public: enum Market { Settlement, //!< generic settlement calendar KRX //!< Korea exchange calendar }; SouthKorea(Market m = Settlement); }; } #endif |