Ferdinando, a) not all holidays have been documented in the hpp file. This can be easily fixed. I understood from the hpp files that you only listed the days for which an algorithm is available or the day is fixed. I will try to list the other ones. b) Lunar New Year, Tomb Sweeping, Dragon Boat, Mid-Autumn Festival, Buddha's birthday, Harvest Moon, Tuen NG Festival, Chung Yeung fest, ecc are provided for 2004, 2005, 2006. Is there an algorithm for calculating them? If the algo is not easy shouldn't we tabulate them as we do for Easter Monday? Yes, there is one algorithm for the Lunar New Year but it looks very complex. Furthermore, the bank holidays for the Lunar new year are not the same for HongKong, Seoul and Taiwan for example. Buddha's birthday is not the same day for HongKong and Seoul in 2005 unless there is an error on the derivatives exchange website. Tomb Sweeping day should be celebrated two weeks after the vernal equinox, for this one the algorithm is certainly available but we need to check the dates with the algorithm and I don't have enough time to do that. This is a good idea to tabulate them as easter monday. For the other ones I don't know and the informations I got from the derivatives exchange don't go farther than 2006 because it is linked to the settlement days of Futures products c) Honk Kong calendar: you list "Day after Good Friday", but since this is a Saturday it shouldn't be listed as a separate holiday. Am I wrong? You're rigth, day after Godd Friday is redundant, this is listed by the HongKong exchange for 2004 (not in 2005) this is why I inserted it. Xavier Ferdinando Ametrano <[hidden email]> To: [hidden email], [hidden email] Sent by: cc: [hidden email], QuantLib-users [hidden email] <[hidden email]> eforge.net Subject: [Quantlib-users] Re: [Quantlib-dev] new quantlib calendars 21/04/2004 18:56 Xavier thank you for the contribution. In addition to Luigi's questions: >1) is the copyright owned by you or FIMAT? >2) in either case, can you get from FIMAT a statement that it's ok for >them if you contribute code under the QuantLib license? >3) is there any particular reason you don't name the official source >for the calendar info? Otherwise, it'd be nice to put it in the docs. a) not all holidays have been documented in the hpp file. This can be easily fixed. b) Lunar New Year, Tomb Sweeping, Dragon Boat, Mid-Autumn Festival, Buddha's birthday, Harvest Moon, Tuen NG Festival, Chung Yeung fest, ecc are provided for 2004, 2005, 2006. Is there an algorithm for calculating them? If the algo is not easy shouldn't we tabulate them as we do for Easter Monday? c) Honk Kong calendar: you list "Day after Good Friday", but since this is a Saturday it shouldn't be listed as a separate holiday. Am I wrong? ciao -- Nando ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Quantlib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ************************************************************************* Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. La FIMAT et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither FIMATnor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. |
Ferdinando & Company:
Attached are the codes I use to load the holiday schedule from an external file. Here is a brief description: 1. The name of the object to load the external file is called "CalendarLoader", it takes at least two input variables in order to instantiate itself: a Calendar object, and the name of the external file that contains the holiday schedule (fully quanlified path is expected). The optional input is the delimiter used in the holiday schedule. 2. The format of the holiday schedule is City=YYYYMMDD, user can replace the equal sign with other characters, the default is the equal sign; The name of the city should match Calendar.name(). 3. I have modified all the codes so they are default to namespace QuantLib. 4. I initially intend to put them under ql/FileLoader location, you can change them whenever you see fit. 5. "test.cpp" is the sample program shows how to use it. With this loader, the holiday schedule can be updated dynamically provided the "city" class is already created. I hope QuantLib community would find this a useful add-on, of course any feedback would be greatly appreciated it. Cheers, Jeff -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email] Sent: Thursday, April 22, 2004 3:34 AM To: Ferdinando Ametrano Cc: [hidden email]; [hidden email]; QuantLib-users; [hidden email] Subject: Re: [Quantlib-users] Re: [Quantlib-dev] new quantlib calendars Ferdinando, a) not all holidays have been documented in the hpp file. This can be easily fixed. I understood from the hpp files that you only listed the days for which an algorithm is available or the day is fixed. I will try to list the other ones. b) Lunar New Year, Tomb Sweeping, Dragon Boat, Mid-Autumn Festival, Buddha's birthday, Harvest Moon, Tuen NG Festival, Chung Yeung fest, ecc are provided for 2004, 2005, 2006. Is there an algorithm for calculating them? If the algo is not easy shouldn't we tabulate them as we do for Easter Monday? Yes, there is one algorithm for the Lunar New Year but it looks very complex. Furthermore, the bank holidays for the Lunar new year are not the same for HongKong, Seoul and Taiwan for example. Buddha's birthday is not the same day for HongKong and Seoul in 2005 unless there is an error on the derivatives exchange website. Tomb Sweeping day should be celebrated two weeks after the vernal equinox, for this one the algorithm is certainly available but we need to check the dates with the algorithm and I don't have enough time to do that. This is a good idea to tabulate them as easter monday. For the other ones I don't know and the informations I got from the derivatives exchange don't go farther than 2006 because it is linked to the settlement days of Futures products c) Honk Kong calendar: you list "Day after Good Friday", but since this is a Saturday it shouldn't be listed as a separate holiday. Am I wrong? You're rigth, day after Godd Friday is redundant, this is listed by the HongKong exchange for 2004 (not in 2005) this is why I inserted it. Xavier Ferdinando Ametrano <[hidden email]> To: [hidden email], [hidden email] Sent by: cc: [hidden email], QuantLib-users [hidden email] <[hidden email]> eforge.net Subject: [Quantlib-users] Re: [Quantlib-dev] new quantlib calendars 21/04/2004 18:56 Xavier thank you for the contribution. In addition to Luigi's questions: >1) is the copyright owned by you or FIMAT? >2) in either case, can you get from FIMAT a statement that it's ok for >them if you contribute code under the QuantLib license? >3) is there any particular reason you don't name the official source >for the calendar info? Otherwise, it'd be nice to put it in the docs. a) not all holidays have been documented in the hpp file. This can be easily fixed. b) Lunar New Year, Tomb Sweeping, Dragon Boat, Mid-Autumn Festival, Buddha's birthday, Harvest Moon, Tuen NG Festival, Chung Yeung fest, ecc are provided for 2004, 2005, 2006. Is there an algorithm for calculating them? If the algo is not easy shouldn't we tabulate them as we do for Easter Monday? c) Honk Kong calendar: you list "Day after Good Friday", but since this is a Saturday it shouldn't be listed as a separate holiday. Am I wrong? ciao -- Nando ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Quantlib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ************************************************************************ * Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. La FIMAT et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither FIMATnor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Quantlib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users abc.txt (104 bytes) Download Attachment strfileloader.hpp (971 bytes) Download Attachment strfileloader.cpp (1K) Download Attachment parser.hpp (793 bytes) Download Attachment parser.cpp (1K) Download Attachment calendarloader.hpp (833 bytes) Download Attachment calendarloader.cpp (1K) Download Attachment test.cpp (773 bytes) Download Attachment |
On 2004.04.22 23:20, Jeff Yu wrote:
> Attached are the codes I use to load the holiday schedule from an > external file. Jeff, thanks for the contribution--I'll integrate it in the library as soon as I find some time (possibly reworking it a bit so that it integrates more seamlessly with the library---right now you can't pass a CalendarLoader where the library expects a Calendar.) The usual questions: 1) who owns the copyright of the code? 2) in case it's your employer, can you get a statement that it's ok for you to contribute code under the QuantLib license? Thanks, Luigi |
Luigi,
I am the owner of the code so it is ok to have them covered under the QuantLib license. "... You can't pass a CalendarLoader where the library expects a Calendar."? Well, you need to instantiate a Calendar first, let's say you want to use NewYork's holiday schedule, so you will have a NewYork ny created before passing it to CalendarLoader loader(ny, "the_external_holiday_schedule","="); It should work right away. In fact, I was able to integrate them into 0.36 on both Linux and XP last night. Please let me know if there is any question I can answer so to save your time on this. Cheers, Jeff -----Original Message----- From: Luigi Ballabio [mailto:[hidden email]] Sent: Friday, April 23, 2004 3:45 AM To: [hidden email] Cc: [hidden email] Subject: Re: [Quantlib-dev] new quantlib calendars On 2004.04.22 23:20, Jeff Yu wrote: > Attached are the codes I use to load the holiday schedule from an > external file. Jeff, thanks for the contribution--I'll integrate it in the library as soon as I find some time (possibly reworking it a bit so that it integrates more seamlessly with the library---right now you can't pass a CalendarLoader where the library expects a Calendar.) The usual questions: 1) who owns the copyright of the code? 2) in case it's your employer, can you get a statement that it's ok for you to contribute code under the QuantLib license? Thanks, Luigi |
On 2004.04.23 14:01, Jeff Yu wrote:
> I am the owner of the code so it is ok to have them covered under the > QuantLib license. Ok. > "... You can't pass a CalendarLoader where the library expects a > Calendar."? Well, you need to instantiate a Calendar first, let's > say you want to use NewYork's holiday schedule, so you will have a > NewYork ny created before passing it to > > CalendarLoader loader(ny, "the_external_holiday_schedule","="); > > It should work right away. Yes, this works in the sense that after the above, you can write: loader.isBusineddDay(date); However, the added holiday information is stored into the CalendarLoader instance, not into the NewYork calendar. If you want to use it to instantiate, say, a Scheduler (whose signature is Schedule(const Calendar& calendar, const Date& startDate, const Date& endDate, int frequency, RollingConvention rollingConvention, bool isAdjusted, const Date& stubDate = Date(), bool startFromEnd = false, bool longFinal = false); you're out of luck as the compiler won't accept a CalendarLoader as the first argument. I'm integrating your code into Calendar so that the above issue is solved. Later, Luigi |
In reply to this post by Xavier.Abulker
On 2004.04.26 14:40, Jeff Yu wrote:
> I back away from touching the Calendar object because it is one of > the building blocks of this toolkit. Yes, I understand that. However, I have no such scruples :) I modified your code and integrated it with the Calendar class. The changes are being committed in CVS as I write. Thanks, Luigi |
Free forum by Nabble | Edit this page |