28 Real runningProduct,
Size pastFixings)
29 :
payoff_(type, strike), discount_(discount),
30 runningProduct_(runningProduct), pastFixings_(pastFixings) {
31 QL_REQUIRE(strike>=0.0,
"negative strike given");
43 product *= path.
front();
48 for (
Size i=1; i<
n+1; i++) {
50 if (product < maxValue/price) {
53 averagePrice *= std::pow(product, 1.0/fixings);
57 averagePrice *= std::pow(product, 1.0/fixings);
PlainVanillaPayoff payoff_
GeometricAPOPathPricer(Option::Type type, Real strike, DiscountFactor discount, Real runningProduct=1.0, Size pastFixings=0)
Real operator()(const Path &path) const override
single-factor random walk
const TimeGrid & timeGrid() const
time grid
Real front() const
initial asset value
const std::vector< Time > & mandatoryTimes() const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
const ext::shared_ptr< Payoff > payoff_
Real DiscountFactor
discount factor between dates
std::size_t Size
size of a container
Monte Carlo engine for discrete geometric average price Asian.