1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="robots" content="none">
<title>QuantLib: CapFloor Class Reference</title>
<link rel="stylesheet" href="quantlib.css" type="text/css">
<link rel="stylesheet" href="print.css" type="text/css" media="print">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="container">
<div id="header">
<img class="titleimage"
src="QL-title.jpg" width="212" height="47" border="0"
alt="QuantLib">
<br>
<h3 class="subtitle">A free/open-source library for quantitative finance</h3>
</div>
<div id="menu">
<h3 class="navbartitle">Version 0.9.0</h3>
<hr>
<h3 class="navbartitle">Getting started</h3>
<ul class="navbarlist">
<li class="navlink"><a href="index.html">Introduction</a></li>
<li class="navlink"><a href="overview.html">Project overview</a></li>
<li class="navlink"><a href="where.html">Where to get QuantLib</a></li>
<li class="navlink"><a href="install.html">Installation</a></li>
<li class="navlink"><a href="config.html">Configuration</a></li>
<li class="navlink"><a href="usage.html">Usage</a></li>
<li class="navlink"><a href="history.html">Version history</a></li>
<li class="navlink"><a href="resources.html">Additional resources</a></li>
<li class="navlink"><a href="group.html">The QuantLib group</a></li>
<li class="navlink"><a href="license.html">Copyright and license</a></li>
</ul>
<hr>
<h3 class="navbartitle">Reference manual</h3>
<ul class="navbarlist">
<li class="navlink"><a href="modules.html">Modules</a></li>
<li class="navlink"><a href="hierarchy.html">Class Hierarchy</a></li>
<li class="navlink"><a href="annotated.html">Compound List</a></li>
<li class="navlink"><a href="files.html">File List</a></li>
<li class="navlink"><a href="functions.html">Compound Members</a></li>
<li class="navlink"><a href="globals.html">File Members</a></li>
<li class="navlink"><a href="bug.html">Known Bugs</a></li>
<li class="navlink"><a href="caveats.html">Caveats</a></li>
<li class="navlink"><a href="test.html">Test Suite</a></li>
<li class="navlink"><a href="examples.html">Examples</a></li>
</ul>
</div>
<div id="content">
<!--Doxygen-generated content-->
<!-- Generated by Doxygen 1.5.4 -->
<div class="nav">
<a class="el" href="namespace_quant_lib.html">QuantLib</a>::<a class="el" href="class_quant_lib_1_1_cap_floor.html">CapFloor</a></div>
<h1>CapFloor Class Reference<br>
<small>
[<a class="el" href="group__instruments.html">Financial instruments</a>]</small>
</h1><!-- doxytag: class="QuantLib::CapFloor" --><!-- doxytag: inherits="QuantLib::Instrument" --><code>#include <ql/instruments/capfloor.hpp></code>
<p>
<div class="dynheader">
Inheritance diagram for CapFloor:</div>
<div class="dynsection">
<p><center><img src="class_quant_lib_1_1_cap_floor__inherit__graph.png" border="0" usemap="#_cap_floor__inherit__map" alt="Inheritance graph"></center>
<map name="_cap_floor__inherit__map">
<area shape="rect" href="class_quant_lib_1_1_cap.html" title="Concrete cap class." alt="" coords="5,161,53,188"><area shape="rect" href="class_quant_lib_1_1_collar.html" title="Concrete collar class." alt="" coords="77,161,136,188"><area shape="rect" href="class_quant_lib_1_1_floor.html" title="Concrete floor class." alt="" coords="160,161,213,188"><area shape="rect" href="class_quant_lib_1_1_instrument.html" title="Abstract instrument class." alt="" coords="60,7,153,33"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<p>
<a href="class_quant_lib_1_1_cap_floor-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Base class for cap-like instruments.
<p>
<dl compact><dt><b><a class="el" href="test.html#_test000010">Tests:</a></b></dt><dd><ul>
<li>the correctness of the returned value is tested by checking that the price of a cap (resp. floor) decreases (resp. increases) with the strike rate.</li><li>the relationship between the values of caps, floors and the resulting collars is checked.</li><li>the put-call parity between the values of caps, floors and swaps is checked.</li><li>the correctness of the returned implied volatility is tested by using it for reproducing the target value.</li><li>the correctness of the returned value is tested by checking it against a known good value. </li></ul>
</dd></dl>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b>Type</b> { <b>Cap</b>,
<b>Floor</b>,
<b>Collar</b>
}</td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6f0891310d58cfd07749fe51ac4f8e2a"></a><!-- doxytag: member="QuantLib::CapFloor::CapFloor" ref="6f0891310d58cfd07749fe51ac4f8e2a" args="(Type type, const Leg &floatingLeg, const std::vector< Rate > &capRates, const std::vector< Rate > &floorRates)" -->
</td><td class="memItemRight" valign="bottom"><b>CapFloor</b> (Type type, const Leg &floatingLeg, const std::vector< <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a> > &capRates, const std::vector< <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a> > &floorRates)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="03554f9335835c2a9136a361d1901d69"></a><!-- doxytag: member="QuantLib::CapFloor::CapFloor" ref="03554f9335835c2a9136a361d1901d69" args="(Type type, const Leg &floatingLeg, const std::vector< Rate > &strikes)" -->
</td><td class="memItemRight" valign="bottom"><b>CapFloor</b> (Type type, const Leg &floatingLeg, const std::vector< <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a> > &strikes)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b22cef59ebd5cc4069092b8faa08aa0c"></a><!-- doxytag: member="QuantLib::CapFloor::atmRate" ref="b22cef59ebd5cc4069092b8faa08aa0c" args="(const YieldTermStructure &discountCurve) const " -->
<a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a> </td><td class="memItemRight" valign="bottom"><b>atmRate</b> (const <a class="el" href="class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure</a> &discountCurve) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="74ba17e608397824b92c6bd718f31864"></a><!-- doxytag: member="QuantLib::CapFloor::impliedVolatility" ref="74ba17e608397824b92c6bd718f31864" args="(Real price, const Handle< YieldTermStructure > &discountCurve, Real accuracy=1.0e-4, Size maxEvaluations=100, Volatility minVol=1.0e-7, Volatility maxVol=4.0) const " -->
<a class="el" href="group__types.html#gaa95ab7fe66935e3f7535413fad2a7d3">Volatility</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cap_floor.html#74ba17e608397824b92c6bd718f31864">impliedVolatility</a> (<a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> price, const <a class="el" href="class_quant_lib_1_1_handle.html">Handle</a>< <a class="el" href="class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure</a> > &discountCurve, <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> accuracy=1.0e-4, Size maxEvaluations=100, Volatility minVol=1.0e-7, Volatility maxVol=4.0) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">implied term volatility <br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Instrument interface</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="274c03751addc5c2ea63cc23d14a0bfe"></a><!-- doxytag: member="QuantLib::CapFloor::isExpired" ref="274c03751addc5c2ea63cc23d14a0bfe" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cap_floor.html#274c03751addc5c2ea63cc23d14a0bfe">isExpired</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">returns whether the instrument is still tradable. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cap_floor.html#ad6958108bfaef12bc4ccd6b3d7a7231">setupArguments</a> (PricingEngine::arguments *) const </td></tr>
<tr><td colspan="2"><div class="groupHeader">Inspectors</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fbd0fa31db28593e9669c3c56711c0a7"></a><!-- doxytag: member="QuantLib::CapFloor::type" ref="fbd0fa31db28593e9669c3c56711c0a7" args="() const " -->
Type </td><td class="memItemRight" valign="bottom"><b>type</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e8a0ec4e331b9a399599dd4f16f9bef2"></a><!-- doxytag: member="QuantLib::CapFloor::leg" ref="e8a0ec4e331b9a399599dd4f16f9bef2" args="() const " -->
const Leg & </td><td class="memItemRight" valign="bottom"><b>leg</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7d67016c4c1751cd680e0e5ad6a3c276"></a><!-- doxytag: member="QuantLib::CapFloor::capRates" ref="7d67016c4c1751cd680e0e5ad6a3c276" args="() const " -->
const std::vector< <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a> > & </td><td class="memItemRight" valign="bottom"><b>capRates</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="45cc04b41d9b6bcd32ed1cdb654a24e1"></a><!-- doxytag: member="QuantLib::CapFloor::floorRates" ref="45cc04b41d9b6bcd32ed1cdb654a24e1" args="() const " -->
const std::vector< <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a> > & </td><td class="memItemRight" valign="bottom"><b>floorRates</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b770ccb862fe2799b9f9aeff11c9aeb1"></a><!-- doxytag: member="QuantLib::CapFloor::floatingLeg" ref="b770ccb862fe2799b9f9aeff11c9aeb1" args="() const " -->
const Leg & </td><td class="memItemRight" valign="bottom"><b>floatingLeg</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3ab172f9ecc49c3e4606945f0704dcdb"></a><!-- doxytag: member="QuantLib::CapFloor::startDate" ref="3ab172f9ecc49c3e4606945f0704dcdb" args="() const " -->
<a class="el" href="class_quant_lib_1_1_date.html">Date</a> </td><td class="memItemRight" valign="bottom"><b>startDate</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="716a3c2e199a948105b3be48b6c338aa"></a><!-- doxytag: member="QuantLib::CapFloor::maturityDate" ref="716a3c2e199a948105b3be48b6c338aa" args="() const " -->
<a class="el" href="class_quant_lib_1_1_date.html">Date</a> </td><td class="memItemRight" valign="bottom"><b>maturityDate</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bead3b30d656cfccd533e2a5d2d171c9"></a><!-- doxytag: member="QuantLib::CapFloor::lastFloatingRateCoupon" ref="bead3b30d656cfccd533e2a5d2d171c9" args="() const " -->
boost::shared_ptr<br>
< <a class="el" href="class_quant_lib_1_1_floating_rate_coupon.html">FloatingRateCoupon</a> > </td><td class="memItemRight" valign="bottom"><b>lastFloatingRateCoupon</b> () const </td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cap_floor_1_1arguments.html">arguments</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Arguments for cap/floor calculation <a href="class_quant_lib_1_1_cap_floor_1_1arguments.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cap_floor_1_1engine.html">engine</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">base class for cap/floor engines <a href="class_quant_lib_1_1_cap_floor_1_1engine.html#_details">More...</a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="ad6958108bfaef12bc4ccd6b3d7a7231"></a><!-- doxytag: member="QuantLib::CapFloor::setupArguments" ref="ad6958108bfaef12bc4ccd6b3d7a7231" args="(PricingEngine::arguments *) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void setupArguments </td>
<td>(</td>
<td class="paramtype">PricingEngine::arguments * </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const<code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
When a derived argument structure is defined for an instrument, this method should be overridden to fill it. This is mandatory in case a pricing <a class="el" href="class_quant_lib_1_1_cap_floor_1_1engine.html" title="base class for cap/floor engines">engine</a> is used.
<p>Reimplemented from <a class="el" href="class_quant_lib_1_1_instrument.html#ad6958108bfaef12bc4ccd6b3d7a7231">Instrument</a>.</p>
</div>
</div><p>
</div>
<div class="footer">
<div class="endmatter">
Documentation generated by
<a href="http://www.doxygen.org">Doxygen</a> 1.5.4
</div>
</div>
</div>
</body>
</html>
|