Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
offpeakpowerindex.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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 qle/indexes/offpeakpowerindex.hpp
20 \brief commodity future index for off peak power prices.
21 \ingroup indexes
22*/
23
24#ifndef quantext_off_peak_power_index_hpp
25#define quantext_off_peak_power_index_hpp
26
28
29namespace QuantExt {
30
31//! Off peak power index
32/*! A commodity index to represent daily off-peak power prices.
33
34 In general, when used in derivatives the off-peak power value for a given date will be:
35 1. the average of Locational Marginal Prices (LMPs) over the off-peak hours, generally 8, on peak calendar
36 business days
37 2. the average of LMPs over all hours on peak calendar holidays
38
39 There are generally two types of daily futures in the power markets:
40 1. those that average the LMPs over the peak hours, generally 16, on every calendar day
41 2. those that average the LMPs over the off-peak hours, generally 8, on every calendar day
42
43 This off peak power index uses the prices of both of these daily future contracts to construct the index that is
44 used in derivatives that reference off-peak power prices. The off-peak future is used directly on peak calendar
45 business days. On peak calendar holidays, the weighted average of the daily off-peak future price and daily peak
46 future price is used where the weights are the number of off-peak hours and peak hours respectively divided by 24.
47
48 \ingroup indexes
49*/
51public:
52 //! Constructor
53 OffPeakPowerIndex(const std::string& underlyingName,
54 const QuantLib::Date& expiryDate,
55 const QuantLib::ext::shared_ptr<CommodityFuturesIndex>& offPeakIndex,
56 const QuantLib::ext::shared_ptr<CommodityFuturesIndex>& peakIndex,
57 QuantLib::Real offPeakHours,
58 const QuantLib::Calendar& peakCalendar,
59 const Handle<QuantExt::PriceTermStructure>& priceCurve = Handle<QuantExt::PriceTermStructure>());
60
61 //! \name Inspectors
62 //@{
63 const QuantLib::ext::shared_ptr<CommodityFuturesIndex>& offPeakIndex() const;
64 const QuantLib::ext::shared_ptr<CommodityFuturesIndex>& peakIndex() const;
65 QuantLib::Real offPeakHours() const;
66 const QuantLib::Calendar& peakCalendar() const;
67 //@}
68
69 //! Implement the base clone.
70 QuantLib::ext::shared_ptr<CommodityIndex> clone(const QuantLib::Date& expiryDate,
71 const boost::optional<QuantLib::Handle<PriceTermStructure>>& ts = boost::none) const override;
72
73protected:
74 //! \name CommodityIndex interface
75 //@{
76 Real pastFixing(const Date& fixingDate) const override;
77 //@}
78
79private:
80 QuantLib::ext::shared_ptr<CommodityFuturesIndex> offPeakIndex_;
81 QuantLib::ext::shared_ptr<CommodityFuturesIndex> peakIndex_;
82 QuantLib::Real offPeakHours_;
83 QuantLib::Calendar peakCalendar_;
84
85};
86
87}
88
89#endif
const QuantLib::Date & expiryDate() const
const Handle< QuantExt::PriceTermStructure > & priceCurve() const
std::string underlyingName() const
const QuantLib::ext::shared_ptr< CommodityFuturesIndex > & offPeakIndex() const
QuantLib::Calendar peakCalendar_
const QuantLib::ext::shared_ptr< CommodityFuturesIndex > & peakIndex() const
QuantLib::ext::shared_ptr< CommodityFuturesIndex > peakIndex_
QuantLib::ext::shared_ptr< CommodityFuturesIndex > offPeakIndex_
QuantLib::ext::shared_ptr< CommodityIndex > clone(const QuantLib::Date &expiryDate, const boost::optional< QuantLib::Handle< PriceTermStructure > > &ts=boost::none) const override
Implement the base clone.
const QuantLib::Calendar & peakCalendar() const
Real pastFixing(const Date &fixingDate) const override
returns a past fixing at the given date
QuantLib::Real offPeakHours() const
commodity index class for holding commodity spot and futures price histories and forwarding.