QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
energyfuture.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 energyfuture.hpp
21 \brief Energy future
22*/
23
24#ifndef quantlib_energy_future_hpp
25#define quantlib_energy_future_hpp
26
29
30namespace QuantLib {
31
32 //! Energy future
33 /*! \ingroup instruments */
35 public:
36 EnergyFuture(Integer buySell,
39 ext::shared_ptr<CommodityIndex> index,
41 const ext::shared_ptr<SecondaryCosts>& secondaryCosts);
42 bool isExpired() const override;
43 //Integer buySell{} const { return buySell_; }
44 Quantity quantity() const override { return quantity_; }
45 const CommodityUnitCost& tradePrice() const { return tradePrice_; }
46 ext::shared_ptr<CommodityIndex> index() const { return index_; }
47
48 protected:
49 void performCalculations() const override;
53 ext::shared_ptr<CommodityIndex> index_;
54 };
55
56}
57
58#endif
const ext::shared_ptr< SecondaryCosts > & secondaryCosts() const
Energy commodity class.
const CommodityType & commodityType() const
void performCalculations() const override
bool isExpired() const override
returns whether the instrument might have value greater than zero.
const CommodityUnitCost & tradePrice() const
CommodityUnitCost tradePrice_
Quantity quantity() const override
ext::shared_ptr< CommodityIndex > index_
ext::shared_ptr< CommodityIndex > index() const
Amount of a commodity.
Definition: quantity.hpp:34
Commodity index.
Energy commodity.
QL_INTEGER Integer
integer number
Definition: types.hpp:35
Definition: any.hpp:35