forked from lballabio/QuantLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added zero-coupon and floating-rate bonds
- Loading branch information
Showing
9 changed files
with
413 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Copyright (C) 2005 StatPro Italia srl | ||
This file is part of QuantLib, a free-software/open-source library | ||
for financial quantitative analysts and developers - http://quantlib.org/ | ||
QuantLib is free software: you can redistribute it and/or modify it under the | ||
terms of the QuantLib license. You should have received a copy of the | ||
license along with this program; if not, please email quantlib-dev@lists.sf.net | ||
The license is also available online at http://quantlib.org/html/license.html | ||
This program is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
FOR A PARTICULAR PURPOSE. See the license for more details. | ||
*/ | ||
|
||
#include <ql/Instruments/zerocouponbond.hpp> | ||
#include <ql/CashFlows/simplecashflow.hpp> | ||
|
||
namespace QuantLib { | ||
|
||
ZeroCouponBond::ZeroCouponBond( | ||
const Date& issueDate, | ||
const Date& maturityDate, | ||
Integer settlementDays, | ||
const DayCounter& dayCounter, | ||
const Calendar& calendar, | ||
BusinessDayConvention convention, | ||
Real redemption, | ||
const Handle<YieldTermStructure>& discountCurve) | ||
: Bond(dayCounter, calendar, convention, settlementDays, discountCurve) { | ||
|
||
issueDate_ = datedDate_ = issueDate; | ||
maturityDate_ = maturityDate; | ||
frequency_ = Once; | ||
|
||
redemption_ = boost::shared_ptr<CashFlow>( | ||
new SimpleCashFlow(redemption,maturityDate)); | ||
|
||
cashFlows_ = std::vector<boost::shared_ptr<CashFlow> >(); | ||
} | ||
|
||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
Copyright (C) 2005 StatPro Italia srl | ||
This file is part of QuantLib, a free-software/open-source library | ||
for financial quantitative analysts and developers - http://quantlib.org/ | ||
QuantLib is free software: you can redistribute it and/or modify it under the | ||
terms of the QuantLib license. You should have received a copy of the | ||
license along with this program; if not, please email quantlib-dev@lists.sf.net | ||
The license is also available online at http://quantlib.org/html/license.html | ||
This program is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
FOR A PARTICULAR PURPOSE. See the license for more details. | ||
*/ | ||
|
||
/*! \file zerocouponbond.hpp | ||
\brief zero-coupon bond | ||
*/ | ||
|
||
#ifndef quantlib_zero_coupon_bond_hpp | ||
#define quantlib_zero_coupon_bond_hpp | ||
|
||
#include <ql/Instruments/bond.hpp> | ||
|
||
namespace QuantLib { | ||
|
||
//! zero-coupon bond | ||
/*! \ingroup instruments | ||
\test calculations are tested by checking results against | ||
cached values. | ||
*/ | ||
class ZeroCouponBond : public Bond { | ||
public: | ||
ZeroCouponBond(const Date& issueDate, | ||
const Date& maturityDate, | ||
Integer settlementDays, | ||
const DayCounter& dayCounter, | ||
const Calendar& calendar, | ||
BusinessDayConvention convention = Following, | ||
Real redemption = 100.0, | ||
const Handle<YieldTermStructure>& discountCurve | ||
= Handle<YieldTermStructure>()); | ||
}; | ||
|
||
} | ||
|
||
|
||
#endif |
Oops, something went wrong.