business date and calendar libraries?

Robert Kern robert.kern at gmail.com
Wed Sep 15 17:46:22 EDT 2010


On 9/13/10 12:06 PM, Chris Withers wrote:
> Hi All,
>
> I'm wondering what libraries people would use to answer the following questions
> relating to business days:
>
> - on a naive level; "what's give me the last business day" (ie: skipping weekends)
>
> - on a less-naive level; same question but taking into account public holidays
>
> - on a horrific level; same question, but taking into account business days of a
> particular market (NYSE, LSE, etc)

Quantlib has a fairly good (by which I mean, horrific) collection of these 
implemented in C++:

 
http://quantlib.svn.sourceforge.net/viewvc/quantlib/trunk/QuantLib/ql/time/calendars/

If you only need a few of these, it can be more straightforward to look at them 
and recode them rather than trying to build Quantlib and its wrappers. Most of 
them have some algorithmic component (e.g. weekends, "easy" recurring holidays) 
and some exceptional cases (e.g. the days NYSE was closed after 2001-09-11).

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list