Re: Question about ActualActual::ICMA

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Question-about-ActualActual-ICMA-tp8627p8628.html

On Fri, 2010-05-07 at 07:49 -0700, [hidden email] wrote:

> Hi there,
>
> I was trying to compute a year fraction with these lines of code:
>
> Daycounter dc = ActualActual(ActualActual::ICMA);
> Date d1 = Date(19,April,2013);
> Date d2 = Date(22,April,2014);
> Time yf = dc.yearFraction(d1,d2);
>
> yf appears to have a value of 1.0 rather than 368.0/365.0, as I would have
> expected.  Is there some issue with the daycounter, or am I just using it
> incorrectly?

You probably want to pass two additional dates to the yearFraction()
call in order to specify the reference period.  As it is, I think it
takes d1 and d2 as reference, so you end up with 368/368.

Luigi



--

Humphrey's Requirements Uncertainty Principle:
For a new software system, the requirements will not be
completely known until after the users have used it.



------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users