Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
McCamFxForwardEngine Class Reference

#include <qle/pricingengines/mccamfxforwardengine.hpp>

+ Inheritance diagram for McCamFxForwardEngine:
+ Collaboration diagram for McCamFxForwardEngine:

Public Member Functions

 McCamFxForwardEngine (const Handle< CrossAssetModel > &model, const Currency &domesticCcy, const Currency &foreignCcy, const Currency &npvCcy, const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator, const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed, const Size pricingSeed, const Size polynomOrder, const LsmBasisSystem::PolynomialType polynomType, const SobolBrownianGenerator::Ordering ordering=SobolBrownianGenerator::Steps, const SobolRsg::DirectionIntegers directionIntegers=SobolRsg::JoeKuoD7, const std::vector< Handle< YieldTermStructure > > &discountCurves=std::vector< Handle< YieldTermStructure > >(), const std::vector< Date > &simulationDates=std::vector< Date >(), const std::vector< Size > &externalModelIndices=std::vector< Size >(), const bool minimalObsDate=true, const RegressorModel regressorModel=RegressorModel::Simple, const Real regressionVarianceCutoff=Null< Real >())
 
void calculate () const override
 
const Handle< CrossAssetModel > & model () const
 

Private Attributes

const Currency domesticCcy_
 
const Currency foreignCcy_
 
const Currency npvCcy_
 

Additional Inherited Members

- Public Types inherited from McMultiLegBaseEngine
enum  RegressorModel { Simple , LaggedFX }
 
- Protected Member Functions inherited from McMultiLegBaseEngine
 McMultiLegBaseEngine (const Handle< CrossAssetModel > &model, const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator, const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed, const Size pricingSeed, const Size polynomOrder, const LsmBasisSystem::PolynomialType polynomType, const SobolBrownianGenerator::Ordering ordering, const SobolRsg::DirectionIntegers directionIntegers, const std::vector< Handle< YieldTermStructure > > &discountCurves=std::vector< Handle< YieldTermStructure > >(), const std::vector< Date > &simulationDates=std::vector< Date >(), const std::vector< Size > &externalModelIndices=std::vector< Size >(), const bool minimalObsDate=true, const RegressorModel regressorModel=RegressorModel::Simple, const Real regressionVarianceCutoff=Null< Real >())
 
void calculate () const
 
QuantLib::ext::shared_ptr< AmcCalculatoramcCalculator () const
 
- Protected Attributes inherited from McMultiLegBaseEngine
std::vector< Leg > leg_
 
std::vector< Currency > currency_
 
std::vector< boolpayer_
 
QuantLib::ext::shared_ptr< Exercise > exercise_
 
Settlement::Type optionSettlement_ = Settlement::Physical
 
bool includeSettlementDateFlows_ = false
 
Handle< CrossAssetModelmodel_
 
SequenceType calibrationPathGenerator_
 
SequenceType pricingPathGenerator_
 
Size calibrationSamples_
 
Size pricingSamples_
 
Size calibrationSeed_
 
Size pricingSeed_
 
Size polynomOrder_
 
LsmBasisSystem::PolynomialType polynomType_
 
SobolBrownianGenerator::Ordering ordering_
 
SobolRsg::DirectionIntegers directionIntegers_
 
std::vector< Handle< YieldTermStructure > > discountCurves_
 
std::vector< Date > simulationDates_
 
std::vector< Size > externalModelIndices_
 
bool minimalObsDate_
 
RegressorModel regressorModel_
 
Real regressionVarianceCutoff_
 
QuantLib::ext::shared_ptr< AmcCalculatoramcCalculator_
 
Real resultUnderlyingNpv_
 
Real resultValue_
 

Detailed Description

Definition at line 33 of file mccamfxforwardengine.hpp.

Constructor & Destructor Documentation

◆ McCamFxForwardEngine()

