Hey Guys,
Long time no questions - looking forward to getting back into QL again! Spending too much time ensconced in Javascript.
In any case, I can't figure out what I am doing wrong.
I create a FixedRateBond object with all the requisite accoutrements.
Then call a zSpread function reusing everything from the FixedRateBond object.
For the NPV which'll be calibrated to, I take a quoted clean market price and add the accrued amount from the bond object.
For example, MV = 135, Accrued Amt = 9.99, and NPV ~= 145.
However, when I take the output of the zSpread function and create a new object, the NPV turns out to be ~144.
I tried increasing accuracy and iterations but to no avail.
Are there any common gotchas while using the zSpread function?
As I write this I realise, a code example would be very helpful. I will do that now.