25#include <ql/experimental/fx/deltavolquote.hpp>
26#include <ql/math/interpolation.hpp>
27#include <ql/option.hpp>
28#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
29#include <ql/termstructures/yieldtermstructure.hpp>
30#include <ql/time/calendar.hpp>
31#include <ql/time/daycounter.hpp>
38class SimpleDeltaInterpolatedSmile;
45 Date referenceDate,
const std::vector<Date>&
dates,
const std::vector<Real>&
deltas,
46 const std::vector<std::vector<Real>>&
bfQuotes,
const std::vector<std::vector<Real>>&
rrQuotes,
47 const std::vector<Real>&
atmQuotes,
const DayCounter& dayCounter,
const Calendar& calendar,
48 const Handle<Quote>&
spot,
const Size spotDays,
const Calendar spotCalendar,
50 const DeltaVolQuote::DeltaType dt = DeltaVolQuote::DeltaType::Spot,
51 const DeltaVolQuote::AtmType at = DeltaVolQuote::AtmType::AtmDeltaNeutral,
52 const Period&
switchTenor = 2 * Years,
const DeltaVolQuote::DeltaType ltdt = DeltaVolQuote::DeltaType::Fwd,
53 const DeltaVolQuote::AtmType ltat = DeltaVolQuote::AtmType::AtmDeltaNeutral,
57 Date
maxDate()
const override {
return Date::maxDate(); }
59 Real
maxStrike()
const override {
return QL_MAX_REAL; }
61 const std::vector<QuantLib::Date>&
dates()
const {
return dates_; }
83 Volatility
blackVolImpl(Time t, Real strike)
const override;
98 DeltaVolQuote::DeltaType
dt_;
99 DeltaVolQuote::AtmType
at_;
112 mutable std::vector<QuantLib::ext::shared_ptr<detail::SimpleDeltaInterpolatedSmile>>
smiles_;
123 const std::vector<Real>& deltas,
const std::vector<Real>& putVols,
124 const std::vector<Real>& callVols,
const Real atmVol,
125 const DeltaVolQuote::DeltaType dt,
const DeltaVolQuote::AtmType at,
127 const Real accuracy = 1E-6,
const Size maxIterations = 1000);
131 Real
strikeFromDelta(
const Option::Type type,
const Real delta,
const DeltaVolQuote::DeltaType dt);
132 Real
atmStrike(
const DeltaVolQuote::DeltaType dt,
const DeltaVolQuote::AtmType at);
140 DeltaVolQuote::DeltaType
dt_;
141 DeltaVolQuote::AtmType
at_;
151QuantLib::ext::shared_ptr<SimpleDeltaInterpolatedSmile>
152createSmile(
const Real spot,
const Real domDisc,
const Real forDisc,
const Real expiryTime,
153 const std::vector<Real>& deltas,
const std::vector<Real>& bfQuotes,
const std::vector<Real>& rrQuotes,
154 const Real atmVol,
const DeltaVolQuote::DeltaType dt,
const DeltaVolQuote::AtmType at,
155 const Option::Type riskReversalInFavorOf,
const bool butterflyIsBrokerStyle,
std::vector< Date > settlementDates_
std::vector< std::string > smileErrorMessage_
DeltaVolQuote::DeltaType dt_
DeltaVolQuote::DeltaType longTermDeltaType() const
void performCalculations() const override
std::map< Real, QuantLib::ext::shared_ptr< detail::SimpleDeltaInterpolatedSmile > > cachedInterpolatedSmiles_
const std::vector< Real > & atmQuotes() const
bool butterflyIsBrokerStyle_
std::vector< std::vector< Real > > bfQuotes_
std::vector< Date > dates_
const std::vector< Real > & currentDeltas() const
const std::vector< std::vector< Real > > & rrQuotes() const
DeltaVolQuote::AtmType longTermAtmType() const
DeltaVolQuote::DeltaType ltdt_
SmileInterpolation smileInterpolation() const
Handle< YieldTermStructure > foreignTS_
const std::vector< std::string > & smileErrorMessage() const
Real minStrike() const override
const Handle< Quote > & spot() const
std::vector< Real > deltas_
bool butterflyIsBrokerStyle() const
Handle< YieldTermStructure > domesticTS_
const std::vector< Real > & deltas() const
std::vector< Real > expiryTimes_
std::vector< Real > atmQuotes_
const Handle< YieldTermStructure > & domesticTS() const
Option::Type riskReversalInFavorOf_
Date maxDate() const override
Option::Type riskReversalInFavorOf() const
const Handle< YieldTermStructure > & foreignTS() const
const Period & switchTenor() const
std::vector< std::vector< Real > > rrQuotes_
DeltaVolQuote::DeltaType deltaType() const
DeltaVolQuote::AtmType atmType() const
Volatility blackVolImpl(Time t, Real strike) const override
const std::vector< QuantLib::Date > & dates() const
SmileInterpolation smileInterpolation_
const std::vector< bool > & smileHasError() const
DeltaVolQuote::AtmType at_
Real maxStrike() const override
const std::vector< std::vector< Real > > & bfQuotes() const
std::vector< bool > smileHasError_
DeltaVolQuote::AtmType ltat_
std::vector< QuantLib::ext::shared_ptr< detail::SimpleDeltaInterpolatedSmile > > smiles_
std::vector< Real > currentDeltas_
DeltaVolQuote::DeltaType dt_
Real atmStrike(const DeltaVolQuote::DeltaType dt, const DeltaVolQuote::AtmType at)
Real strikeFromDelta(const Option::Type type, const Real delta, const DeltaVolQuote::DeltaType dt)
Real simpleDeltaFromStrike(const Real strike) const
Real volatility(const Real strike)
Real volatilityAtSimpleDelta(const Real tnp)
std::vector< Real > deltas_
std::vector< Real > callVols_
DeltaVolQuote::AtmType at_
BlackVolatilitySurfaceBFRR::SmileInterpolation smileInterpolation_
QuantLib::ext::shared_ptr< Interpolation > interpolation_
std::vector< Real > putVols_
QuantLib::ext::shared_ptr< SimpleDeltaInterpolatedSmile > createSmile(const Real spot, const Real domDisc, const Real forDisc, const Real expiryTime, const std::vector< Real > &deltas, const std::vector< Real > &bfQuotes, const std::vector< Real > &rrQuotes, const Real atmVol, const DeltaVolQuote::DeltaType dt, const DeltaVolQuote::AtmType at, const Option::Type riskReversalInFavorOf, const bool butterflyIsBrokerStyle, const BlackVolatilitySurfaceBFRR::SmileInterpolation smileInterpolation)