QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
energybasisswap.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 J. Erik Radmall
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file energybasisswap.hpp
21 \brief Energy basis swap
22*/
23
24#ifndef quantlib_energy_basis_swap_hpp
25#define quantlib_energy_basis_swap_hpp
26
30
31namespace QuantLib {
32
33 //! Energy basis swap
34 class EnergyBasisSwap : public EnergySwap {
35 public:
37 ext::shared_ptr<CommodityIndex> spreadIndex,
38 ext::shared_ptr<CommodityIndex> payIndex,
39 ext::shared_ptr<CommodityIndex> receiveIndex,
40 bool spreadToPayLeg,
41 const Currency& payCurrency,
46 const ext::shared_ptr<SecondaryCosts>& secondaryCosts,
47 Handle<YieldTermStructure> payLegTermStructure,
48 Handle<YieldTermStructure> receiveLegTermStructure,
49 Handle<YieldTermStructure> discountTermStructure);
50
51 const ext::shared_ptr<CommodityIndex>& payIndex() const {
52 return payIndex_;
53 }
54 const ext::shared_ptr<CommodityIndex>& receiveIndex() const {
55 return receiveIndex_;
56 }
57 const CommodityUnitCost& basis() const { return basis_; }
58
59 protected:
60 void performCalculations() const override;
61
62 ext::shared_ptr<CommodityIndex> spreadIndex_;
63 ext::shared_ptr<CommodityIndex> payIndex_;
64 ext::shared_ptr<CommodityIndex> receiveIndex_;
70 };
71
72}
73
74#endif
calendar class
Definition: calendar.hpp:61
const ext::shared_ptr< SecondaryCosts > & secondaryCosts() const
Currency specification
Definition: currency.hpp:36
void performCalculations() const override
ext::shared_ptr< CommodityIndex > payIndex_
ext::shared_ptr< CommodityIndex > spreadIndex_
const ext::shared_ptr< CommodityIndex > & receiveIndex() const
Handle< YieldTermStructure > payLegTermStructure_
const ext::shared_ptr< CommodityIndex > & payIndex() const
ext::shared_ptr< CommodityIndex > receiveIndex_
Handle< YieldTermStructure > receiveLegTermStructure_
const CommodityUnitCost & basis() const
Handle< YieldTermStructure > discountTermStructure_
const Calendar & calendar() const
Definition: energyswap.hpp:44
const Currency & payCurrency() const
Definition: energyswap.hpp:45
const PricingPeriods & pricingPeriods() const
Definition: energyswap.hpp:47
const Currency & receiveCurrency() const
Definition: energyswap.hpp:46
const CommodityType & commodityType() const
Definition: energyswap.cpp:36
Shared handle to an observable.
Definition: handle.hpp:41
Commodity index.
Energy swap.
Definition: any.hpp:35
std::vector< ext::shared_ptr< PricingPeriod > > PricingPeriods
Interest-rate term structure.