FixedCouponBond pricing wrong?

Posted by Feng Ning on
URL: http://quantlib.414.s1.nabble.com/FixedCouponBond-pricing-wrong-tp3741.html

I am new to QuantLib. Hope sb. can help me this out.

See the test_suite/bonds.cpp, testCachedYield() function.
For bond1, the marketPrice1=99.203125.
However, my caculation on scratch paper shows the price
p = c*(u+u^2+u^3+u^4) + 1*u^4 = 98.41
where c = 0.025, u =1/(1+y/2)

The two results differ. I realize that I use a different calendar and
daycounting scheme. So I hack the bonds.cpp code to use
Calandar bondCalendar = TARGET();
DayCounter bondDayCount = OneDayCounter();

then, the program computes the price = 95.91, still differ!

Anybody knows why?