|
36 | 36 | #include <qle/termstructures/pricecurve.hpp> |
37 | 37 | #include <qle/termstructures/zeroinflationcurveobservermoving.hpp> |
38 | 38 | #include <qle/termstructures/yoyinflationcurveobservermoving.hpp> |
| 39 | +#include <qle/termstructures/proxyoptionletvolatility.hpp> |
39 | 40 |
|
40 | 41 | #include <ql/currencies/europe.hpp> |
41 | 42 | #include <ql/indexes/ibor/eonia.hpp> |
@@ -408,17 +409,29 @@ Handle<OptionletVolatilityStructure> DependencyMarket::capFloorVol(const string& |
408 | 409 | addMarketObject(MarketObject::CapFloorVol, name, config); |
409 | 410 | // ensure that the dependent ibor indiex is captured |
410 | 411 | iborIndex(capFloorVolIndexBase(name, config).first, config); |
411 | | - return flatRateCvs(); |
| 412 | + Handle<OptionletVolatilityStructure> handleflatRateCvs = flatRateCvs(); |
| 413 | + if (curveConfigs_ && curveConfigs_->hasCapFloorVolCurveConfig(name)) { |
| 414 | + auto cc = curveConfigs_->capFloorVolCurveConfig(name); |
| 415 | + if (!cc->proxyTargetIndex().empty()){ |
| 416 | + QuantLib::ext::shared_ptr<QuantExt::ProxyOptionletVolatility> capletVol = QuantLib::ext::make_shared<QuantExt::ProxyOptionletVolatility>(handleflatRateCvs, parseIborIndex(cc->proxySourceIndex()), |
| 417 | + parseIborIndex(cc->proxyTargetIndex()), cc->proxySourceRateComputationPeriod(), |
| 418 | + cc->proxyTargetRateComputationPeriod(), cc->proxyScalingFactor()); |
| 419 | + return Handle<OptionletVolatilityStructure>(capletVol); |
| 420 | + } |
| 421 | + } |
| 422 | + return handleflatRateCvs; |
412 | 423 | } |
413 | 424 |
|
414 | 425 | std::pair<string, QuantLib::Period> DependencyMarket::capFloorVolIndexBase(const string& name, |
415 | 426 | const string& config) const { |
416 | 427 | if (curveConfigs_ && curveConfigs_->hasCapFloorVolCurveConfig(name)) { |
417 | 428 | auto cc = curveConfigs_->capFloorVolCurveConfig(name); |
418 | | - if (!cc->proxyTargetIndex().empty()) |
| 429 | + if (!cc->proxyTargetIndex().empty()){ |
419 | 430 | return std::make_pair(cc->proxyTargetIndex(), cc->proxyTargetRateComputationPeriod()); |
420 | | - else |
| 431 | + } |
| 432 | + else{ |
421 | 433 | return std::make_pair(cc->index(), cc->rateComputationPeriod()); |
| 434 | + } |
422 | 435 | } |
423 | 436 | QuantLib::ext::shared_ptr<IborIndex> index; |
424 | 437 | if (tryParseIborIndex(name, index)) { |
|
0 commit comments