QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
makecapfloor.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) 2006, 2007 Ferdinando Ametrano
5 Copyright (C) 2007 StatPro Italia srl
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21/*! \file makecapfloor.hpp
22 \brief Helper class to instantiate standard market cap/floor.
23*/
24
25#ifndef quantlib_instruments_makecapfloor_hpp
26#define quantlib_instruments_makecapfloor_hpp
27
30
31namespace QuantLib {
32
33 //! helper class
34 /*! This class provides a more comfortable way
35 to instantiate standard market cap and floor.
36 */
38 public:
39 MakeCapFloor(CapFloor::Type capFloorType,
40 const Period& capFloorTenor,
41 const ext::shared_ptr<IborIndex>& iborIndex,
42 Rate strike = Null<Rate>(),
43 const Period& forwardStart = 0*Days);
44
45 operator CapFloor() const;
46 operator ext::shared_ptr<CapFloor>() const;
47
49 MakeCapFloor& withEffectiveDate(const Date& effectiveDate,
50 bool firstCapletExcluded);
56 MakeCapFloor& withEndOfMonth(bool flag = true);
60
61 //! only get last coupon
62 MakeCapFloor& asOptionlet(bool b = true);
63
65 const ext::shared_ptr<PricingEngine>& engine);
66 private:
70
72
73 ext::shared_ptr<PricingEngine> engine_;
74 };
75
76}
77
78#endif
cap and floor class
calendar class
Definition: calendar.hpp:61
Base class for cap-like instruments.
Definition: capfloor.hpp:55
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
MakeCapFloor & withTenor(const Period &t)
MakeCapFloor & withEffectiveDate(const Date &effectiveDate, bool firstCapletExcluded)
MakeCapFloor & withNominal(Real n)
MakeCapFloor & withCalendar(const Calendar &cal)
MakeCapFloor & withDayCount(const DayCounter &dc)
MakeCapFloor & asOptionlet(bool b=true)
only get last coupon
MakeVanillaSwap makeVanillaSwap_
MakeCapFloor & withFirstDate(const Date &d)
MakeCapFloor & withEndOfMonth(bool flag=true)
ext::shared_ptr< PricingEngine > engine_
MakeCapFloor & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
MakeCapFloor & withRule(DateGeneration::Rule r)
MakeCapFloor & withConvention(BusinessDayConvention bdc)
MakeCapFloor & withTerminationDateConvention(BusinessDayConvention bdc)
CapFloor::Type capFloorType_
MakeCapFloor & withNextToLastDate(const Date &d)
template class providing a null value for a given type.
Definition: null.hpp:76
const DefaultType & t
Date d
ext::function< Real(Real)> b
BusinessDayConvention
Business Day conventions.
QL_REAL Real
real number
Definition: types.hpp:50
Real Rate
interest rates
Definition: types.hpp:70
Helper class to instantiate standard market swaps.
Definition: any.hpp:35
ext::shared_ptr< YieldTermStructure > r