本文整理汇总了C++中Bond::cashflows方法的典型用法代码示例。如果您正苦于以下问题:C++ Bond::cashflows方法的具体用法?C++ Bond::cashflows怎么用?C++ Bond::cashflows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bond
的用法示例。
在下文中一共展示了Bond::cashflows方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: zSpread
Spread BondFunctions::zSpread(const Bond& bond,
Real cleanPrice,
const shared_ptr<YieldTermStructure>& d,
const DayCounter& dayCounter,
Compounding compounding,
Frequency frequency,
Date settlement,
Real accuracy,
Size maxIterations,
Rate guess) {
if (settlement == Date())
settlement = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
"non tradable at " << settlement <<
" (maturity being " << bond.maturityDate() << ")");
Real dirtyPrice = cleanPrice + bond.accruedAmount(settlement);
dirtyPrice /= 100.0 / bond.notional(settlement);
return CashFlows::zSpread(bond.cashflows(),
d,
dirtyPrice,
dayCounter, compounding, frequency,
false, settlement, settlement,
accuracy, maxIterations, guess);
}
示例2: nextCashFlow
Leg::const_iterator BondFunctions::nextCashFlow(const Bond& bond,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
return CashFlows::nextCashFlow(bond.cashflows(),
false, settlement);
}
示例3: previousCashFlowDate
Date BondFunctions::previousCashFlowDate(const Bond& bond,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
return CashFlows::previousCashFlowDate(bond.cashflows(),
false, settlement);
}
示例4: nextCashFlowAmount
Real BondFunctions::nextCashFlowAmount(const Bond& bond,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
return CashFlows::nextCashFlowAmount(bond.cashflows(),
false, settlement);
}
示例5: yieldValueBasisPoint
Real BondFunctions::yieldValueBasisPoint(const Bond& bond,
Rate yield,
const DayCounter& dayCounter,
Compounding compounding,
Frequency frequency,
Date settlement) {
InterestRate y(yield, dayCounter, compounding, frequency);
return CashFlows::yieldValueBasisPoint(bond.cashflows(), y,
false, settlement);
}
示例6: referencePeriodEnd
Date BondFunctions::referencePeriodEnd(const Bond& bond,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
"non tradable at " << settlement <<
" (maturity being " << bond.maturityDate() << ")");
return CashFlows::referencePeriodEnd(bond.cashflows(),
false, settlement);
}
示例7: accruedDays
BigInteger BondFunctions::accruedDays(const Bond& bond,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
"non tradable at " << settlement <<
" (maturity being " << bond.maturityDate() << ")");
return CashFlows::accruedDays(bond.cashflows(),
false, settlement);
}
示例8: accruedAmount
Real BondFunctions::accruedAmount(const Bond& bond,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
"non tradable at " << settlement <<
" (maturity being " << bond.maturityDate() << ")");
return CashFlows::accruedAmount(bond.cashflows(),
false, settlement) *
100.0 / bond.notional(settlement);
}
示例9: bps
Real BondFunctions::bps(const Bond& bond,
const YieldTermStructure& discountCurve,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
"non tradable at " << settlement <<
" (maturity being " << bond.maturityDate() << ")");
return CashFlows::bps(bond.cashflows(), discountCurve,
false, settlement) *
100.0 / bond.notional(settlement);
}
示例10: cleanPrice
Real BondFunctions::cleanPrice(const Bond& bond,
const InterestRate& yield,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
"non tradable at " << settlement <<
" (maturity being " << bond.maturityDate() << ")");
Real dirtyPrice = CashFlows::npv(bond.cashflows(), yield,
false, settlement) *
100.0 / bond.notional(settlement);
return dirtyPrice - bond.accruedAmount(settlement);
}
示例11: duration
Time BondFunctions::duration(const Bond& bond,
const InterestRate& yield,
Duration::Type type,
Date settlement) {
if (settlement == Date())
settlement = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
"non tradable at " << settlement <<
" (maturity being " << bond.maturityDate() << ")");
return CashFlows::duration(bond.cashflows(), yield,
type,
false, settlement);
}
示例12: atmRate
Rate BondFunctions::atmRate(const Bond& bond,
const YieldTermStructure& discountCurve,
Date settlement,
Real cleanPrice) {
if (settlement == Date())
settlement = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
"non tradable at " << settlement <<
" (maturity being " << bond.maturityDate() << ")");
Real dirtyPrice = cleanPrice==Null<Real>() ? Null<Real>() :
cleanPrice + bond.accruedAmount(settlement);
return CashFlows::atmRate(bond.cashflows(), discountCurve,
false, settlement, settlement,
dirtyPrice);
}
示例13: yield
static Rate yield(Solver solver,
const Bond& bond,
Real cleanPrice,
const DayCounter& dayCounter,
Compounding compounding,
Frequency frequency,
Date settlementDate = Date(),
Real accuracy = 1.0e-10,
Rate guess = 0.05) {
if (settlementDate == Date())
settlementDate = bond.settlementDate();
QL_REQUIRE(BondFunctions::isTradable(bond, settlementDate),
"non tradable at " << settlementDate <<
" (maturity being " << bond.maturityDate() << ")");
Real dirtyPrice = cleanPrice + bond.accruedAmount(settlementDate);
dirtyPrice /= 100.0 / bond.notional(settlementDate);
return CashFlows::yield<Solver>(solver, bond.cashflows(),
dirtyPrice, dayCounter, compounding,
frequency, false, settlementDate,
settlementDate, accuracy, guess);
}
示例14: startDate
Date BondFunctions::startDate(const Bond& bond) {
return CashFlows::startDate(bond.cashflows());
}
示例15: maturityDate
Date BondFunctions::maturityDate(const Bond& bond) {
return CashFlows::maturityDate(bond.cashflows());
}