capletvolstructure.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, 2010 Ferdinando Ametrano
5  Copyright (C) 2007 Eric Ehlers
6  Copyright (C) 2016 Stefano Fondi
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 
22 #ifndef qla_capletvolstructure_hpp
23 #define qla_capletvolstructure_hpp
24 
25 #include <qlo/termstructures.hpp>
26 
27 #include <ql/types.hpp>
28 #include <ql/time/businessdayconvention.hpp>
29 #include <ql/termstructures/volatility/volatilitytype.hpp>
30 
31 namespace QuantLib {
32  class Period;
33  class SmileSection;
34  class IborIndex;
35  class Calendar;
36  class DayCounter;
37  class Quote;
38  class Date;
39 
40  template <class T>
41  class Handle;
42 
43  class CapFloorTermVolSurface;
44  class CapFloorTermVolCurve;
45  class OptionletStripper1;
46  class OptionletStripper2;
47  class StrippedOptionletAdapter;
48  class StrippedOptionlet;
49  class StrippedOptionletBase;
50 }
51 
52 namespace QuantLibAddin {
53 
54 
55  // OptionletVolatilityStructures
56 
57  class ConstantOptionletVolatility : public OptionletVolatilityStructure {
58  public:
60  const boost::shared_ptr<ObjectHandler::ValueObject>&,
61  QuantLib::Natural settlementDays,
62  const QuantLib::Calendar& cal,
63  QuantLib::BusinessDayConvention bdc,
64  const QuantLib::Handle<QuantLib::Quote>& volatility,
65  const QuantLib::DayCounter& dayCounter,
66  QuantLib::VolatilityType type,
67  QuantLib::Real shift,
68  bool permanent);
69  };
70 
71  class SpreadedOptionletVolatility : public OptionletVolatilityStructure {
72  public:
74  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
77  bool permanent);
78 
79  };
80 
81  class StrippedOptionletAdapter : public OptionletVolatilityStructure {
82  public:
84  const boost::shared_ptr<ObjectHandler::ValueObject>&,
85  const boost::shared_ptr<QuantLib::StrippedOptionletBase>&,
86  bool permanent);
87  };
88 
89  // OptionletStrippers
90 
91  OH_LIB_CLASS(StrippedOptionletBase, QuantLib::StrippedOptionletBase);
92 
93  class StrippedOptionlet : public StrippedOptionletBase {
94  public:
96  const boost::shared_ptr<ObjectHandler::ValueObject>&,
97  QuantLib::Natural settlementDays,
98  const QuantLib::Calendar& calendar,
99  QuantLib::BusinessDayConvention businessDayConvention,
100  const boost::shared_ptr<QuantLib::IborIndex>& index,
101  const std::vector<QuantLib::Date>& optionletDates,
102  const std::vector<QuantLib::Rate>& strikes,
103  const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >&,
104  const QuantLib::DayCounter& dc,
105  QuantLib::VolatilityType type,
106  QuantLib::Real shift,
107  bool permanent);
108  };
109 
110  OH_OBJ_CLASS(OptionletStripper, StrippedOptionletBase);
111 
112  class OptionletStripper1 : public OptionletStripper {
113  public:
115  const boost::shared_ptr<ObjectHandler::ValueObject>&,
116  const boost::shared_ptr<QuantLib::CapFloorTermVolSurface>&,
117  const boost::shared_ptr<QuantLib::IborIndex>& index,
118  QuantLib::Rate switchStrike,
119  QuantLib::Real accuracy,
120  QuantLib::Natural maxIterations,
121  QuantLib::VolatilityType type,
122  QuantLib::Real shift,
123  bool permanent);
124  };
125 
126  class OptionletStripper2 : public OptionletStripper {
127  public:
129  const boost::shared_ptr<ObjectHandler::ValueObject>&,
130  const boost::shared_ptr<QuantLib::OptionletStripper1>&,
132  bool permanent);
133  };
134 
135  // CapFloorTermVolatilityStructures
136 
137  class CapFloorTermVolCurve : public CapFloorTermVolatilityStructure {
138  public:
140  const boost::shared_ptr<ObjectHandler::ValueObject>&,
141  QuantLib::Natural settlementDays,
142  const QuantLib::Calendar& calendar,
143  QuantLib::BusinessDayConvention bdc,
144  const std::vector<QuantLib::Period>& optionTenors,
145  const std::vector<QuantLib::Handle<QuantLib::Quote> >&,
146  const QuantLib::DayCounter& dayCounter,
147  bool permanent);
148  };
149 
150  class CapFloorTermVolSurface : public CapFloorTermVolatilityStructure {
151  public:
153  const boost::shared_ptr<ObjectHandler::ValueObject>&,
154  QuantLib::Natural settlementDays,
155  const QuantLib::Calendar& calendar,
156  QuantLib::BusinessDayConvention bdc,
157  const std::vector<QuantLib::Period>& optionTenors,
158  const std::vector<QuantLib::Rate>& strikes,
159  const std::vector<std::vector<QuantLib::Handle<QuantLib::Quote> > >&,
160  const QuantLib::DayCounter& dc,
161  bool permanent);
162  };
163 
164 }
165 
166 #endif
CapFloorTermVolSurface(const boost::shared_ptr< ObjectHandler::ValueObject > &, QuantLib::Natural settlementDays, const QuantLib::Calendar &calendar, QuantLib::BusinessDayConvention bdc, const std::vector< QuantLib::Period > &optionTenors, const std::vector< QuantLib::Rate > &strikes, const std::vector< std::vector< QuantLib::Handle< QuantLib::Quote > > > &, const QuantLib::DayCounter &dc, bool permanent)
OptionletStripper1(const boost::shared_ptr< ObjectHandler::ValueObject > &, const boost::shared_ptr< QuantLib::CapFloorTermVolSurface > &, const boost::shared_ptr< QuantLib::IborIndex > &index, QuantLib::Rate switchStrike, QuantLib::Real accuracy, QuantLib::Natural maxIterations, QuantLib::VolatilityType type, QuantLib::Real shift, bool permanent)
Definition: capletvolstructure.hpp:137
Definition: capletvolstructure.hpp:57
OH_LIB_CLASS(AlphaForm, QuantLib::AlphaForm)
OptionletStripper2(const boost::shared_ptr< ObjectHandler::ValueObject > &, const boost::shared_ptr< QuantLib::OptionletStripper1 > &, const QuantLib::Handle< QuantLib::CapFloorTermVolCurve > &, bool permanent)
Definition: capletvolstructure.hpp:112
Definition: capletvolstructure.hpp:81
Definition: capletvolstructure.hpp:93
StrippedOptionletAdapter(const boost::shared_ptr< ObjectHandler::ValueObject > &, const boost::shared_ptr< QuantLib::StrippedOptionletBase > &, bool permanent)
SpreadedOptionletVolatility(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const QuantLib::Handle< QuantLib::OptionletVolatilityStructure > &, const QuantLib::Handle< QuantLib::Quote > &, bool permanent)
Definition: capletvolstructure.hpp:126
StrippedOptionlet(const boost::shared_ptr< ObjectHandler::ValueObject > &, QuantLib::Natural settlementDays, const QuantLib::Calendar &calendar, QuantLib::BusinessDayConvention businessDayConvention, const boost::shared_ptr< QuantLib::IborIndex > &index, const std::vector< QuantLib::Date > &optionletDates, const std::vector< QuantLib::Rate > &strikes, const std::vector< std::vector< QuantLib::Handle< QuantLib::Quote > > > &, const QuantLib::DayCounter &dc, QuantLib::VolatilityType type, QuantLib::Real shift, bool permanent)
CapFloorTermVolCurve(const boost::shared_ptr< ObjectHandler::ValueObject > &, QuantLib::Natural settlementDays, const QuantLib::Calendar &calendar, QuantLib::BusinessDayConvention bdc, const std::vector< QuantLib::Period > &optionTenors, const std::vector< QuantLib::Handle< QuantLib::Quote > > &, const QuantLib::DayCounter &dayCounter, bool permanent)
OH_OBJ_CLASS(OneAssetOption, Instrument)
Definition: capletvolstructure.hpp:71
Definition: abcd.hpp:38
Definition: abcd.hpp:30
Definition: capletvolstructure.hpp:150
ConstantOptionletVolatility(const boost::shared_ptr< ObjectHandler::ValueObject > &, QuantLib::Natural settlementDays, const QuantLib::Calendar &cal, QuantLib::BusinessDayConvention bdc, const QuantLib::Handle< QuantLib::Quote > &volatility, const QuantLib::DayCounter &dayCounter, QuantLib::VolatilityType type, QuantLib::Real shift, bool permanent)