Calendars

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Calendars

a akpitidis
Hi,
 
Is there any way/method to add a new calendar in the library using excel?
I want to create a custom calendar and supply to it a list of holidays.
 
Thanks
T.


Yahoo! for Good helps you make a difference
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Calendars

Ferdinando M. Ametrano-3
On Fri, Mar 28, 2008 at 5:42 PM, a akpitidis <[hidden email]> wrote:
> Is there any way/method to add a new calendar in the library using excel?
> I want to create a custom calendar and supply to it a list of holidays.

not really, as we never felt such a need. You can add/remove holidays
from an existing calendar, and you can join (business or holiday of)
existing calendars.

May you clarify  why your need of a custom calendar cannot be
satisfied with the existing features?

ciao -- Nando

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Calendars

Simon Ibbotson - Straumur
Hi Nando,

I'd agree with "T", it would be nice to have a bespoke calendar... so we
can quickly add a calendar that isn't present in QuantLib without having
to release a new library. For instance, the calendar for the Kazakh
Tenge isn't in QuantLib yet and adding a class with the relevant date
rules would take time/effort and a library release.

Simon


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
Ferdinando Ametrano
Sent: 28 March 2008 16:59
To: a akpitidis
Cc: [hidden email]
Subject: Re: [Quantlib-users] Calendars


On Fri, Mar 28, 2008 at 5:42 PM, a akpitidis <[hidden email]>
wrote:
> Is there any way/method to add a new calendar in the library using
excel?
> I want to create a custom calendar and supply to it a list of
holidays.

not really, as we never felt such a need. You can add/remove holidays
from an existing calendar, and you can join (business or holiday of)
existing calendars.

May you clarify  why your need of a custom calendar cannot be
satisfied with the existing features?

ciao -- Nando

------------------------------------------------------------------------
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketp
lace
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Calendars

Luigi Ballabio
On Fri, 2008-03-28 at 17:07 +0000, Simon Ibbotson wrote:
> I'd agree with "T", it would be nice to have a bespoke calendar... so we
> can quickly add a calendar that isn't present in QuantLib without having
> to release a new library. For instance, the calendar for the Kazakh
> Tenge isn't in QuantLib yet and adding a class with the relevant date
> rules would take time/effort and a library release.

This isn't entirely true (you could implement Kazakh Tenge and link it
to your application together with the main library) but I agree, we
might have a bespoke calendar.

It should have copy semantics, right? I mean, if we write:

BespokeCalendar c1;
... initialize c1 with holidays ...

Calendar c2 = c1;  // same holidays as c1

...later on...
c2.addHoliday(...);

c1 shouldn't be modified by the call through c2, I guess. Or should it?

Luigi


--

Testing can never demonstrate the absence of errors in software, only
their presence.
-- W.E. Dijkstra



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Calendars

Simon Ibbotson - Straumur

I don't think it needs to have copy semantics. Calendars are usually
static data so I wouldn't think that several versions of a calendar
would be necessary/desirable.

In other words, if we add a holiday to a given - specific - holiday
calendar, that should propagate into all instances of that calendar.
I can't think of a reason you might want two differing versions of the
same calendar (except for cases which could be resolved external to
QuantLib - measuring the impact of adding a missing holiday, for
example).

This would have the advantage of preserving the current behaviour (and
minimal code changes!).

Simon

-----Original Message-----
From: Luigi Ballabio [mailto:[hidden email]]
Sent: 06 May 2008 14:54
To: Simon Ibbotson - Straumur
Cc: Ferdinando Ametrano; a akpitidis;
[hidden email]
Subject: Re: [Quantlib-users] Calendars


On Fri, 2008-03-28 at 17:07 +0000, Simon Ibbotson wrote:
> I'd agree with "T", it would be nice to have a bespoke calendar... so
we
> can quickly add a calendar that isn't present in QuantLib without
having
> to release a new library. For instance, the calendar for the Kazakh
> Tenge isn't in QuantLib yet and adding a class with the relevant date
> rules would take time/effort and a library release.

This isn't entirely true (you could implement Kazakh Tenge and link it
to your application together with the main library) but I agree, we
might have a bespoke calendar.

It should have copy semantics, right? I mean, if we write:

BespokeCalendar c1;
... initialize c1 with holidays ...

Calendar c2 = c1;  // same holidays as c1

...later on...
c2.addHoliday(...);

