|
From: Luigi B. <lui...@gm...> - 2010-10-27 12:43:17
|
On Wed, 2010-10-06 at 16:39 +0800, Raikage wrote: > I have been trying out quantlib-python (0.9.9 ubuntu lucid) and was > wondering how to mimic excel functions such as price, etc. > My starting point was the bonds.py in the test directory and the excel > price function PRICE(settlement,maturity,rate,yld,redemption,frequency,basis). > Since Quantlib.Schedule needed for FixedRateBond needs an > effectiveDate , what is the best way to handle this? I would go backwards from the maturity with the bond frequency until I get a date before the settlement. (For example, settlement = November 2nd 2010, maturity = July 15th, 2012, semiannual frequency, I'd go: 2012-07-15 -> 2012-01-15 -> 2011-07-15 -> 2011-01-15 -> 2010-07-15 and use the last one as effective date.) Luigi -- Call on God, but row away from the rocks. -- Indian proverb |