QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
overnightindexedcouponpricer.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) 2009 Roland Lichters
5 Copyright (C) 2009 Ferdinando Ametrano
6 Copyright (C) 2014 Peter Caspers
7 Copyright (C) 2016 Stefano Fondi
8 Copyright (C) 2017 Joseph Jeisman
9 Copyright (C) 2017 Fabrice Lecuyer
10
11 This file is part of QuantLib, a free-software/open-source library
12 for financial quantitative analysts and developers - http://quantlib.org/
13
14 QuantLib is free software: you can redistribute it and/or modify it
15 under the terms of the QuantLib license. You should have received a
16 copy of the license along with this program; if not, please email
17 <quantlib-dev@lists.sf.net>. The license is also available online at
18 <http://quantlib.org/license.shtml>.
19
20 This program is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 FOR A PARTICULAR PURPOSE. See the license for more details.
23*/
24
25/*! \file overnightindexedcouponpricer.hpp
26 \brief contains the pricer for an OvernightIndexedCoupon
27*/
28
29#ifndef quantlib_overnight_indexed_coupon_pricer_hpp
30#define quantlib_overnight_indexed_coupon_pricer_hpp
31
35
36namespace QuantLib {
37
38 //! CompoudAveragedOvernightIndexedCouponPricer pricer
40 public:
41 //! \name FloatingRateCoupon interface
42 //@{
43 void initialize(const FloatingRateCoupon& coupon) override;
44 Rate swapletRate() const override;
45 Real swapletPrice() const override { QL_FAIL("swapletPrice not available"); }
46 Real capletPrice(Rate) const override { QL_FAIL("capletPrice not available"); }
47 Rate capletRate(Rate) const override { QL_FAIL("capletRate not available"); }
48 Real floorletPrice(Rate) const override { QL_FAIL("floorletPrice not available"); }
49 Rate floorletRate(Rate) const override { QL_FAIL("floorletRate not available"); }
50 //@}
51 Rate averageRate(const Date& date) const;
52
53 protected:
55 };
56
57 /*! pricer for arithmetically averaged overnight indexed coupons
58 Reference: Katsumi Takada 2011, Valuation of Arithmetically Average of
59 Fed Funds Rates and Construction of the US Dollar Swap Yield Curve
60 */
62 public:
64 Real meanReversion = 0.03,
65 Real volatility = 0.00, // NO convexity adjustment by default
66 bool byApprox = false) // TRUE to use Katsumi Takada approximation
67 : byApprox_(byApprox), mrs_(meanReversion), vol_(volatility) {}
68
70 bool byApprox) // Simplified constructor assuming no convexity correction
72
73 void initialize(const FloatingRateCoupon& coupon) override;
74 Rate swapletRate() const override;
75 Real swapletPrice() const override { QL_FAIL("swapletPrice not available"); }
76 Real capletPrice(Rate) const override { QL_FAIL("capletPrice not available"); }
77 Rate capletRate(Rate) const override { QL_FAIL("capletRate not available"); }
78 Real floorletPrice(Rate) const override { QL_FAIL("floorletPrice not available"); }
79 Rate floorletRate(Rate) const override { QL_FAIL("floorletRate not available"); }
80
81 protected:
82 Real convAdj1(Time ts, Time te) const;
83 Real convAdj2(Time ts, Time te) const;
88 };
89}
90
91#endif
ArithmeticAveragedOvernightIndexedCouponPricer(Real meanReversion=0.03, Real volatility=0.00, bool byApprox=false)
void initialize(const FloatingRateCoupon &coupon) override
CompoudAveragedOvernightIndexedCouponPricer pricer.
void initialize(const FloatingRateCoupon &coupon) override
Concrete date class.
Definition: date.hpp:125
base floating-rate coupon class
generic pricer for floating-rate coupons
Coupon pricers.
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Definition: errors.hpp:92
Coupon paying a variable index-based rate.
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:37
coupon paying the compounded daily overnight rate