33 const ext::shared_ptr<StrikedTypePayoff>&
payoff,
34 const ext::shared_ptr<Exercise>& exercise)
36 barrierType_(barrierType), barrier_lo_(barrier_lo),
37 barrier_hi_(barrier_hi), rebate_(rebate) {}
44 QL_REQUIRE(moreArgs !=
nullptr,
"wrong argument type");
54 const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
62 ext::shared_ptr<SimpleQuote> volQuote(
new SimpleQuote);
64 ext::shared_ptr<GeneralizedBlackScholesProcess> newProcess =
68 std::unique_ptr<PricingEngine>
engine;
71 engine = std::make_unique<AnalyticDoubleBarrierEngine>(newProcess);
75 QL_FAIL(
"engine not available for non-European barrier option");
78 QL_FAIL(
"unknown exercise type");
96 OneAssetOption::arguments::validate();
102 "Invalid barrier type");
110 return underlying <= arguments_.barrier_lo || underlying >= arguments_.barrier_hi;
Analytic double barrier european option engines.
Arguments for double barrier option calculation
void validate() const override
Double-Barrier-option engine base class
bool triggered(Real underlying) const
DoubleBarrierOption(DoubleBarrier::Type barrierType, Real barrier_lo, Real barrier_hi, Real rebate, const ext::shared_ptr< StrikedTypePayoff > &payoff, const ext::shared_ptr< Exercise > &exercise)
void setupArguments(PricingEngine::arguments *) const override
Volatility impliedVolatility(Real price, const ext::shared_ptr< GeneralizedBlackScholesProcess > &process, Real accuracy=1.0e-4, Size maxEvaluations=100, Volatility minVol=1.0e-7, Volatility maxVol=4.0) const
DoubleBarrier::Type barrierType_
virtual void setupArguments(PricingEngine::arguments *) const
template class providing a null value for a given type.
Base class for options on a single asset.
bool isExpired() const override
returns whether the instrument might have value greater than zero.
ext::shared_ptr< Exercise > exercise_
market element returning a stored value
static ext::shared_ptr< GeneralizedBlackScholesProcess > clone(const ext::shared_ptr< GeneralizedBlackScholesProcess > &, const ext::shared_ptr< SimpleQuote > &)
static Volatility calculate(const Instrument &instrument, const PricingEngine &engine, SimpleQuote &volQuote, Real targetValue, Real accuracy, Natural maxEvaluations, Volatility minVol, Volatility maxVol)
double Barrier european option on a single asset
#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.
Real Volatility
volatility
std::size_t Size
size of a container
Utilities for implied-volatility calculation.
ext::shared_ptr< QuantLib::Payoff > payoff
Placeholder for enumerated barrier types.
@ KOKI
lower barrier KI, upper KO