Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
discretizedconvertible.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2005, 2006 Theo Boafo
3 Copyright (C) 2006, 2007 StatPro Italia srl
4 Copyright (C) 2020 Quaternion Risk Managment Ltd
5
6 This file is part of ORE, a free-software/open-source library
7 for transparent pricing and risk analysis - http://opensourcerisk.org
8
9 ORE is free software: you can redistribute it and/or modify it
10 under the terms of the Modified BSD License. You should have received a
11 copy of the license along with this program.
12 The license is also available online at <http://opensourcerisk.org>
13
14 This program is distributed on the basis that it will form a useful
15 contribution to risk analytics and model standardisation, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file qle/pricingengines/discretizedconvertible.hpp
21 \brief discretized convertible
22*/
23
24#pragma once
25
27
28#include <ql/discretizedasset.hpp>
29#include <ql/processes/blackscholesprocess.hpp>
30
31namespace QuantExt {
32
34public:
36 const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
37 const Handle<Quote>& creditSpread, const TimeGrid& grid);
38
39 void reset(Size size) override;
40
41 const Array& conversionProbability() const { return conversionProbability_; }
43
44 const Array& spreadAdjustedRate() const { return spreadAdjustedRate_; }
46
47 const Array& dividendValues() const { return dividendValues_; }
48 Array& dividendValues() { return dividendValues_; }
49
50 std::vector<Time> mandatoryTimes() const override;
51
52protected:
53 void postAdjustValuesImpl() override;
55
56private:
57 Array adjustedGrid() const;
59 void applyCallability(Size, bool convertible);
60 void addCashflow(Size);
62 QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess> process_;
63 Handle<Quote> creditSpread_;
64 std::vector<Time> stoppingTimes_;
65 std::vector<Time> callabilityTimes_;
66 std::vector<Time> cashflowTimes_;
67 std::vector<Time> dividendTimes_;
68
69 // add PC
70 Real getConversionRatio(const Real t) const;
71 std::vector<Time> notionalTimes_;
72};
73
74} // namespace QuantExt
ConvertibleBond::option::arguments arguments_
Real getConversionRatio(const Real t) const
std::vector< Time > mandatoryTimes() const override
QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > process_
void applyCallability(Size, bool convertible)
convertible bond class