|
17 | 17 | */ |
18 | 18 |
|
19 | 19 | #include <orea/engine/parsensitivityutilities.hpp> |
| 20 | +#include <ored/utilities/log.hpp> |
20 | 21 | #include <ql/instruments/creditdefaultswap.hpp> |
21 | 22 | #include <ql/instruments/forwardrateagreement.hpp> |
22 | 23 | #include <ql/instruments/makecapfloor.hpp> |
|
28 | 29 | #include <ql/pricingengine.hpp> |
29 | 30 | #include <ql/pricingengines/capfloor/bacheliercapfloorengine.hpp> |
30 | 31 | #include <ql/pricingengines/capfloor/blackcapfloorengine.hpp> |
| 32 | +#include <ql/quotes/simplequote.hpp> |
31 | 33 | #include <ql/termstructures/volatility/inflation/yoyinflationoptionletvolatilitystructure.hpp> |
32 | 34 | #include <qle/instruments/brlcdiswap.hpp> |
33 | 35 | #include <qle/instruments/crossccybasismtmresetswap.hpp> |
@@ -55,15 +57,16 @@ class ImpliedCapFloorVolHelper { |
55 | 57 | public: |
56 | 58 | ImpliedCapFloorVolHelper( |
57 | 59 | const QuantLib::Instrument& cap, |
58 | | - const std::function<QuantLib::ext::shared_ptr<PricingEngine>(const Handle<Quote>)> engineGenerator, |
| 60 | + const std::function<QuantLib::ext::shared_ptr<QuantLib::PricingEngine>(const QuantLib::Handle<Quote>)> |
| 61 | + engineGenerator, |
59 | 62 | const Real targetValue); |
60 | 63 | Real operator()(Volatility x) const; |
61 | 64 | Real derivative(Volatility x) const; |
62 | 65 |
|
63 | 66 | private: |
64 | 67 | Real targetValue_; |
65 | 68 | QuantLib::ext::shared_ptr<PricingEngine> engine_; |
66 | | - QuantLib::ext::shared_ptr<SimpleQuote> vol_; |
| 69 | + QuantLib::ext::shared_ptr<QuantLib::SimpleQuote> vol_; |
67 | 70 | const Instrument::results* results_; |
68 | 71 | }; |
69 | 72 |
|
@@ -200,7 +203,7 @@ Volatility impliedVolatilityWrapper(const CapFloorType& cap, Real targetValue, c |
200 | 203 | // 2. Try to get implied Vol with defaults |
201 | 204 | TLOG("Getting impliedVolatility for cap (" << cap.maturityDate() << " strike " << strikeStr << ")"); |
202 | 205 | try { |
203 | | - Volatility vol = |
| 206 | + double vol = |
204 | 207 | impliedVolatilityImpl(cap, targetValue, d, guess, type, displacement, accuracy, maxEvaluations, |
205 | 208 | minVolLognormal, maxVolLognormal, minVolNormal, maxVolNormal, index); |
206 | 209 | TLOG("Got vol " << vol << " on first attempt"); |
|
0 commit comments