Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
swaptionvolcurve.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19#include <algorithm>
21
22using namespace QuantLib;
23using namespace std;
24
25namespace ore {
26namespace data {
27
30 const map<string, QuantLib::ext::shared_ptr<SwapIndex>>& requiredSwapIndices,
31 const map<string, QuantLib::ext::shared_ptr<GenericYieldVolCurve>>& requiredVolCurves,
32 const bool buildCalibrationInfo)
34 asof, loader, curveConfigs, curveConfigs.swaptionVolCurveConfig(spec.curveConfigID()), requiredSwapIndices,
35 requiredVolCurves,
36 [](const QuantLib::ext::shared_ptr<MarketDatum>& md, Period& expiry, Period& term) -> bool {
37 QuantLib::ext::shared_ptr<SwaptionQuote> q = QuantLib::ext::dynamic_pointer_cast<SwaptionQuote>(md);
38 if (q == nullptr)
39 return false;
40 expiry = q->expiry();
41 term = q->term();
42 return q->dimension() == "ATM" && q->instrumentType() == MarketDatum::InstrumentType::SWAPTION;
43 },
44 [](const QuantLib::ext::shared_ptr<MarketDatum>& md, Period& expiry, Period& term, Real& strike) {
45 QuantLib::ext::shared_ptr<SwaptionQuote> q = QuantLib::ext::dynamic_pointer_cast<SwaptionQuote>(md);
46 if (q == nullptr)
47 return false;
48 expiry = q->expiry();
49 term = q->term();
50 strike = q->strike();
51 return q->dimension() == "Smile" && q->instrumentType() == MarketDatum::InstrumentType::SWAPTION;
52 },
53 [](const QuantLib::ext::shared_ptr<MarketDatum>& md, Period& term) {
54 QuantLib::ext::shared_ptr<SwaptionShiftQuote> q = QuantLib::ext::dynamic_pointer_cast<SwaptionShiftQuote>(md);
55 if (q == nullptr)
56 return false;
57 term = q->term();
58 return true;
59 },
60 buildCalibrationInfo),
61 spec_(spec) {}
62
63} // namespace data
64} // namespace ore
Container class for all Curve Configurations.
Wrapper class for building Generic yield volatility structures.
Market data loader base class.
Definition: loader.hpp:47
Base market data class.
Definition: marketdatum.hpp:78
Swaption data class.
const Period & expiry() const
SwaptionVolCurve()
Default constructor.
Swaption Volatility curve description.
Definition: curvespec.hpp:199
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Wrapper class for building Swaption volatility structures.
vector< string > curveConfigs