28 ext::shared_ptr<GeneralizedBlackScholesProcess> process)
29 : process_(
std::move(process)) {
35 ext::shared_ptr<PlainVanillaPayoff>
payoff =
36 ext::dynamic_pointer_cast<PlainVanillaPayoff>(
arguments_.payoff);
41 switch (
payoff->optionType()) {
44 "Strike must be positive or null");
49 "Strike must be positive");
63 ext::shared_ptr<PlainVanillaPayoff>
payoff =
64 ext::dynamic_pointer_cast<PlainVanillaPayoff>(
arguments_.payoff);
110 Real x = 2.0*carry/(vol*vol);
112 Real ls = std::log(
s);
117 if (differentStartOfLookback)
130 if (differentStartOfLookback) {
137 Real n4 = cnbn2(eta*e1, eta*d1);
138 Real n5 = cnbn3(-eta*e1, eta*d1);
139 Real n6 = cnbn1(eta*f2, -eta*d2);
143 Real pow_s = std::pow(
s, -x);
152 * (1 - 0.5 * vol * vol / carry) *
Analytic engine for continuous fixed-strike lookback.
CumulativeNormalDistribution f_
Time residualTime() const
Volatility volatility() const
AnalyticContinuousPartialFixedLookbackEngine(ext::shared_ptr< GeneralizedBlackScholesProcess > process)
DiscountFactor dividendDiscount() const
Time lookbackPeriodStartTime() const
void calculate() const override
Real stdDeviation() const
Rate riskFreeRate() const
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
Rate dividendYield() const
DiscountFactor riskFreeDiscount() const
Cumulative bivariate normal distibution function (West 2004)
ContinuousPartialFixedLookbackOption::results results_
ContinuousPartialFixedLookbackOption::arguments arguments_
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Option exercise classes and payoff function.
@ NoFrequency
null frequency
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
Real Volatility
volatility
ext::shared_ptr< QuantLib::Payoff > payoff