#include <qle/termstructures/fxvannavolgasmilesection.hpp>
|
| VannaVolgaSmileSection (Real spot, Real rd, Real rf, Time t, Volatility atmVol, Volatility rr, Volatility bf, bool firstApprox=false, const DeltaVolQuote::AtmType &atmType=DeltaVolQuote::AtmType::AtmDeltaNeutral, const DeltaVolQuote::DeltaType &deltaType=DeltaVolQuote::DeltaType::Spot, const Real delta=0.25) |
|
Real | k_atm () const |
| getters for unit test More...
|
|
Real | k_c () const |
|
Real | k_p () const |
|
Volatility | vol_atm () const |
|
Volatility | vol_c () const |
|
Volatility | vol_p () const |
|
| FxSmileSection () |
|
| FxSmileSection (Real spot, Real rd, Real rf, Time t) |
|
virtual | ~FxSmileSection () |
|
virtual Volatility | volatility (Real strike) const =0 |
|
DiscountFactor | domesticDiscount () const |
|
DiscountFactor | foreignDiscount () const |
|
Vanna Volga Smile section
Consistent Pricing of FX Options Castagna & Mercurio (2006) http://papers.ssrn.com/sol3/papers.cfm?abstract_id=873788
Definition at line 41 of file fxvannavolgasmilesection.hpp.
◆ VannaVolgaSmileSection()
VannaVolgaSmileSection |
( |
Real |
spot, |
|
|
Real |
rd, |
|
|
Real |
rf, |
|
|
Time |
t, |
|
|
Volatility |
atmVol, |
|
|
Volatility |
rr, |
|
|
Volatility |
bf, |
|
|
bool |
firstApprox = false , |
|
|
const DeltaVolQuote::AtmType & |
atmType = DeltaVolQuote::AtmType::AtmDeltaNeutral , |
|
|
const DeltaVolQuote::DeltaType & |
deltaType = DeltaVolQuote::DeltaType::Spot , |
|
|
const Real |
delta = 0.25 |
|
) |
| |
Definition at line 26 of file fxvannavolgasmilesection.cpp.
30
31
32
33
36
37
38 try {
41 k_atm_ = a.atmStrike(atmType);
42 } catch (const std::exception& e) {
43 QL_FAIL("VannaVolgaSmileSection: Error during calculating atm strike: "
44 << e.what() <<
" (t=" << t <<
", atmVol=" << atmVol <<
", bf=" <<
bf_ <<
", rr=" << rr <<
", vol_c="
45 <<
vol_c_ <<
", vol_p=" <<
vol_p_ <<
", atmType=" << atmType <<
", deltaType=" << deltaType
47 }
48
49 try {
52 k_c_ = c.strikeFromDelta(delta);
53 } catch (const std::exception& e) {
54 QL_FAIL("VannaVolgaSmileSection: Error during calculating call strike at delta "
55 << delta <<
": " << e.what() <<
" (t=" << t <<
", atmVol=" << atmVol <<
", bf=" <<
bf_ <<
", rr=" << rr
56 <<
", vol_c=" <<
vol_c_ <<
", vol_p=" <<
vol_p_ <<
", deltaType=" << deltaType <<
", spot=" << spot
58 }
59
60 try {
63 k_p_ = p.strikeFromDelta(-delta);
64 } catch (const std::exception& e) {
65 QL_FAIL("VannaVolgaSmileSection: Error during calculating put strike at delta "
66 << delta <<
": " << e.what() <<
" (t=" << t <<
", atmVol=" << atmVol <<
", bf=" <<
bf_ <<
", rr=" << rr
67 <<
", vol_c=" <<
vol_c_ <<
", vol_p=" <<
vol_p_ <<
", deltaType=" << deltaType <<
", spot=" << spot
69 }
70}
DiscountFactor domesticDiscount() const
DiscountFactor foreignDiscount() const
RandomVariable sqrt(RandomVariable x)
◆ k_atm()
◆ k_c()
◆ k_p()
◆ vol_atm()
Volatility vol_atm |
( |
| ) |
const |
◆ vol_c()
Volatility vol_c |
( |
| ) |
const |
◆ vol_p()
Volatility vol_p |
( |
| ) |
const |
◆ volatility()
Volatility volatility |
( |
Real |
strike | ) |
const |
|
overridevirtual |
Implements FxSmileSection.
Definition at line 80 of file fxvannavolgasmilesection.cpp.
80 {
81 QL_REQUIRE(k >= 0, "Non-positive strike (" << k << ")");
82
83
87
88
89 Real r1 =
log(k2 / k) *
log(k3 / k) / (
log(k2 / k1) *
log(k3 / k1));
90 Real r2 =
log(k / k1) *
log(k3 / k) / (
log(k2 / k1) *
log(k3 / k2));
91 Real r3 =
log(k / k1) *
log(k / k2) / (
log(k3 / k1) *
log(k3 / k2));
92
95 return std::max(sigma1_k, Real(0.0001));
96 }
97
99
100
103
104 Real d1d2k =
d1(k) *
d2(k);
105
107 QL_REQUIRE(tmp >= 0, "VannaVolga attempting to take square root of negative number in second approximation. "
108 "Consider using first approximation in fxvol config.");
109
111}
CompiledFormula log(CompiledFormula x)
◆ d1()
◆ d2()
◆ k_atm_
◆ k_c_
◆ k_p_
◆ atmVol_
◆ rr_
◆ bf_
◆ vol_c_
◆ vol_p_
◆ firstApprox_