QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
averageoiscouponpricer.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) 2016 Stefano Fondi
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 averageoiscouponpricer.hpp
21 \brief pricer for arithmetically-averaged overnight-indexed coupons
22*/
23
24#ifndef quantlib_average_ois_coupon_pricer_hpp
25#define quantlib_average_ois_coupon_pricer_hpp
26
29
30namespace QuantLib {
31
32 /*! pricer for arithmetically averaged overnight indexed coupons
33 Reference: Katsumi Takada 2011, Valuation of Arithmetically Average of
34 Fed Funds Rates and Construction of the US Dollar Swap Yield Curve
35 */
38 public:
40 Real meanReversion = 0.03,
41 Real volatility = 0.00, // NO convexity adjustment by default
42 bool byApprox = false) // TRUE to use Katsumi Takada approximation
43 : byApprox_(byApprox), mrs_(meanReversion), vol_(volatility) {}
44
46 bool byApprox) // Simplified constructor assuming no convexity correction
48
49 void initialize(const FloatingRateCoupon& coupon) override;
50 Rate swapletRate() const override;
51 Real swapletPrice() const override { QL_FAIL("swapletPrice not available"); }
52 Real capletPrice(Rate) const override { QL_FAIL("capletPrice not available"); }
53 Rate capletRate(Rate) const override { QL_FAIL("capletRate not available"); }
54 Real floorletPrice(Rate) const override { QL_FAIL("floorletPrice not available"); }
55 Rate floorletRate(Rate) const override { QL_FAIL("floorletRate not available"); }
56
57 protected:
58 Real convAdj1(Time ts, Time te) const;
59 Real convAdj2(Time ts, Time te) const;
64
65 };
66
67}
68
69#endif
ArithmeticAveragedOvernightIndexedCouponPricer(Real meanReversion=0.03, Real volatility=0.00, bool byApprox=false)
void initialize(const FloatingRateCoupon &coupon) override
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
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:35
coupon paying the compounded daily overnight rate