QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
energyswap.hpp
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
24#ifndef quantlib_energy_swap_hpp
25#define quantlib_energy_swap_hpp
26
27#include <ql/experimental/commodities/energycommodity.hpp>
28#include <ql/experimental/commodities/pricingperiod.hpp>
29#include <ql/experimental/commodities/commoditycashflow.hpp>
30#include <ql/time/calendar.hpp>
31
32namespace QuantLib {
33
34 class EnergySwap : public EnergyCommodity {
35 public:
41 const ext::shared_ptr<SecondaryCosts>& secondaryCosts);
42
43 bool isExpired() const override;
44 const Calendar& calendar() const { return calendar_; }
45 const Currency& payCurrency() const { return payCurrency_; }
46 const Currency& receiveCurrency() const { return receiveCurrency_; }
49 return dailyPositions_;
50 }
52 return paymentCashFlows_;
53 }
54
55 const CommodityType& commodityType() const;
56 Quantity quantity() const override;
57
58 protected:
65 };
66
67}
68
69#endif
calendar class
Definition: calendar.hpp:61
const ext::shared_ptr< SecondaryCosts > & secondaryCosts() const
Currency specification
Definition: currency.hpp:36
Energy commodity class.
EnergyDailyPositions dailyPositions_
Definition: energyswap.hpp:63
PricingPeriods pricingPeriods_
Definition: energyswap.hpp:62
bool isExpired() const override
returns whether the instrument might have value greater than zero.
Definition: energyswap.cpp:51
const Calendar & calendar() const
Definition: energyswap.hpp:44
const CommodityCashFlows & paymentCashFlows() const
Definition: energyswap.hpp:51
Quantity quantity() const override
Definition: energyswap.cpp:41
const EnergyDailyPositions & dailyPositions() const
Definition: energyswap.hpp:48
const Currency & payCurrency() const
Definition: energyswap.hpp:45
const PricingPeriods & pricingPeriods() const
Definition: energyswap.hpp:47
Currency receiveCurrency_
Definition: energyswap.hpp:61
const Currency & receiveCurrency() const
Definition: energyswap.hpp:46
const CommodityType & commodityType() const
Definition: energyswap.cpp:36
CommodityCashFlows paymentCashFlows_
Definition: energyswap.hpp:64
Amount of a commodity.
Definition: quantity.hpp:34
Definition: any.hpp:35
std::map< Date, ext::shared_ptr< CommodityCashFlow > > CommodityCashFlows
std::vector< ext::shared_ptr< PricingPeriod > > PricingPeriods
std::map< Date, EnergyDailyPosition > EnergyDailyPositions