28 const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
Real logStrikeSpacing)
35 ext::shared_ptr<GeneralizedBlackScholesProcess> process =
36 ext::dynamic_pointer_cast<GeneralizedBlackScholesProcess>(
process_);
42 ext::shared_ptr<GeneralizedBlackScholesProcess> process =
43 ext::dynamic_pointer_cast<GeneralizedBlackScholesProcess>(
process_);
46 process->dividendYield()->discount(
d);
48 process->riskFreeRate()->discount(
d);
50 DayCounter rfdc = process->riskFreeRate()->dayCounter();
53 ext::shared_ptr<BlackConstantVol> constVol = ext::dynamic_pointer_cast<BlackConstantVol>
54 (*(process->blackVolatility()));
55 QL_REQUIRE(constVol,
"Constant volatility required");
56 Real vol = constVol->blackVol(0.0, 0.0);
62 std::complex<Real> i1(0, 1);
66 std::complex<Real> phi = std::exp(i1 * u * (std::log(
s) - (
var_ *
t_) / 2.0)
67 - (
var_ * u * u *
t_) / 2.0);
74 ext::shared_ptr<GeneralizedBlackScholesProcess> process =
75 ext::dynamic_pointer_cast<GeneralizedBlackScholesProcess>(
process_);
76 return process->riskFreeRate()->discount(
d);
81 ext::shared_ptr<GeneralizedBlackScholesProcess> process =
82 ext::dynamic_pointer_cast<GeneralizedBlackScholesProcess>(
process_);
83 return process->dividendYield()->discount(
d);
Black constant volatility, no time dependence, no strike dependence.
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
Base class for FFT pricing engines for European vanilla options.
ext::shared_ptr< StochasticProcess1D > process_
FFT Pricing engine vanilla options under a Black Scholes process.
void precalculateExpiry(Date d) override
std::complex< Real > complexFourierTransform(std::complex< Real > u) const override
DiscountFactor riskFreeDiscount_
std::unique_ptr< FFTEngine > clone() const override
FFTVanillaEngine(const ext::shared_ptr< GeneralizedBlackScholesProcess > &process, Real logStrikeSpacing=0.001)
DiscountFactor dividendDiscount_
Real dividendYield(Date d) const override
Real discountFactor(Date d) const override
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Option exercise classes and payoff function.
FFT engine for vanilla options under a Black Scholes process.