QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
energyvanillaswap.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 energyvanillaswap.hpp
21 \brief Vanilla energy swap
22*/
23
24#ifndef quantlib_energy_vanilla_swap_hpp
25#define quantlib_energy_vanilla_swap_hpp
26
30
31namespace QuantLib {
32
33 //! Vanilla energy swap
35 public:
36 EnergyVanillaSwap(bool payer,
37 const Calendar& calendar,
40 ext::shared_ptr<CommodityIndex> index,
41 const Currency& payCurrency,
45 const ext::shared_ptr<SecondaryCosts>& secondaryCosts,
46 Handle<YieldTermStructure> payLegTermStructure,
47 Handle<YieldTermStructure> receiveLegTermStructure,
48 Handle<YieldTermStructure> discountTermStructure);
49
50 bool isExpired() const override;
51 Integer payReceive() const { return payReceive_; }
52 const Money& fixedPrice() const { return fixedPrice_; }
55 }
56 const ext::shared_ptr<CommodityIndex>& index() const {
57 return index_;
58 }
59
60 protected:
61 void performCalculations() const override;
62
66 ext::shared_ptr<CommodityIndex> index_;
70 };
71
72}
73
74
75#endif
calendar class
Definition: calendar.hpp:61
const ext::shared_ptr< SecondaryCosts > & secondaryCosts() const
Currency specification
Definition: currency.hpp:36
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
void performCalculations() const override
bool isExpired() const override
returns whether the instrument might have value greater than zero.
const Money & fixedPrice() const
const UnitOfMeasure & fixedPriceUnitOfMeasure() const
Handle< YieldTermStructure > payLegTermStructure_
const ext::shared_ptr< CommodityIndex > & index() const
ext::shared_ptr< CommodityIndex > index_
Handle< YieldTermStructure > receiveLegTermStructure_
Handle< YieldTermStructure > discountTermStructure_
Shared handle to an observable.
Definition: handle.hpp:41
amount of cash
Definition: money.hpp:38
Unit of measure specification
Commodity index.
Energy swap.
QL_INTEGER Integer
integer number
Definition: types.hpp:35
Definition: any.hpp:35
std::vector< ext::shared_ptr< PricingPeriod > > PricingPeriods
Interest-rate term structure.