Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
blackscholescg.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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 ored/scripting/models/blackscholescg.hpp
20 \brief black scholes model for n underlyings (fx, equity or commodity)
21 \ingroup utilities
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace data {
30
32public:
33 /* ctor for multiple underlyings, see BlackScholesBase, plus:
34 - processes: hold spot, rate and div ts and vol for each given index
35 - we assume that the given correlations are constant and read the value only at t = 0
36 - calibration strikes are given as a map indexName => strike, if an index is missing in this map, the calibration
37 strike will be atmf */
39 const Size paths, const std::vector<std::string>& currencies,
40 const std::vector<Handle<YieldTermStructure>>& curves, const std::vector<Handle<Quote>>& fxSpots,
41 const std::vector<std::pair<std::string, QuantLib::ext::shared_ptr<InterestRateIndex>>>& irIndices,
42 const std::vector<std::pair<std::string, QuantLib::ext::shared_ptr<ZeroInflationIndex>>>& infIndices,
43 const std::vector<std::string>& indices, const std::vector<std::string>& indexCurrencies,
44 const Handle<BlackScholesModelWrapper>& model,
45 const std::map<std::pair<std::string, std::string>, Handle<QuantExt::CorrelationTermStructure>>& correlations,
46 const std::set<Date>& simulationDates,
47 const IborFallbackConfig& iborFallbackConfig = IborFallbackConfig::defaultConfig(),
48 const std::string& calibration = "ATM",
49 const std::map<std::string, std::vector<Real>>& calibrationStrikes = {});
50
51 // ctor for one underlying
52 BlackScholesCG(const Size paths, const std::string& currency, const Handle<YieldTermStructure>& curve,
53 const std::string& index, const std::string& indexCurrency,
54 const Handle<BlackScholesModelWrapper>& model, const std::set<Date>& simulationDates,
55 const IborFallbackConfig& iborFallbackConfig = IborFallbackConfig::defaultConfig(),
56 const std::string& calibration = "ATM", const std::vector<Real>& calibrationStrikes = {});
57
58private:
59 // ModelImpl interface implementation
60 std::size_t getFutureBarrierProb(const std::string& index, const Date& obsdate1, const Date& obsdate2,
61 const std::size_t barrier, const bool above) const override;
62
63 // BlackScholesBase interface implementation
64 void performCalculations() const override;
65
66 // The calibration to use, ATM or Deal
67 const std::string calibration_;
68
69 // map indexName => calibration strike (for missing indices we'll assume atmf)
70 const std::map<std::string, std::vector<Real>> calibrationStrikes_;
71};
72
73} // namespace data
74} // namespace ore
black scholes model base class for n underlyings (fx, equity or commodity)
void performCalculations() const override
std::size_t getFutureBarrierProb(const std::string &index, const Date &obsdate1, const Date &obsdate2, const std::size_t barrier, const bool above) const override
const std::map< std::string, std::vector< Real > > calibrationStrikes_
const std::string calibration_
static IborFallbackConfig defaultConfig()
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23