Deposit Instrument.
More...
#include <qle/instruments/deposit.hpp>
|
| Deposit (const Real nominal, const Rate rate, const Period &tenor, const Natural fixingDays, const Calendar &calendar, const BusinessDayConvention convention, const bool endOfMonth, const DayCounter &dayCounter, const Date &tradeDate, const bool isLong=true, const Period forwardStart=0 *Days) |
|
|
Date | fixingDate () const |
|
Date | startDate () const |
|
Date | maturityDate () const |
|
Real | fairRate () const |
|
const Leg & | leg () const |
|
Deposit Instrument.
This class holds the term sheet data for a Deposit Instrument.
\ingroup instruments
Definition at line 43 of file deposit.hpp.
◆ Deposit()
Deposit |
( |
const Real |
nominal, |
|
|
const Rate |
rate, |
|
|
const Period & |
tenor, |
|
|
const Natural |
fixingDays, |
|
|
const Calendar & |
calendar, |
|
|
const BusinessDayConvention |
convention, |
|
|
const bool |
endOfMonth, |
|
|
const DayCounter & |
dayCounter, |
|
|
const Date & |
tradeDate, |
|
|
const bool |
isLong = true , |
|
|
const Period |
forwardStart = 0 * Days |
|
) |
| |
Definition at line 30 of file deposit.cpp.
32 {
33
35 index_ = QuantLib::ext::make_shared<IborIndex>(
"deposit-helper-index", tenor, fixingDays, Currency(), calendar, convention,
36 endOfMonth, dayCounter);
37
38 Date referenceDate = calendar.adjust(tradeDate);
42 Real w = isLong ? 1.0 : -1.0;
43 leg_[0] = QuantLib::ext::make_shared<Redemption>(-w * nominal,
startDate_);
47}
QuantLib::ext::shared_ptr< IborIndex > index_
◆ isExpired()
◆ setupArguments()
void setupArguments |
( |
PricingEngine::arguments * |
args | ) |
const |
|
override |
Definition at line 56 of file deposit.cpp.
56 {
57
58 Deposit::arguments* arguments = dynamic_cast<Deposit::arguments*>(args);
59 QL_REQUIRE(arguments, "wrong argument type in deposit");
60 arguments->leg =
leg_;
63}
◆ fetchResults()
void fetchResults |
( |
const PricingEngine::results * |
r | ) |
const |
|
override |
Definition at line 65 of file deposit.cpp.
65 {
66
67 Instrument::fetchResults(r);
68 const Deposit::results* results = dynamic_cast<const Deposit::results*>(r);
69 QL_REQUIRE(results, "wrong result type");
71}
◆ fixingDate()
Date fixingDate |
( |
| ) |
const |
◆ startDate()
◆ maturityDate()
Date maturityDate |
( |
| ) |
const |
◆ fairRate()
Definition at line 65 of file deposit.hpp.
65 {
66 calculate();
67 QL_REQUIRE(
fairRate_ != Null<Real>(),
"Deposit::fairRate(): not provided");
69 }
◆ leg()
const Leg & leg |
( |
| ) |
const |
◆ setupExpired()
void setupExpired |
( |
| ) |
const |
|
overrideprivate |
Definition at line 51 of file deposit.cpp.
51 {
52 Instrument::setupExpired();
54}
◆ fixingDate_
◆ startDate_
◆ maturityDate_
◆ index_
QuantLib::ext::shared_ptr<IborIndex> index_ |
|
private |
◆ leg_
◆ fairRate_