Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fdmblackscholesmesher.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file fdmblackscholesmesher.hpp
20 \brief extended version of the QuantLib class, see the documentation for details
21
22*/
23
24#pragma once
25
26#include <ql/instruments/dividendschedule.hpp>
27#include <ql/methods/finitedifferences/meshers/fdm1dmesher.hpp>
28
29#include <ql/handle.hpp>
30#include <ql/quote.hpp>
31
32#include <ql/tuple.hpp>
33
34namespace QuantLib {
35class FdmQuantoHelper;
36class YieldTermStructure;
37class GeneralizedBlackScholesProcess;
38} // namespace QuantLib
39
40namespace QuantExt {
41using namespace QuantLib;
42
43/* 1-d mesher for the Black-Scholes process (in ln(S)), extension of ql class
44 - allowing for several cPoints
45 - cPoints outside constructed grid are ignored */
46
48public:
49 FdmBlackScholesMesher(Size size, const ext::shared_ptr<GeneralizedBlackScholesProcess>& process, Time maturity,
50 Real strike, Real xMinConstraint = Null<Real>(), Real xMaxConstraint = Null<Real>(),
51 Real eps = 0.0001, Real scaleFactor = 1.5,
52 const std::vector<QuantLib::ext::tuple<Real, Real, bool>>& cPoints = {},
53 const DividendSchedule& dividendSchedule = DividendSchedule(),
54 const ext::shared_ptr<FdmQuantoHelper>& fdmQuantoHelper = ext::shared_ptr<FdmQuantoHelper>(),
55 Real spotAdjustment = 0.0);
56
57 static ext::shared_ptr<GeneralizedBlackScholesProcess> processHelper(const Handle<Quote>& s0,
58 const Handle<YieldTermStructure>& rTS,
59 const Handle<YieldTermStructure>& qTS,
60 Volatility vol);
61};
62
63} // namespace QuantExt
static ext::shared_ptr< GeneralizedBlackScholesProcess > processHelper(const Handle< Quote > &s0, const Handle< YieldTermStructure > &rTS, const Handle< YieldTermStructure > &qTS, Volatility vol)