Skip to content

Commit 91a6561

Browse files
rolandlichtersjenkins
authored andcommitted
add default false to replicate the quantlib engine
1 parent daf93d3 commit 91a6561

6 files changed

Lines changed: 10 additions & 8 deletions

File tree

OREData/ored/portfolio/builders/equitydigitaloption.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class EquityDigitalOptionEngineBuilder
5858
market_->equityForecastCurve(assetName, configuration(ore::data::MarketContext::pricing)),
5959
market_->equityVol(assetName, configuration(ore::data::MarketContext::pricing)));
6060

61-
return boost::make_shared<AnalyticEuropeanEngine>(gbsp);
61+
return boost::make_shared<QuantExt::AnalyticEuropeanEngine>(gbsp);
6262
}
6363
};
6464

OREData/ored/portfolio/builders/equitytouchoption.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ class EquityTouchOptionEngineBuilder
6363

6464
if (type == "One-Touch") {
6565
engine_ = "AnalyticDigitalAmericanEngine";
66-
return boost::make_shared<AnalyticDigitalAmericanEngine>(gbsp);
66+
return boost::make_shared<QuantExt::AnalyticDigitalAmericanEngine>(gbsp);
6767
} else if (type == "No-Touch") {
6868
engine_ = "AnalyticDigitalAmericanKOEngine";
69-
return boost::make_shared<AnalyticDigitalAmericanKOEngine>(gbsp);
69+
return boost::make_shared<QuantExt::AnalyticDigitalAmericanKOEngine>(gbsp);
7070
} else {
7171
QL_FAIL("Unknwon EQ touch option type: " << type);
7272
}

QuantExt/qle/pricingengines/analyticdoublebarrierbinaryengine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace QuantExt {
3434
class AnalyticDoubleBarrierBinaryEngine : public QuantLib::AnalyticDoubleBarrierBinaryEngine {
3535
public:
3636
explicit AnalyticDoubleBarrierBinaryEngine(ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp,
37-
const bool flipResults)
37+
const bool flipResults = false)
3838
: QuantLib::AnalyticDoubleBarrierBinaryEngine(gbsp), flipResults_(flipResults) {}
3939
void calculate() const override;
4040

QuantExt/qle/pricingengines/analyticeuropeanengine.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
results in the case of FX instruments where the trade builder may have inverted the underlying pair
2222
*/
2323

24+
#pragma once
25+
2426
#include <ql/instruments/vanillaoption.hpp>
2527
#include <ql/pricingengines/vanilla/analyticeuropeanengine.hpp>
2628
#include <ql/processes/blackscholesprocess.hpp>
@@ -33,11 +35,11 @@ using namespace QuantLib;
3335

3436
class AnalyticEuropeanEngine : public QuantLib::AnalyticEuropeanEngine {
3537
public:
36-
explicit AnalyticEuropeanEngine(ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp, const bool flipResults)
38+
explicit AnalyticEuropeanEngine(ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp, const bool flipResults = false)
3739
: QuantLib::AnalyticEuropeanEngine(gbsp), flipResults_(flipResults) {}
3840

3941
AnalyticEuropeanEngine(ext::shared_ptr<GeneralizedBlackScholesProcess> process,
40-
Handle<YieldTermStructure> discountCurve, const bool flipResults)
42+
Handle<YieldTermStructure> discountCurve, const bool flipResults = false)
4143
: QuantLib::AnalyticEuropeanEngine(process), flipResults_(flipResults) {}
4244
void calculate() const override;
4345

QuantExt/qle/termstructures/inflation/cpipricevolatilitysurface.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828
#include <qle/pricingengines/cpiblackcapfloorengine.hpp>
2929
#include <qle/termstructures/inflation/constantcpivolatility.hpp>
3030
#include <qle/termstructures/inflation/cpivolatilitystructure.hpp>
31+
#include <qle/termstructures/strippedcpivolatilitystructure.hpp>
3132
#include <qle/utilities/inflation.hpp>
3233

3334
namespace QuantExt {
3435

35-
enum PriceQuotePreference { Cap, Floor, CapFloor };
36-
3736
struct CPIPriceVolatilitySurfaceDefaultValues {
3837
static constexpr QuantLib::Real upperVolBound = 1.0;
3938
static constexpr QuantLib::Real lowerVolBound = 0.000001;

QuantExt/qle/termstructures/strippedcpivolatilitystructure.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <qle/utilities/inflation.hpp>
3333

3434
namespace QuantExt {
35+
using namespace QuantLib;
3536

3637
enum PriceQuotePreference { Cap, Floor, CapFloor };
3738

0 commit comments

Comments
 (0)