c1 shouldn't be modified by the call through c2, I guess. Or should it?

Luigi


--

Testing can never demonstrate the absence of errors in software, only
their presence.
-- W.E. Dijkstra



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Calendars

Luigi Ballabio
On Tue, 2008-05-06 at 14:08 +0000, Simon Ibbotson - Straumur wrote:
> I don't think it needs to have copy semantics. Calendars are usually
> static data so I wouldn't think that several versions of a calendar
> would be necessary/desirable.
>
> In other words, if we add a holiday to a given - specific - holiday
> calendar, that should propagate into all instances of that calendar.

Yes, this is the current behavior for all specific calendars (TARGET
etc.) (except for JointCalendar)

> I can't think of a reason you might want two differing versions of the
> same calendar (except for cases which could be resolved external to
> QuantLib - measuring the impact of adding a missing holiday, for
> example).

For a specific calendar, no reason. For bespoke calendars, things are
different. If we write

BespokeCalendar c1;
BespokeCalendar c2;

we should be able to give different holidays to c1 and c2---or we'd be
limited to just one bespoke calendar.  The question is, when we write

BespokeCalendar c1;
BespokeCalendar c2 = c1;

should c1 and c2 stay linked, so that modifications in one are
propagated to the other?

> This would have the advantage of preserving the current behaviour (and
> minimal code changes!).

Yes, you have a point here.

Luigi


--

I hate quotations.
-- Ralph Waldo Emerson



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Calendars

Simon Ibbotson - Straumur
If we defined something like
vector<Date> RigaHolidays;
vector<Date> GreenlandHolidays;

...

and we added a label to the holiday, so we can fulfil the member function ::name()

BespokeCalendar c1("Riga", RigaHolidays);
BespokeCalendar c2("Greenland", GreenlandHolidays);

c1 = c2;

Then c1 and c2 would both contain Greenland holidays, a label of "Greenland" and should link to the same holiday set - so they should retain their link.

If we have

c1 = c2;

and we don't retain the link, then the only reason for doing this is so we can easily copy a holiday set to instantiate another holiday set before making it slightly different.
I'd suggest that making the behaviour consistent across Calendar classes is more important.




-----Original Message-----
From: Luigi Ballabio [mailto:[hidden email]]
Sent: 06 May 2008 17:11
To: Simon Ibbotson - Straumur
Cc: Ferdinando Ametrano; a akpitidis; [hidden email]
Subject: RE: [Quantlib-users] Calendars


On Tue, 2008-05-06 at 14:08 +0000, Simon Ibbotson - Straumur wrote:
> I don't think it needs to have copy semantics. Calendars are usually
> static data so I wouldn't think that several versions of a calendar
> would be necessary/desirable.
>
> In other words, if we add a holiday to a given - specific - holiday
> calendar, that should propagate into all instances of that calendar.

Yes, this is the current behavior for all specific calendars (TARGET
etc.) (except for JointCalendar)

> I can't think of a reason you might want two differing versions of the
> same calendar (except for cases which could be resolved external to
> QuantLib - measuring the impact of adding a missing holiday, for
> example).

For a specific calendar, no reason. For bespoke calendars, things are
different. If we write

BespokeCalendar c1;
BespokeCalendar c2;

we should be able to give different holidays to c1 and c2---or we'd be
limited to just one bespoke calendar.  The question is, when we write

BespokeCalendar c1;
BespokeCalendar c2 = c1;

should c1 and c2 stay linked, so that modifications in one are
propagated to the other?

> This would have the advantage of preserving the current behaviour (and
> minimal code changes!).

Yes, you have a point here.

Luigi


--

I hate quotations.
-- Ralph Waldo Emerson


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Calendars

Luigi Ballabio
On Tue, 2008-05-06 at 17:05 +0000, Simon Ibbotson - Straumur wrote:

> If we defined something like
> vector<Date> RigaHolidays;
> vector<Date> GreenlandHolidays;
>
> and we added a label to the holiday, so we can fulfil the member function ::name()
>
> BespokeCalendar c1("Riga", RigaHolidays);
> BespokeCalendar c2("Greenland", GreenlandHolidays);
>
> c1 = c2;
>
> Then c1 and c2 would both contain Greenland holidays, a label of "Greenland" and should link to the same holiday set - so they should retain their link.

Ok, agreed.

Luigi


--

Cogito ergo I'm right and you're wrong.
-- Blair Houghton



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users