McCamFxForwardEngine ( const Handle< CrossAssetModel > &  model,
const Currency &  domesticCcy,
const Currency &  foreignCcy,
const Currency &  npvCcy,
const SequenceType  calibrationPathGenerator,
const SequenceType  pricingPathGenerator,
const Size  calibrationSamples,
const Size  pricingSamples,
const Size  calibrationSeed,
const Size  pricingSeed,
const Size  polynomOrder,
const LsmBasisSystem::PolynomialType  polynomType,
const SobolBrownianGenerator::Ordering  ordering = SobolBrownianGenerator::Steps,
const SobolRsg::DirectionIntegers  directionIntegers = SobolRsg::JoeKuoD7,
const std::vector< Handle< YieldTermStructure > > &  discountCurves = std::vector<Handle<YieldTermStructure>>(),
const std::vector< Date > &  simulationDates = std::vector<Date>(),
const std::vector< Size > &  externalModelIndices = std::vector<Size>(),
const bool  minimalObsDate = true,
const RegressorModel  regressorModel = RegressorModel::Simple,
const Real  regressionVarianceCutoff = Null<Real>() 
)

Definition at line 27 of file mccamfxforwardengine.cpp.

36 : McMultiLegBaseEngine(model, calibrationPathGenerator, pricingPathGenerator, calibrationSamples, pricingSamples,
37 calibrationSeed, pricingSeed, polynomOrder, polynomType, ordering, directionIntegers,
38 discountCurves, simulationDates, externalModelIndices, minimalObsDate, regressorModel,
39 regressionVarianceCutoff),
40 domesticCcy_(domesticCcy), foreignCcy_(foreignCcy), npvCcy_(npvCcy) {
41 registerWith(model_);
42 for (auto const& h : discountCurves)
43 registerWith(h);
44}
const Handle< CrossAssetModel > & model() const
McMultiLegBaseEngine(const Handle< CrossAssetModel > &model, const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator, const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed, const Size pricingSeed, const Size polynomOrder, const LsmBasisSystem::PolynomialType polynomType, const SobolBrownianGenerator::Ordering ordering, const SobolRsg::DirectionIntegers directionIntegers, const std::vector< Handle< YieldTermStructure > > &discountCurves=std::vector< Handle< YieldTermStructure > >(), const std::vector< Date > &simulationDates=std::vector< Date >(), const std::vector< Size > &externalModelIndices=std::vector< Size >(), const bool minimalObsDate=true, const RegressorModel regressorModel=RegressorModel::Simple, const Real regressionVarianceCutoff=Null< Real >())
Handle< CrossAssetModel > model_

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 46 of file mccamfxforwardengine.cpp.

46 {
47
48 Leg foreignLeg{QuantLib::ext::make_shared<SimpleCashFlow>(arguments_.nominal1, arguments_.payDate)};
49 Leg domesticLeg{QuantLib::ext::make_shared<SimpleCashFlow>(arguments_.nominal2, arguments_.payDate)};
50
51 leg_ = {foreignLeg, domesticLeg};
53 payer_ = {false, true};
54 exercise_ = nullptr;
55 includeSettlementDateFlows_ = arguments_.includeSettlementDateFlows;
56
58
59 // convert base ccy result from McMultiLegbaseEngine to desired npv currency
60 Real fxSpot = 1.0;
61 Size npvCcyIndex = model_->ccyIndex(npvCcy_);
62 if (npvCcyIndex > 0)
63 fxSpot = model_->fxbs(npvCcyIndex - 1)->fxSpotToday()->value();
64 results_.value = resultValue_ / fxSpot;
65 results_.additionalResults["underlyingNpv"] = resultUnderlyingNpv_ / fxSpot;
66 results_.additionalResults["amcCalculator"] = amcCalculator();
67
68} // calculate
const Instrument::results * results_
Definition: cdsoption.cpp:81
QuantLib::ext::shared_ptr< Exercise > exercise_
QuantLib::ext::shared_ptr< AmcCalculator > amcCalculator() const
Swap::arguments * arguments_
+ Here is the call graph for this function:

◆ model()

const Handle< CrossAssetModel > & model ( ) const

Definition at line 49 of file mccamfxforwardengine.hpp.

49{ return model_; }

Member Data Documentation

◆ domesticCcy_

const Currency domesticCcy_
private

Definition at line 52 of file mccamfxforwardengine.hpp.

◆ foreignCcy_

const Currency foreignCcy_
private

Definition at line 52 of file mccamfxforwardengine.hpp.

◆ npvCcy_

const Currency npvCcy_
private

Definition at line 52 of file mccamfxforwardengine.hpp.