hello,
Is there a simple way to simulate a bond(fixed rate) that pays a single coupon on the maturity day as well as the principal, in QuantLib. I have tried to create a Fixed rate bond that has the FirstCouponDate = MaturityDate = FirstInstallmentDate but then I get the error std::exception: first date (March 10th, 2015) out of effective-termination date range [March 10th, 2003, March 10th, 2015)... regards D.G. ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Looks like you can do this with a combination of a fixed rate bond with regular coupon (at least once a year), then subtract that with a series of fixed rate bonds with the same coupon but shorter duration + a series of zero coupon bonds with the same maturities as the series of fixed rate bonds except the original bond. The combination would be what you want. |
On Mon, Jan 9, 2012 at 11:59 PM, StephenWong <[hidden email]> wrote:
> Dagur Gunnarsson-2 wrote: >> Is there a simple way to simulate a bond(fixed rate) that pays a single >> coupon on the maturity day as well as the principal > > Looks like you can do this with a combination of a fixed rate bond with > regular coupon (at least once a year), then subtract that with a series of > fixed rate bonds with the same coupon but shorter duration + a series of > zero coupon bonds with the same maturities as the series of fixed rate bonds > except the original bond. The combination would be what you want. Or you could just use a fixed rate bond with all coupons except the last paying a null rate, or you can create a schedule with null frequency. It depends on how the final payment accrues. Is the rate accrued over the whole duration of the bond, or just a subperiod? Luigi ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
A fixed rate bond with all coupons except that last paying nothing? How is that going to help? You lost me. |
On Tue, Jan 10, 2012 at 8:16 PM, StephenWong <[hidden email]> wrote:
> A fixed rate bond with all coupons except that last paying nothing? How is > that going to help? You lost me. He wants no payments until maturity, at which point there's a coupon plus redemption. Unless I misunderstood you, you proposed to use a bond with regular yearly coupons and subtract a shorter one; this makes all coupons null except the last, as the payments from the two bonds cancel out (you then need another zero-coupon to balance the extra redemption). What I was saying is that, instead of multiple bonds, he can use a single bond and specify explicitly that the first coupons don't pay anything. Luigi ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Never mind! I misinterpreted what you wrote. |
In reply to this post by Luigi Ballabio
Hello,
The rate is accrued over the whole period, so in at the maturity date the bond pays a coupon for the whole livetime of the bond, and the principal. regards Dagur G On Tue, Jan 10, 2012 at 8:17 AM, Luigi Ballabio <[hidden email]> wrote:
------------------------------------------------------------------------------ RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Dagur, See below a code that may help you. “Period(Once)” is what you look for. Regards, #include "stdafx.h" #include <ql/quantlib.hpp> #include <iostream> using namespace QuantLib; using namespace std; int _tmain(int argc, _TCHAR* argv[]) { Date issueDate(Date(15, Oct, 2011)), maturityDate(Date(15, Oct, 2016)); Rate rate(0.10); DayCounter dayCounter = Thirty360(Thirty360::European); Schedule *schedule = new Schedule(issueDate, maturityDate, Period(Once), Iceland(), Unadjusted, Unadjusted, DateGeneration::Backward, false); InterestRate coupon(0.06, dayCounter, Simple, Annual); FixedRateBond* bond = new FixedRateBond(0, 100.0, *schedule, vector<InterestRate>(1, coupon), Unadjusted, Real(100.0), issueDate); for (unsigned i = 0; i < bond->cashflows().size(); i++) { cout<<"day["<<i<<"] is "<<bond->cashflows()[i]->date()<<" "<<setprecision(15) <<dayCounter.yearFraction(Date(1, Jun, 2011), bond->cashflows()[i]->date())<<", cashflow["<<i<<"] is "<<bond->cashflows()[i]->amount()<<endl; } return 0; } From: Dagur Gunnarsson [mailto:[hidden email]] Hello, On Tue, Jan 10, 2012 at 8:17 AM, Luigi Ballabio <[hidden email]> wrote: On Mon, Jan 9, 2012 at 11:59 PM, StephenWong <[hidden email]> wrote: > Looks like you can do this with a combination of a fixed rate bond with Or you could just use a fixed rate bond with all coupons except the _______________________________________________ ------------------------------------------------------------------------------ RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |