Login  Register

Question about year fraction calculation of China inter-bank bond

Posted by 杨拓 on Jul 20, 2016; 7:55am
URL: http://quantlib.414.s1.nabble.com/Question-about-year-fraction-calculation-of-China-inter-bank-bond-tp17609.html

Dear Quantlib,

I'm a Quantlib user from China. I was doing some calculation of yield about fixed coupon bond. As we all know, the day counter is the basis of yield calcutation of Bond. 

Quantlib provieds such as ACT/ACT including ISDA, ISMA and ABF, ACT365 and so on. But, I found that these international day count convention is not applicable for China.

The China inter bank day count convention is as folows.  The year fraction is t/TS, where t is the actual number of accrued interest days, and TS is the actual number of current period of interest days. 

This is different from ISDA, which considering the interest frequency. There are several examples:

1the issue date is 2009/8/15maturity date is 2011/8/15settlement date is 2009/9/15frequency is annual, the year fraction is  1+2010/8/15-2009/9/15/365=1+334/365=1.9151

2the issue date is 2009/8/15maturity date is 2012/8/15settlement date is 2011/9/15frequency is annual, the year fraction is 2012/8/15-2011/9/15/366=335/366=0.9153

3the issue date is 2011/8/15maturity date is 2012/8/15settlement date is 2012/1/1frequency is Quarterly, the year fraction is  0.5+2012/2/15-2012/1/1/2012/2/15-2011/11/15=0.5+45/92*0.25=0.6223


If I want to calculate the year fraction according to China inter bank day count convention, I must use the additional arguement of interest frequency.

As I know, the all day counter class in Quantlib is inherited from Impl class, but this class only have the vitual yearfraction function as 

virtual Time yearFraction(const Date& d1, const Date& d2, const Date& refPeriodStart, const Date& refPeriodEnd) const = 0; It only have arguement about date.

If I want to rewrite the day counter class for China, I must change the interface of Impl, but this will cause that I will change all the day counter class in Quantlib.

Can you give me some suggestions about how to write another day counter class for China condition and have the less change in other class.

I will very appreciate it if you can help me.

Thank you very much! 

 



--
Best Regards!
Tuo Yang
Beijing University of Posts and Telecommuncations, BUPT
Xitucheng Road #10, Beijing
Tel:(+86) 152-0136-1443
E-Mail:[hidden email]

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users