29 ext::shared_ptr<GeneralizedBlackScholesProcess> process)
30 : process_(
std::move(process)) {
36 ext::shared_ptr<FloatingTypePayoff>
payoff =
37 ext::dynamic_pointer_cast<FloatingTypePayoff>(
arguments_.payoff);
42 switch (
payoff->optionType()) {
107 Real x = 2.0*carry/(vol*vol);
110 Real ls = std::log(
s);
115 if (!fullLookbackPeriod)
127 Real n1 =
f_(eta*(d1 - g1));
128 Real n2 =
f_(eta*(d2 - g1));
131 if (!fullLookbackPeriod) {
138 Real n4 = 0, n5 = 0, n6 = 0, n7 = 0;
139 if (!fullLookbackPeriod)
142 n4 = cnbn2(-eta*(d1+g1), eta*(e1 + g2));
143 n5 = cnbn2(-eta*(d1-g1), eta*(e1 - g2));
144 n6 = cnbn3(eta*-f2, eta*(d2 - g1));
145 n7 =
f_(eta*(e2 - g2));
149 n4 =
f_(-eta*(d1+g1));
153 Real pow_s = std::pow(
s, -x);
156 if (!fullLookbackPeriod)
Analytic engine for continuous floating-strike lookback.
CumulativeNormalDistribution f_
Time residualTime() const
Volatility volatility() const
DiscountFactor dividendDiscount() const
AnalyticContinuousPartialFloatingLookbackEngine(ext::shared_ptr< GeneralizedBlackScholesProcess > process)
void calculate() const override
Real stdDeviation() const
Time lookbackPeriodEndTime() const
Rate riskFreeRate() const
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
Rate dividendYield() const
DiscountFactor riskFreeDiscount() const
Cumulative bivariate normal distibution function (West 2004)
ContinuousPartialFloatingLookbackOption::results results_
ContinuousPartialFloatingLookbackOption::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