Business Day Convention in Calendar Does not Seem to work

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

Business Day Convention in Calendar Does not Seem to work

imachabeli
Below is the sample (in C# but hopefully context is clear)

            Calendar cal = new
UnitedStates(UnitedStates.Market.GovernmentBond);
            Date dec30 = new Date(30, Month.December , 2010);
            Date d2mf = cal.advance(dec30, new Period(2, TimeUnit.Days),
BusinessDayConvention.ModifiedFollowing);
            Date d2f = cal.advance(dec30, new Period(2, TimeUnit.Days),
BusinessDayConvention.Following);
            Console.WriteLine("ModifiedFollowing -- {0}", d2mf.__str__());
            Console.WriteLine("Following -- {0}", d2f.__str__());


ModifiedFollowing -- January 3rd, 2011   //I would expect to see Dec 31 for
ModifiedFollowing
Following -- January 3rd, 2011

Regards
Irakli


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Business Day Convention in Calendar Does not Seem to work

Luigi Ballabio
On Wed, 2010-12-15 at 11:29 -0500, Irakli Machabeli wrote:

> Below is the sample (in C# but hopefully context is clear)
>
>             Calendar cal = new
> UnitedStates(UnitedStates.Market.GovernmentBond);
>             Date dec30 = new Date(30, Month.December , 2010);
>             Date d2mf = cal.advance(dec30, new Period(2, TimeUnit.Days),
> BusinessDayConvention.ModifiedFollowing);
>             Console.WriteLine("ModifiedFollowing -- {0}", d2mf.__str__());
>
> ModifiedFollowing -- January 3rd, 2011   //I would expect to see Dec 31

At first, that's what I would have expected, too.  But then, I'm not
sure that it makes a great deal of sense to say "advance 2 business
days, Modified Following"

Nando, you're our resident ISDA expert.  What do you think?

Luigi


--

Quote me as saying I was misquoted.
-- Groucho Marx



------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev