Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
blackswaptionenginedeltagamma.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
20
21namespace QuantExt {
22
23BlackSwaptionEngineDeltaGamma::BlackSwaptionEngineDeltaGamma(const Handle<YieldTermStructure>& discountCurve,
24 Volatility vol, const DayCounter& dc, Real displacement,
25 const std::vector<Time>& bucketTimesDeltaGamma,
26 const std::vector<Time>& bucketTimesVegaOpt,
27 const std::vector<Time>& bucketTimesVegaUnd,
28 const bool computeDeltaVega, const bool computeGamma,
29 const bool linearInZero)
30 : detail::BlackStyleSwaptionEngineDeltaGamma<detail::Black76Spec>(
31 discountCurve, vol, dc, displacement, bucketTimesDeltaGamma, bucketTimesVegaOpt, bucketTimesVegaUnd,
32 computeDeltaVega, computeGamma, linearInZero) {}
33
35 const Handle<YieldTermStructure>& discountCurve, const Handle<Quote>& vol, const DayCounter& dc, Real displacement,
36 const std::vector<Time>& bucketTimesDeltaGamma, const std::vector<Time>& bucketTimesVegaOpt,
37 const std::vector<Time>& bucketTimesVegaUnd, const bool computeDeltaVega, const bool computeGamma,
38 const bool linearInZero)
39 : detail::BlackStyleSwaptionEngineDeltaGamma<detail::Black76Spec>(
40 discountCurve, vol, dc, displacement, bucketTimesDeltaGamma, bucketTimesVegaOpt, bucketTimesVegaUnd,
41 computeDeltaVega, computeGamma, linearInZero) {}
42
43BlackSwaptionEngineDeltaGamma::BlackSwaptionEngineDeltaGamma(const Handle<YieldTermStructure>& discountCurve,
44 const Handle<SwaptionVolatilityStructure>& vol,
45 const std::vector<Time>& bucketTimesDeltaGamma,
46 const std::vector<Time>& bucketTimesVegaOpt,
47 const std::vector<Time>& bucketTimesVegaUnd,
48 const bool computeDeltaVega, const bool computeGamma,
49 const bool linearInZero)
50 : detail::BlackStyleSwaptionEngineDeltaGamma<detail::Black76Spec>(discountCurve, vol, bucketTimesDeltaGamma,
51 bucketTimesVegaOpt, bucketTimesVegaUnd,
52 computeDeltaVega, computeGamma, linearInZero) {
53 QL_REQUIRE(vol->volatilityType() == ShiftedLognormal,
54 "BlackSwaptionEngineDeltaGamma requires (shifted) lognormal input "
55 "volatility");
56}
57
58BachelierSwaptionEngineDeltaGamma::BachelierSwaptionEngineDeltaGamma(const Handle<YieldTermStructure>& discountCurve,
59 Volatility vol, const DayCounter& dc,
60 const std::vector<Time>& bucketTimesDeltaGamma,
61 const std::vector<Time>& bucketTimesVegaOpt,
62 const std::vector<Time>& bucketTimesVegaUnd,
63 const bool computeDeltaVega,
64 const bool computeGamma, const bool linearInZero)
65 : detail::BlackStyleSwaptionEngineDeltaGamma<detail::BachelierSpec>(
66 discountCurve, vol, dc, 0.0, bucketTimesDeltaGamma, bucketTimesVegaOpt, bucketTimesVegaUnd, computeDeltaVega,
67 computeGamma, linearInZero) {}
68
69BachelierSwaptionEngineDeltaGamma::BachelierSwaptionEngineDeltaGamma(const Handle<YieldTermStructure>& discountCurve,
70 const Handle<Quote>& vol, const DayCounter& dc,
71 const std::vector<Time>& bucketTimesDeltaGamma,
72 const std::vector<Time>& bucketTimesVegaOpt,
73 const std::vector<Time>& bucketTimesVegaUnd,
74 const bool computeDeltaVega,
75 const bool computeGamma, const bool linearInZero)
76 : detail::BlackStyleSwaptionEngineDeltaGamma<detail::BachelierSpec>(
77 discountCurve, vol, dc, 0.0, bucketTimesDeltaGamma, bucketTimesVegaOpt, bucketTimesVegaUnd, computeDeltaVega,
78 computeGamma, linearInZero) {}
79
80BachelierSwaptionEngineDeltaGamma::BachelierSwaptionEngineDeltaGamma(const Handle<YieldTermStructure>& discountCurve,
81 const Handle<SwaptionVolatilityStructure>& vol,
82 const std::vector<Time>& bucketTimesDeltaGamma,
83 const std::vector<Time>& bucketTimesVegaOpt,
84 const std::vector<Time>& bucketTimesVegaUnd,
85 const bool computeDeltaVega,
86 const bool computeGamma, const bool linearInZero)
87 : detail::BlackStyleSwaptionEngineDeltaGamma<detail::BachelierSpec>(discountCurve, vol, bucketTimesDeltaGamma,
88 bucketTimesVegaOpt, bucketTimesVegaUnd,
89 computeDeltaVega, computeGamma, linearInZero) {
90 QL_REQUIRE(vol->volatilityType() == Normal, "BachelierSwaptionEngineDeltaGamma requires normal input volatility");
91}
92
93} // namespace QuantExt
Swaption engine providing analytical deltas for vanilla swaps.
BachelierSwaptionEngineDeltaGamma(const Handle< YieldTermStructure > &discountCurve, Volatility vol, const DayCounter &dc=Actual365Fixed(), const std::vector< Time > &bucketTimesDeltaGamma=std::vector< Time >(), const std::vector< Time > &bucketTimesVegaOpt=std::vector< Time >(), const std::vector< Time > &bucketTimesVegaUnd=std::vector< Time >(), const bool computeDeltaVega=false, const bool computeGamma=false, const bool linearInZero=true)
BlackSwaptionEngineDeltaGamma(const Handle< YieldTermStructure > &discountCurve, Volatility vol, const DayCounter &dc=Actual365Fixed(), Real displacement=0.0, const std::vector< Time > &bucketTimesDeltaGamma=std::vector< Time >(), const std::vector< Time > &bucketTimesVegaOpt=std::vector< Time >(), const std::vector< Time > &bucketTimesVegaUnd=std::vector< Time >(), const bool computeDeltaVega=false, const bool computeGamma=false, const bool linearInZero=true)