QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
makevanillaswap.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006, 2007, 2010 Ferdinando Ametrano
5 Copyright (C) 2006 Katiuscia Manzoni
6 Copyright (C) 2006 StatPro Italia srl
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
26#ifndef quantlib_makevanillaswap_hpp
27#define quantlib_makevanillaswap_hpp
28
29#include <ql/instruments/vanillaswap.hpp>
30#include <ql/time/dategenerationrule.hpp>
31#include <ql/termstructures/yieldtermstructure.hpp>
32
33namespace QuantLib {
34
36
40 public:
41 MakeVanillaSwap(const Period& swapTenor,
42 const ext::shared_ptr<IborIndex>& iborIndex,
43 Rate fixedRate = Null<Rate>(),
44 const Period& forwardStart = 0*Days);
45
46 operator VanillaSwap() const;
47 operator ext::shared_ptr<VanillaSwap>() const;
48
49 MakeVanillaSwap& receiveFixed(bool flag = true);
52
57
64 MakeVanillaSwap& withFixedLegEndOfMonth(bool flag = true);
68
80
82 const Handle<YieldTermStructure>& discountCurve);
84 const ext::shared_ptr<PricingEngine>& engine);
85 MakeVanillaSwap& withIndexedCoupons(const ext::optional<bool>& b = true);
86 MakeVanillaSwap& withAtParCoupons(bool b = true);
87 private:
89 ext::shared_ptr<IborIndex> iborIndex_;
92
96
105 bool fixedEndOfMonth_ = false, floatEndOfMonth_ = false;
110 ext::optional<bool> useIndexedCoupons_;
111
112 ext::shared_ptr<PricingEngine> engine_;
113 };
114
115}
116
117#endif
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
MakeVanillaSwap & receiveFixed(bool flag=true)
MakeVanillaSwap & withFixedLegFirstDate(const Date &d)
MakeVanillaSwap & withEffectiveDate(const Date &)
MakeVanillaSwap & withFixedLegConvention(BusinessDayConvention bdc)
BusinessDayConvention fixedConvention_
MakeVanillaSwap & withFixedLegTerminationDateConvention(BusinessDayConvention bdc)
MakeVanillaSwap & withFloatingLegFirstDate(const Date &d)
MakeVanillaSwap & withFixedLegCalendar(const Calendar &cal)
MakeVanillaSwap & withFloatingLegTerminationDateConvention(BusinessDayConvention bdc)
MakeVanillaSwap & withTerminationDate(const Date &)
MakeVanillaSwap & withAtParCoupons(bool b=true)
MakeVanillaSwap & withDiscountingTermStructure(const Handle< YieldTermStructure > &discountCurve)
DateGeneration::Rule floatRule_
MakeVanillaSwap & withIndexedCoupons(const ext::optional< bool > &b=true)
MakeVanillaSwap & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
MakeVanillaSwap & withSettlementDays(Natural settlementDays)
MakeVanillaSwap & withFixedLegDayCount(const DayCounter &dc)
MakeVanillaSwap & withFixedLegEndOfMonth(bool flag=true)
ext::shared_ptr< IborIndex > iborIndex_
MakeVanillaSwap & withFloatingLegDayCount(const DayCounter &dc)
ext::optional< bool > useIndexedCoupons_
BusinessDayConvention floatTerminationDateConvention_
MakeVanillaSwap & withRule(DateGeneration::Rule r)
MakeVanillaSwap & withFloatingLegSpread(Spread sp)
MakeVanillaSwap & withNominal(Real n)
MakeVanillaSwap & withFloatingLegCalendar(const Calendar &cal)
DateGeneration::Rule fixedRule_
ext::shared_ptr< PricingEngine > engine_
BusinessDayConvention fixedTerminationDateConvention_
MakeVanillaSwap & withFloatingLegRule(DateGeneration::Rule r)
MakeVanillaSwap & withFloatingLegTenor(const Period &t)
MakeVanillaSwap & withFixedLegRule(DateGeneration::Rule r)
MakeVanillaSwap & withType(Swap::Type type)
MakeVanillaSwap & withFloatingLegNextToLastDate(const Date &d)
MakeVanillaSwap & withFloatingLegEndOfMonth(bool flag=true)
MakeVanillaSwap & withFloatingLegConvention(BusinessDayConvention bdc)
BusinessDayConvention floatConvention_
MakeVanillaSwap & withFixedLegNextToLastDate(const Date &d)
MakeVanillaSwap & withFixedLegTenor(const Period &t)
template class providing a null value for a given type.
Definition: null.hpp:76
Plain-vanilla swap: fix vs ibor leg.
Definition: vanillaswap.hpp:65
BusinessDayConvention
Business Day conventions.
QL_REAL Real
real number
Definition: types.hpp:50
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Real Spread
spreads on interest rates
Definition: types.hpp:74
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35