ActualActual::yearFraction(d1,d2) VS Bloomberg

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

ActualActual::yearFraction(d1,d2) VS Bloomberg

Nguyen Xuan Son
Hi,
when I test my program with Bloomber, I found that there is a problem with yearFraction method.
Check with
d1=Date(20,May,2004)
d2=Date(26,July,2004;
the ActualActual::dayCounter give the correct result of 67 days. So the yearFraction from Bloomberg is simple
67/365=0.18356
whereas QuantLib give
ActualActual::ISMA_Impl::yearFraction(d1,d2)=0.166667 (2 months/12)

There is no Implementation in ActualActual which return this simple yearFraction "à la Bloomberg" (so may be we should add one new simple implementation). Can someone explain the reason that Bloomberg use this convention to me (even It is shown that the bond's cashflow daycounter is ACT/ACT  !
XS



Reply | Threaded
Open this post in threaded view
|

Re: ActualActual::yearFraction(d1,d2) VS Bloomberg

chiara.fornarola

Hi

I had some exsperience in testing Bloomberg ASW  and YA functions, so I dealt also with daycount and I can say Bloomberg is giving to you this result because uses this kind of convention:
        Actual/Actual (bond basis)= the time in years is calculated as follows: if the period is less than one year the accrual factor is equal to the actual number of days between d_e and d_t divided by the number of days in the period from (d_t – 1 year) to d_t (either 365 or 366).  If the period is greater than one year, the accrual factor is equal to the number of whole years plus the accrual of a stub period calculated as above.        
        where: d_e – the effective date of the accruing period
            d_t – the termination date of the accruing period
 
        I hope this can help
 

Chiara Fornarola

Risk Pricing e Valutazioni Finanziarie
Direzione Risk Management
Servizio Portfolio Management
Piazza P. Ferrari, 10 20121 Milano
Tel +39 0287939108 Fax +39 0287937646



[hidden email]
Inviato da: [hidden email]

21/07/2004 13.52

       
        Per:        [hidden email], [hidden email]
        Cc:        [hidden email]
        Oggetto:        [Quantlib-users] ActualActual::yearFraction(d1,d2) VS Bloomberg



Hi,
when I test my program with Bloomber, I found that there is a problem with yearFraction method.
Check with
d1=Date(20,May,2004)
d2=Date(26,July,2004;
the ActualActual::dayCounter give the correct result of 67 days. So the yearFraction from Bloomberg is simple
67/365=0.18356
whereas QuantLib give
ActualActual::ISMA_Impl::yearFraction(d1,d2)=0.166667 (2 months/12)

There is no Implementation in ActualActual which return this simple yearFraction "à la Bloomberg" (so may be we should add one new simple implementation). Can someone explain the reason that Bloomberg use this convention to me (even It is shown that the bond's cashflow daycounter is ACT/ACT  !
XS



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id040&op=click
_______________________________________________
Quantlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



-----------------------------------------------------------------------------
Chi riceve il presente  messaggio e` tenuto a verificare se lo stesso non gli
sia pervenuto per  errore.  In tal caso e` pregato di avvisare immediatamente
il mittente  e,  tenuto  conto  delle  responsabilita` connesse  all'indebito
utilizzo e/o  divulgazione  del  messaggio  e/o  delle  informazioni  in esso
contenute,  voglia  cancellare  l'originale  e distruggere  le varie copie  o
stampe.

The receiver  of this message is required to check if  he/she has received it
erroneously.  If  so,  the  receiver  is  requested to immediately inform the
sender and - in consideration of the responsibilities  arising from undue use
and/or disclosure of the message  and/or  the information contained therein -
destroy the original message and any copy or printout thereof.
-----------------------------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: ActualActual::yearFraction(d1,d2) VS Bloomberg

Luigi Ballabio-2
On 2004.07.23 11:22, [hidden email] wrote:

> I had some exsperience in testing Bloomberg ASW  and YA functions, so
> I dealt also with daycount and I can say Bloomberg is giving to you  
> this result because uses this kind of convention:
>         Actual/Actual (bond basis)= the time in years is calculated  
> as follows: if the period is less than one year the accrual factor is
> equal to the actual number of days between d_e and d_t divided by the  
> number of days in the period from (d_t ? 1 year) to d_t (either 365  
> or 366).  If the period is greater than one year, the accrual factor  
> is equal to the numberof whole years plus the accrual of a stub  
> period calculated as above.

Chiara,
        thanks for the clarification. The above algorithm is available,  
even though it might not be immediately recognizable when reading the  
source :)

Just instantiate the day counter as:

    DayCounter dc = ActualActual(ActualActual::AFB);

or (which is the same):

    DayCounter dc = ActualActual(ActualActual::Euro);

Later,
        Luigi