pricingengines.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, 2012 Ferdinando Ametrano
5  Copyright (C) 2006 Cristina Duminuco
6  Copyright (C) 2007 Eric Ehlers
7  Copyright (C) 2015 Paolo Mazzocchi
8  Copyright (C) 2016 Stefano Fondi
9 
10  This file is part of QuantLib, a free-software/open-source library
11  for financial quantitative analysts and developers - http://quantlib.org/
12 
13  QuantLib is free software: you can redistribute it and/or modify it
14  under the terms of the QuantLib license. You should have received a
15  copy of the license along with this program; if not, please email
16  <quantlib-dev@lists.sf.net>. The license is also available online at
17  <http://quantlib.org/license.shtml>.
18 
19  This program is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21  FOR A PARTICULAR PURPOSE. See the license for more details.
22 */
23 
24 #ifndef qla_pricingengine_hpp
25 #define qla_pricingengine_hpp
26 
27 #include <oh/libraryobject.hpp>
28 
29 #include <ql/option.hpp>
30 
31 namespace QuantLib {
32  class Date;
33  class SimpleQuote;
34  class AffineModel;
35  class MarketModelFactory;
36  class SwaptionVolatilityStructure;
37  class OptionletVolatilityStructure;
38  class BlackCapFloorEngine;
39  class BachelierCapFloorEngine;
40  class AnalyticCapFloorEngine;
41  class MarketModelCapFloorEngine;
42  class BlackCalculator;
43  class StrikedTypePayoff;
44  class PricingEngine;
45  class Quote;
46  class YieldTermStructure;
47  class DayCounter;
48  class DiscountingBondEngine;
49  class DiscountingSwapEngine;
50  class GeneralizedBlackScholesProcess;
51  class OneFactorAffineModel;
52  class G2;
53 
54  template <class T>
55  class Handle;
56 }
57 
58 namespace QuantLibAddin {
59 
60  class PricingEngine : public ObjectHandler::LibraryObject<QuantLib::PricingEngine> {
61  public:
62  // PricingEngines - without timesteps
64  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
65  const std::string& engineID,
66  const boost::shared_ptr<QuantLib::GeneralizedBlackScholesProcess>& process,
67  bool permanent);
68  // PricingEngines - with timesteps
70  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
71  const std::string& engineID,
72  const boost::shared_ptr<QuantLib::GeneralizedBlackScholesProcess>& process,
73  const long& timeSteps,
74  bool permanent);
75  protected:
76  OH_LIB_CTOR(PricingEngine, QuantLib::PricingEngine);
77  };
78 
80  public:
82  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
84  bool includeSettlementDateFlows,
85  const QuantLib::Date& settlementDate,
86  const QuantLib::Date& npvDate,
87  bool permanent);
88  };
89 
91  public:
93  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
96  const QuantLib::Real displacement,
97  const QuantLib::DayCounter& dayCounter,
98  bool permanent);
100  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
103  bool permanent);
104  };
105 
107  public:
109  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
112  const QuantLib::Real displacement,
113  const QuantLib::DayCounter& dayCounter,
114  bool permanent);
116  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
119  const QuantLib::Real displacement,
120  bool permanent);
121  };
122 
124  public:
126  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
129  const QuantLib::DayCounter& dayCounter,
130  bool permanent);
132  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
135  bool permanent);
136  };
137 
139  public:
141  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
142  const boost::shared_ptr<QuantLib::AffineModel>& model,
143  bool permanent);
144  //AnalyticCapFloorEngine(
145  // const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
146  // const boost::shared_ptr<QuantLib::G2>& model,
147  // bool permanent);
148  //AnalyticCapFloorEngine(
149  // const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
150  // const boost::shared_ptr<QuantLib::LiborForwardModel>& model,
151  // bool permanent);
152  };
153 
154  class BlackCalculator : public ObjectHandler::LibraryObject<QuantLib::BlackCalculator> {
155  public:
157  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
158  QuantLib::Option::Type optionType,
159  QuantLib::Real strike,
160  QuantLib::Real forward,
161  QuantLib::Real variance,
162  QuantLib::DiscountFactor discount,
163  bool permanent);
165  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
166  const boost::shared_ptr<QuantLib::StrikedTypePayoff>& payoff,
167  QuantLib::Real forward,
168  QuantLib::Real variance,
169  QuantLib::DiscountFactor discount,
170  bool permanent);
171  protected:
172  OH_LIB_CTOR(BlackCalculator, QuantLib::BlackCalculator);
173  };
174 
176  public:
178  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
179  QuantLib::Option::Type optionType,
180  QuantLib::Real strike,
181  QuantLib::Real spot,
182  QuantLib::DiscountFactor growth,
183  QuantLib::Real variance,
184  QuantLib::DiscountFactor discount,
185  bool permanent);
187  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
188  const boost::shared_ptr<QuantLib::StrikedTypePayoff>& payoff,
189  QuantLib::Real spot,
190  QuantLib::DiscountFactor growth,
191  QuantLib::Real variance,
192  QuantLib::DiscountFactor discount,
193  bool permanent);
194  };
195 
196  class BondEngine : public PricingEngine {
197  public:
198  BondEngine(
199  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
201  bool permanent);
202  };
203 
205  public:
207  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
208  const boost::shared_ptr<QuantLib::OneFactorAffineModel>& model,
210  bool permanent);
211  };
212 
214  public:
216  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
217  const boost::shared_ptr<QuantLib::OneFactorAffineModel>& model,
218  QuantLib::Size timeSteps,
220  bool permanent);
221  };
222 
224  public:
225  // range is the number of standard deviations to use in the
226  // exponential term of the integral for the european swaption.
227  // intervals is the number of intervals to use in the integration.
229  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
230  const boost::shared_ptr<QuantLib::G2>& model,
231  QuantLib::Real range,
232  QuantLib::Size intervals,
233  bool permanent);
234  };
235 }
236 
237 #endif
G2SwaptionEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::G2 > &model, QuantLib::Real range, QuantLib::Size intervals, bool permanent)
Definition: basketlossmodels.hpp:32
OH_LIB_CTOR(BlackCalculator, QuantLib::BlackCalculator)
AnalyticCapFloorEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::AffineModel > &model, bool permanent)
BlackCalculator(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, QuantLib::Option::Type optionType, QuantLib::Real strike, QuantLib::Real forward, QuantLib::Real variance, QuantLib::DiscountFactor discount, bool permanent)
PricingEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const std::string &engineID, const boost::shared_ptr< QuantLib::GeneralizedBlackScholesProcess > &process, bool permanent)
Definition: pricingengines.hpp:106
Definition: pricingengines.hpp:79
BachelierCapFloorEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::Handle< QuantLib::Quote > &vol, const QuantLib::DayCounter &dayCounter, bool permanent)
Definition: pricingengines.hpp:175
Definition: pricingengines.hpp:123
Definition: pricingengines.hpp:223
DiscountingSwapEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const QuantLib::Handle< QuantLib::YieldTermStructure > &, bool includeSettlementDateFlows, const QuantLib::Date &settlementDate, const QuantLib::Date &npvDate, bool permanent)
Definition: pricingengines.hpp:196
TreeSwaptionEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::OneFactorAffineModel > &model, QuantLib::Size timeSteps, const QuantLib::Handle< QuantLib::YieldTermStructure > &termStructure, bool permanent)
BlackCapFloorEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const QuantLib::Handle< QuantLib::YieldTermStructure > &, const QuantLib::Handle< QuantLib::Quote > &vol, const QuantLib::Real displacement, const QuantLib::DayCounter &dayCounter, bool permanent)
Definition: pricingengines.hpp:90
BondEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, bool permanent)
Definition: abcd.hpp:38
BlackScholesCalculator(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, QuantLib::Option::Type optionType, QuantLib::Real strike, QuantLib::Real spot, QuantLib::DiscountFactor growth, QuantLib::Real variance, QuantLib::DiscountFactor discount, bool permanent)
JamshidianSwaptionEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::OneFactorAffineModel > &model, const QuantLib::Handle< QuantLib::YieldTermStructure > &termStructure, bool permanent)
Definition: pricingengines.hpp:154
Definition: abcd.hpp:30
Definition: pricingengines.hpp:138
Definition: pricingengines.hpp:204
Definition: pricingengines.hpp:213
OH_LIB_CTOR(PricingEngine, QuantLib::PricingEngine)
Definition: pricingengines.hpp:60
BlackSwaptionEngine(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const QuantLib::Handle< QuantLib::YieldTermStructure > &, const QuantLib::Handle< QuantLib::Quote > &vol, const QuantLib::Real displacement, const QuantLib::DayCounter &dayCounter, bool permanent)