Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
ascot.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Managment 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 qle/instruments/ascot.hpp
20 \brief Ascot class
21*/
22
23#pragma once
24
26
27#include <ql/instruments/bond.hpp>
28#include <ql/instruments/callabilityschedule.hpp>
29#include <ql/instruments/dividendschedule.hpp>
30#include <ql/instruments/oneassetoption.hpp>
31#include <ql/quote.hpp>
32#include <ql/time/daycounter.hpp>
33#include <ql/time/schedule.hpp>
34
35namespace QuantLib {
36class IborIndex;
37class PricingEngine;
38} // namespace QuantLib
39
40namespace QuantExt {
41
42using namespace QuantLib;
43
44//! ascot
45class Ascot : public Instrument {
46public:
47 class arguments;
48 class engine;
49
50 Ascot(Option::Type callPut, const ext::shared_ptr<Exercise>& exercise, const Real& bondQuantity,
51 const ext::shared_ptr<ConvertibleBond2>& bond, const Leg& fundingLeg);
52
53 const Option::Type callPut() { return callPut_; }
54 ext::shared_ptr<Exercise> exercise() { return exercise_; }
55 const Real bondQuantity() { return bondQuantity_; }
56 const ext::shared_ptr<ConvertibleBond2>& underlyingBond() const { return bond_; }
57
58 const Leg& fundingLeg() const { return fundingLeg_; }
59
60 bool isExpired() const override { return bond_->isExpired(); }
61
62protected:
63 void setupArguments(PricingEngine::arguments*) const override;
64
65 Option::Type callPut_;
66 ext::shared_ptr<Exercise> exercise_;
68 ext::shared_ptr<ConvertibleBond2> bond_;
70};
71
73public:
75
76 Option::Type callPut;
77 ext::shared_ptr<Exercise> exercise;
79 ext::shared_ptr<ConvertibleBond2> bond;
81
83
84 void validate() const override;
85};
86
87class Ascot::engine : public GenericEngine<Ascot::arguments, Ascot::results> {};
88
89} // namespace QuantExt
ext::shared_ptr< ConvertibleBond2 > bond
Definition: ascot.hpp:79
ext::shared_ptr< Exercise > exercise
Definition: ascot.hpp:77
Option::Type callPut
Definition: ascot.hpp:76
void validate() const override
Definition: ascot.cpp:63
void setupArguments(PricingEngine::arguments *) const
const Leg & fundingLeg() const
Definition: ascot.hpp:58
ext::shared_ptr< ConvertibleBond2 > bond_
Definition: ascot.hpp:68
void setupArguments(PricingEngine::arguments *) const override
Definition: ascot.cpp:50
bool isExpired() const override
Definition: ascot.hpp:60
Option::Type callPut_
Definition: ascot.hpp:65
const Option::Type callPut()
Definition: ascot.hpp:53
Real bondQuantity_
Definition: ascot.hpp:67
Leg fundingLeg_
Definition: ascot.hpp:69
ext::shared_ptr< Exercise > exercise_
Definition: ascot.hpp:66
ext::shared_ptr< Exercise > exercise()
Definition: ascot.hpp:54
const ext::shared_ptr< ConvertibleBond2 > & underlyingBond() const
Definition: ascot.hpp:56
const Real bondQuantity()
Definition: ascot.hpp:55