swap paying a fixed rate against BMA coupons
More...
#include <qle/instruments/fixedbmaswap.hpp>
|
| FixedBMASwap (Type type, Real nominal, const Schedule &fixedSchedule, Rate fixedRate, const DayCounter &fixedDayCount, const Schedule &bmaSchedule, const QuantLib::ext::shared_ptr< BMAIndex > &bmaIndex, const DayCounter &bmaDayCount) |
|
|
Real | fixedRate () const |
|
Real | nominal () const |
|
Type | type () const |
| "payer" or "receiver" refer to the BMA leg More...
|
|
const Leg & | bmaLeg () const |
|
const Leg & | fixedLeg () const |
|
swap paying a fixed rate against BMA coupons
Definition at line 35 of file fixedbmaswap.hpp.
◆ Type
◆ FixedBMASwap()
FixedBMASwap |
( |
Type |
type, |
|
|
Real |
nominal, |
|
|
const Schedule & |
fixedSchedule, |
|
|
Rate |
fixedRate, |
|
|
const DayCounter & |
fixedDayCount, |
|
|
const Schedule & |
bmaSchedule, |
|
|
const QuantLib::ext::shared_ptr< BMAIndex > & |
bmaIndex, |
|
|
const DayCounter & |
bmaDayCount |
|
) |
| |
Definition at line 35 of file fixedbmaswap.cpp.
42
43 legs_[0] = FixedRateLeg(fixedSchedule)
45 .withCouponRates(
fixedRate, fixedDayCount)
46 .withPaymentAdjustment(fixedSchedule.businessDayConvention());
47
48 legs_[1] = AverageBMALeg(bmaSchedule, bmaIndex)
50 .withPaymentDayCounter(bmaDayCount)
51 .withPaymentAdjustment(bmaSchedule.businessDayConvention());
52
53 for (Size j = 0; j < 2; ++j) {
54 for (Leg::iterator i = legs_[j].begin(); i != legs_[j].end(); ++i)
55 registerWith(*i);
56 }
57
60 payer_[0] = +1.0;
61 payer_[1] = -1.0;
62 break;
64 payer_[0] = -1.0;
65 payer_[1] = +1.0;
66 break;
67 default:
68 QL_FAIL("Unknown BMA-swap type");
69 }
70}
Type type() const
"payer" or "receiver" refer to the BMA leg
◆ fixedRate()
◆ nominal()
◆ type()
"payer" or "receiver" refer to the BMA leg
Definition at line 76 of file fixedbmaswap.cpp.
◆ bmaLeg()
const Leg & bmaLeg |
( |
| ) |
const |
◆ fixedLeg()
const Leg & fixedLeg |
( |
| ) |
const |
◆ fixedLegBPS()
Real fixedLegBPS |
( |
| ) |
const |
Definition at line 82 of file fixedbmaswap.cpp.
82 {
83 calculate();
84 QL_REQUIRE(legBPS_[0] != Null<Real>(), "result not available");
85 return legBPS_[0];
86}
◆ fixedLegNPV()
Real fixedLegNPV |
( |
| ) |
const |
Definition at line 88 of file fixedbmaswap.cpp.
88 {
89 calculate();
90 QL_REQUIRE(legNPV_[0] != Null<Real>(), "result not available");
91 return legNPV_[0];
92}
◆ fairRate()
Definition at line 94 of file fixedbmaswap.cpp.
94 {
95 calculate();
96 QL_REQUIRE(
fairRate_ != Null<Rate>(),
"result not available");
98}
◆ bmaLegBPS()
Definition at line 100 of file fixedbmaswap.cpp.
100 {
101 calculate();
102 QL_REQUIRE(legBPS_[1] != Null<Real>(), "result not available");
103 return legBPS_[1];
104}
◆ bmaLegNPV()
Definition at line 106 of file fixedbmaswap.cpp.
106 {
107 calculate();
108 QL_REQUIRE(legNPV_[1] != Null<Real>(), "result not available");
109 return legNPV_[1];
110}
◆ fetchResults()
void fetchResults |
( |
const PricingEngine::results * |
r | ) |
const |
|
override |
Definition at line 112 of file fixedbmaswap.cpp.
112 {
113 static const Spread basisPoint = 1.0e-4;
114
115 Swap::fetchResults(r);
116
117 const FixedBMASwap::results* results = dynamic_cast<const FixedBMASwap::results*>(r);
118 if (results) {
120 } else {
122 }
124
125 if (legBPS_[0] != Null<Real>())
127 }
128}
◆ type_
◆ nominal_
◆ fixedRate_
◆ fairRate_