32 const ext::shared_ptr<GeneralizedBlackScholesProcess>& p1,
33 const ext::shared_ptr<GeneralizedBlackScholesProcess>& p2,
39 Real illegalLocalVolOverwrite)
43 xGrid_(xGrid), yGrid_(yGrid), tGrid_(tGrid),
44 dampingSteps_(dampingSteps),
45 schemeDesc_(schemeDesc),
47 illegalLocalVolOverwrite_(illegalLocalVolOverwrite) {
54 const ext::shared_ptr<BasketPayoff>
payoff =
59 const ext::shared_ptr<Fdm1dMesher> em1(
63 std::pair<Real, Real>(
p1_->x0(), 0.1)));
65 const ext::shared_ptr<Fdm1dMesher> em2(
69 std::pair<Real, Real>(
p2_->x0(), 0.1)));
71 const ext::shared_ptr<FdmMesher> mesher (
75 const ext::shared_ptr<FdmInnerValueCalculator> calculator(
79 const ext::shared_ptr<FdmStepConditionComposite> conditions =
83 p1_->riskFreeRate()->referenceDate(),
84 p1_->riskFreeRate()->dayCounter());
91 conditions, calculator,
94 ext::shared_ptr<Fdm2dBlackScholesSolver> solver(
105 results_.delta = solver->deltaXat(x,
y) + solver->deltaYat(x,
y);
106 results_.gamma = solver->gammaXat(x,
y) + solver->gammaYat(x,
y)
107 + 2*solver->gammaXYat(x,
y);
const ext::shared_ptr< GeneralizedBlackScholesProcess > p1_
void calculate() const override
const ext::shared_ptr< GeneralizedBlackScholesProcess > p2_
Fd2dBlackScholesVanillaEngine(const ext::shared_ptr< GeneralizedBlackScholesProcess > &p1, const ext::shared_ptr< GeneralizedBlackScholesProcess > &p2, Real correlation, Size xGrid=100, Size yGrid=100, Size tGrid=50, Size dampingSteps=0, const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Hundsdorfer(), bool localVol=false, Real illegalLocalVolOverwrite=-Null< Real >())
const FdmSchemeDesc schemeDesc_
const Real illegalLocalVolOverwrite_
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)
BasketOption::results results_
BasketOption::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 > &)
ext::shared_ptr< Exercise > exercise
ext::shared_ptr< Payoff > payoff
Option exercise classes and payoff function.
Finite-Differences 2 dim Black Scholes vanilla option engine.
1-d mesher for the Black-Scholes process (in ln(S))
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