QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
nonstandardswaption.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2013, 2018 Peter Caspers
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file nonstandardswaption.hpp
21 \brief nonstandard swap option class
22*/
23
24#ifndef quantlib_instruments_nonstandardswaption_hpp
25#define quantlib_instruments_nonstandardswaption_hpp
26
27#include <ql/option.hpp>
34
35namespace QuantLib {
36
37 //! nonstandard swaption class
38 /*! \ingroup instruments
39 */
40
41 class NonstandardSwaption : public Option {
42 public:
43 class arguments;
44 class engine;
45 NonstandardSwaption(const Swaption &fromSwaption);
46 NonstandardSwaption(ext::shared_ptr<NonstandardSwap> swap,
47 const ext::shared_ptr<Exercise>& exercise,
50
51 //! \name Instrument interface
52 //@{
53 bool isExpired() const override;
54 void setupArguments(PricingEngine::arguments*) const override;
55 //@}
56 //! \name Inspectors
57 //@{
60 return settlementMethod_;
61 }
62 Swap::Type type() const { return swap_->type(); }
63
64 const ext::shared_ptr<NonstandardSwap> &underlyingSwap() const {
65 return swap_;
66 }
67 //@}
68 std::vector<ext::shared_ptr<BlackCalibrationHelper>>
69 calibrationBasket(const ext::shared_ptr<SwapIndex>& standardSwapBase,
70 const ext::shared_ptr<SwaptionVolatilityStructure>& swaptionVolatility,
73
74 private:
75 // arguments
76 ext::shared_ptr<NonstandardSwap> swap_;
79 };
80
81 //! %Arguments for nonstandard swaption calculation
83 public Option::arguments {
84 public:
85 arguments() = default;
86 ext::shared_ptr<NonstandardSwap> swap;
89 void validate() const override;
90 };
91
92 //! base class for nonstandard swaption engines
94 : public GenericEngine<NonstandardSwaption::arguments,
95 NonstandardSwaption::results> {};
96}
97
98#endif
base class for pricing engines capable of generating a calibration basket
Calibration helper class.
template base class for option pricing engines
Arguments for nonstandard swap calculation
Arguments for nonstandard swaption calculation
ext::shared_ptr< NonstandardSwap > swap
base class for nonstandard swaption engines
nonstandard swaption class
ext::shared_ptr< NonstandardSwap > swap_
const ext::shared_ptr< NonstandardSwap > & underlyingSwap() const
void setupArguments(PricingEngine::arguments *) const override
Settlement::Type settlementType() const
bool isExpired() const override
returns whether the instrument might have value greater than zero.
std::vector< ext::shared_ptr< BlackCalibrationHelper > > calibrationBasket(const ext::shared_ptr< SwapIndex > &standardSwapBase, const ext::shared_ptr< SwaptionVolatilityStructure > &swaptionVolatility, BasketGeneratingEngine::CalibrationBasketType basketType=BasketGeneratingEngine::MaturityStrikeByDeltaGamma) const
Settlement::Method settlementMethod() const
basic option arguments
Definition: option.hpp:57
base option class
Definition: option.hpp:36
ext::shared_ptr< Exercise > exercise() const
Definition: option.hpp:46
Swaption class
Definition: swaption.hpp:88
Definition: any.hpp:35
void swap(Array &v, Array &w) noexcept
Definition: array.hpp:903
vanilla swap but possibly with period dependent nominal and strike
Base option class.
Swaption class.
Swaption volatility structure.
Interest-rate term structure.