QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
forwardswapquote.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) 2007 Ferdinando Ametrano
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 forwardswapquote.hpp
21 \brief quote for a forward starting swap
22*/
23
24#ifndef quantlib_forward_swap_quote_hpp
25#define quantlib_forward_swap_quote_hpp
26
30#include <ql/quote.hpp>
31
32namespace QuantLib {
33
34 //! Quote for a forward starting swap
35 class ForwardSwapQuote : public Quote,
36 public LazyObject {
37 public:
38 ForwardSwapQuote(ext::shared_ptr<SwapIndex> swapIndex,
39 Handle<Quote> spread,
40 const Period& fwdStart);
41 //! \name Quote interface
42 //@{
43 Real value() const override;
44 bool isValid() const override;
45 //@}
46 //! \name Observer interface
47 //@{
48 void update() override;
49 //@}
50 const Date& valueDate() const;
51 const Date& startDate() const;
52 const Date& fixingDate() const;
53 protected:
54 void initializeDates();
55 void performCalculations() const override;
56
57 ext::shared_ptr<SwapIndex> swapIndex_;
60
62 ext::shared_ptr<VanillaSwap> swap_;
63
64 mutable Rate result_;
65 };
66
67}
68
69#endif
Concrete date class.
Definition: date.hpp:125
Quote for a forward starting swap.
void performCalculations() const override
ext::shared_ptr< VanillaSwap > swap_
ext::shared_ptr< SwapIndex > swapIndex_
const Date & valueDate() const
const Date & startDate() const
const Date & fixingDate() const
Real value() const override
returns the current value
bool isValid() const override
returns true if the Quote holds a valid value
Shared handle to an observable.
Definition: handle.hpp:41
Framework for calculation on demand and result caching.
Definition: lazyobject.hpp:35
purely virtual base class for market observables
Definition: quote.hpp:37
QL_REAL Real
real number
Definition: types.hpp:50
Real Rate
interest rates
Definition: types.hpp:70
framework for calculation on demand and result caching
Definition: any.hpp:35
purely virtual base class for market observables
swap-rate indexes
Simple fixed-rate vs Libor swap.