Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
oiccbasisswap.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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 oiccbasisswap.hpp
20 \brief Cross currency overnight index swap paying compounded overnight vs. float
21
22 \ingroup instruments
23*/
24
25#ifndef quantlib_cc_ois_basis_swap_hpp
26#define quantlib_cc_ois_basis_swap_hpp
27
28#include <ql/currency.hpp>
29#include <ql/indexes/iborindex.hpp>
30#include <ql/instruments/swap.hpp>
31#include <ql/time/daycounter.hpp>
32#include <ql/time/schedule.hpp>
33
34namespace QuantExt {
35using namespace QuantLib;
36
37// class Schedule;
38// class OvernightIndex;
39// class IborIndex;
40
41//! Basis swap: compounded overnight rate in ccy 1 vs. compounded overnight rate in ccy 2
42/*! \ingroup instruments
43 */
45public:
46 class arguments;
47 class results;
48 class engine;
50 const QuantLib::ext::shared_ptr<OvernightIndex>& payIndex, Real paySpread,
51 Real recNominal, Currency recCurrency, const Schedule& recSchedule,
52 const QuantLib::ext::shared_ptr<OvernightIndex>& recIndex, Real recSpread);
53 //! \name Inspectors
54 //@{
55 Real payNominal() const;
56 Currency payCurrency() const;
57 const Schedule& paySchedule() { return paySchedule_; }
58 const QuantLib::ext::shared_ptr<OvernightIndex>& payIndex() { return payIndex_; }
59 Real paySpread() const;
60
61 Real recNominal() const;
62 Currency recCurrency() const;
63 const Schedule& recSchedule() { return recSchedule_; }
64 const QuantLib::ext::shared_ptr<OvernightIndex>& recIndex() { return recIndex_; }
65 Real recSpread() const;
66
67 const Leg& payLeg() const { return legs_[0]; }
68 const Leg& recLeg() const { return legs_[1]; }
69 //@}
70
71 //! \name Results
72 //@{
73 Real payLegBPS() const;
74 Real payLegNPV() const;
75 Real fairPayLegSpread() const;
76
77 Real recLegBPS() const;
78 Real recLegNPV() const;
79 Spread fairRecLegSpread() const;
80 //@}
81 // other
82 void setupArguments(PricingEngine::arguments* args) const override;
83 void fetchResults(const PricingEngine::results*) const override;
84
85private:
86 void initialize();
90 QuantLib::ext::shared_ptr<OvernightIndex> payIndex_, recIndex_;
92 std::vector<Currency> currency_;
93
94 mutable Real fairPayLegSpread_;
95 mutable Real fairRecLegSpread_;
96};
97
98// inline
99
101
103
105
107
109
111
112//! \ingroup instruments
114public:
115 std::vector<Currency> currency;
118};
119
120//! \ingroup instruments
122public:
125 void reset() override;
126};
127
128//! \ingroup instruments
130 : public GenericEngine<OvernightIndexedCrossCcyBasisSwap::arguments, OvernightIndexedCrossCcyBasisSwap::results> {};
131} // namespace QuantExt
132
133#endif
Basis swap: compounded overnight rate in ccy 1 vs. compounded overnight rate in ccy 2.
QuantLib::ext::shared_ptr< OvernightIndex > recIndex_
const QuantLib::ext::shared_ptr< OvernightIndex > & payIndex()
void setupArguments(PricingEngine::arguments *args) const override
QuantLib::ext::shared_ptr< OvernightIndex > payIndex_
void fetchResults(const PricingEngine::results *) const override
const QuantLib::ext::shared_ptr< OvernightIndex > & recIndex()