36 ext::shared_ptr<GeneralizedBlackScholesProcess> process,
42 Real illegalLocalVolOverwrite)
43 : process_(
std::move(process)),
44 tGrid_(tGrid), xGrid_(xGrid), dampingSteps_(dampingSteps),
45 schemeDesc_(schemeDesc), localVol_(localVol),
46 illegalLocalVolOverwrite_(illegalLocalVolOverwrite) {
52 ext::shared_ptr<GeneralizedBlackScholesProcess> process,
59 Real illegalLocalVolOverwrite)
60 : process_(
std::move(process)), dividends_(
std::move(dividends)),
61 tGrid_(tGrid), xGrid_(xGrid), dampingSteps_(dampingSteps),
62 schemeDesc_(schemeDesc), localVol_(localVol),
63 illegalLocalVolOverwrite_(illegalLocalVolOverwrite) {
71 const ext::shared_ptr<StrikedTypePayoff>
payoff =
72 ext::dynamic_pointer_cast<StrikedTypePayoff>(
arguments_.payoff);
86 const ext::shared_ptr<Fdm1dMesher> equityMesher(
89 xMin, xMax, 0.0001, 1.5,
93 const ext::shared_ptr<FdmMesher> mesher (
97 const ext::shared_ptr<StrikedTypePayoff> rebatePayoff(
99 const ext::shared_ptr<FdmInnerValueCalculator> calculator(
104 "only european style option are supported");
106 const ext::shared_ptr<FdmStepConditionComposite> conditions =
110 process_->riskFreeRate()->referenceDate(),
111 process_->riskFreeRate()->dayCounter());
117 boundaries.push_back(FdmBoundaryConditionSet::value_type(
124 boundaries.push_back(FdmBoundaryConditionSet::value_type(
130 FdmSolverDesc solverDesc = { mesher, boundaries, conditions, calculator,
133 const ext::shared_ptr<FdmBlackScholesSolver> solver(
141 results_.delta = solver->deltaAt(spot);
142 results_.gamma = solver->gammaAt(spot);
143 results_.theta = solver->thetaAt(spot);
Barrier::Type barrierType
Binary cash-or-nothing payoff.
Real illegalLocalVolOverwrite_
FdmSchemeDesc schemeDesc_
FdBlackScholesRebateEngine(ext::shared_ptr< GeneralizedBlackScholesProcess > process, Size tGrid=100, Size xGrid=100, Size dampingSteps=0, const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Douglas(), bool localVol=false, Real illegalLocalVolOverwrite=-Null< Real >())
void calculate() const override
DividendSchedule dividends_
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
static ext::shared_ptr< FdmStepConditionComposite > vanillaComposite(const DividendSchedule &schedule, const ext::shared_ptr< Exercise > &exercise, const ext::shared_ptr< FdmMesher > &mesher, const ext::shared_ptr< FdmInnerValueCalculator > &calculator, const Date &refDate, const DayCounter &dayCounter)
BarrierOption::results results_
BarrierOption::arguments arguments_
Shared handle to an observable.
template class providing a null value for a given type.
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
Option exercise classes and payoff function.
Finite-differences Black/Scholes barrier option rebate helper engine.
1-d mesher for the Black-Scholes process (in ln(S))
Dirichlet boundary conditions for differential operators.
layer of abstraction to calculate the inner value
memory layout of a fdm linear operator
FdmMesher which is a composite of Fdm1dMesher.
composite of fdm step conditions
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
ext::shared_ptr< QuantLib::Payoff > payoff
std::vector< ext::shared_ptr< Dividend > > DividendSchedule
OperatorTraits< FdmLinearOp >::bc_set FdmBoundaryConditionSet