19#include <ql/exercise.hpp>
20#include <ql/pricingengines/blackformula.hpp>
21#include <ql/time/calendars/nullcalendar.hpp>
24#include <boost/make_shared.hpp>
29 const Handle<Quote> spot,
const Handle<Quote> volatility,
30 const Handle<YieldTermStructure>& domesticYield,
31 const Handle<YieldTermStructure>& foreignYield,
32 BlackCalibrationHelper::CalibrationErrorType errorType)
34 maturity_(maturity), calendar_(calendar), strike_(strike), spot_(spot), foreignYield_(foreignYield) {
40 const Handle<Quote> volatility,
const Handle<YieldTermStructure>& domesticYield,
41 const Handle<YieldTermStructure>& foreignYield,
42 BlackCalibrationHelper::CalibrationErrorType errorType)
44 exerciseDate_(exerciseDate), strike_(strike), spot_(spot), foreignYield_(foreignYield) {
58 QuantLib::ext::shared_ptr<StrikedTypePayoff> payoff(
new PlainVanillaPayoff(
type_,
effStrike_));
59 QuantLib::ext::shared_ptr<Exercise> exercise = QuantLib::ext::make_shared<EuropeanExercise>(
exerciseDate_);
60 option_ = QuantLib::ext::shared_ptr<VanillaOption>(
new VanillaOption(payoff, exercise));
61 BlackCalibrationHelper::performCalculations();
72 const Real stdDev = volatility * std::sqrt(
tau_);
QuantLib::ext::shared_ptr< PricingEngine > engine_
const Handle< Quote > spot_
void performCalculations() const override
Real blackPrice(Real volatility) const override
Real modelValue() const override
QuantLib::ext::shared_ptr< VanillaOption > option_
FxEqOptionHelper(const Period &maturity, const Calendar &calendar, const Real strike, const Handle< Quote > spot, const Handle< Quote > volatility, const Handle< YieldTermStructure > &domesticYield, const Handle< YieldTermStructure > &foreignYield, BlackCalibrationHelper::CalibrationErrorType errorType=BlackCalibrationHelper::RelativePriceError)
const Handle< YieldTermStructure > foreignYield_
Handle< YieldTermStructure > termStructure_
calibration helper for Black-Scholes options