Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
bondoption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 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/portfolio/bondoption.hpp
20\brief bond option data model and serialization
21\ingroup tradedata
22*/
23
24#pragma once
25
31
32namespace ore {
33namespace data {
34
35//! Serializable Bond Option
36/*!
37\ingroup tradedata
38*/
39class BondOption : public Trade {
40public:
41 //! Default constructor
42 BondOption() : Trade("BondOption"), redemption_(0.0), knocksOut_(false) {}
43
44 //! Constructor taking trade data
45 BondOption(Envelope env, const BondData& bondData, const OptionData& optionData, TradeStrike strike, bool knocksOut)
46 : Trade("BondOption", env), bondData_(bondData), optionData_(optionData), strike_(strike),
47 knocksOut_(knocksOut) {}
48
49 // Build QuantLib/QuantExt instrument, link pricing engine
50 virtual void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
51
52 virtual void fromXML(XMLNode* node) override;
53 virtual XMLNode* toXML(XMLDocument& doc) const override;
54
55 //! Add underlying Bond names
56 std::map<AssetClass, std::set<std::string>>
57 underlyingIndices(const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager = nullptr) const override;
58
59 const BondData& bondData() const { return bondData_; }
60 const OptionData& optionData() const { return optionData_; }
61 TradeStrike strike() const { return strike_; }
62 double redemption() const { return redemption_; }
63 string priceType() const { return priceType_; }
64
65private:
68
71 string priceType_;
72 string currency_;
74
75 QuantLib::ext::shared_ptr<ore::data::Bond> underlying_;
76};
77} // namespace data
78} // namespace ore
Bond trade data model and serialization.
double redemption() const
Definition: bondoption.hpp:62
OptionData optionData_
Definition: bondoption.hpp:67
TradeStrike strike() const
Definition: bondoption.hpp:61
BondOption()
Default constructor.
Definition: bondoption.hpp:42
string priceType() const
Definition: bondoption.hpp:63
BondData originalBondData_
Definition: bondoption.hpp:66
BondOption(Envelope env, const BondData &bondData, const OptionData &optionData, TradeStrike strike, bool knocksOut)
Constructor taking trade data.
Definition: bondoption.hpp:45
const BondData & bondData() const
Definition: bondoption.hpp:59
QuantLib::ext::shared_ptr< ore::data::Bond > underlying_
Definition: bondoption.hpp:75
const OptionData & optionData() const
Definition: bondoption.hpp:60
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable object holding option data.
Definition: optiondata.hpp:42
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
leg data model and serialization
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization
Reference data model and serialization.