File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
ql/models/shortrate/calibrationhelpers Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,14 @@ namespace QuantLib {
146
146
}
147
147
swaption_->setPricingEngine (engine);
148
148
Real value = swaption_->NPV ();
149
+
150
+ timeToExpiry_ = swaption_->result <Real>(" timeToExpiry" );
151
+ swapLength_ = swaption_->result <Real>(" swapLength" );
152
+ atmForward_ = swaption_->result <Real>(" atmForward" );
153
+ annuity_ = swaption_->result <Real>(" annuity" );
154
+ vega_ = swaption_->result <Real>(" vega" );
155
+ stdDev_ = swaption_->result <Real>(" stdDev" );
156
+
149
157
swaption_->setPricingEngine (engine_);
150
158
return value;
151
159
}
Original file line number Diff line number Diff line change @@ -93,6 +93,15 @@ namespace QuantLib {
93
93
Real modelValue () const override ;
94
94
Real blackPrice (Volatility volatility) const override ;
95
95
96
+ // populated in call to blackPrice():
97
+ Real timeToExpiry () const { return timeToExpiry_; }
98
+ Real swapLength () const { return swapLength_; }
99
+ Real strike () const { return strike_; }
100
+ Real atmForward () const { return atmForward_; }
101
+ Real annuity () const { return annuity_; };
102
+ Real vega () const { return vega_; }
103
+ Real stdDev () const { return stdDev_; }
104
+
96
105
const ext::shared_ptr<FixedVsFloatingSwap>& underlying () const {
97
106
calculate ();
98
107
return swap_;
@@ -126,8 +135,13 @@ namespace QuantLib {
126
135
mutable Rate exerciseRate_;
127
136
mutable ext::shared_ptr<FixedVsFloatingSwap> swap_;
128
137
mutable ext::shared_ptr<Swaption> swaption_;
138
+ mutable Real timeToExpiry_ = Null<Real>();
139
+ mutable Real swapLength_ = Null<Real>();
140
+ mutable Real atmForward_ = Null<Real>();
141
+ mutable Real annuity_ = Null<Real>();
142
+ mutable Real vega_ = Null<Real>();
143
+ mutable Real stdDev_ = Null<Real>();
129
144
};
130
-
131
145
}
132
146
133
147
#endif
You can’t perform that action at this time.
0 commit comments