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

Outperformance option. More...

#include <qle/instruments/outperformanceoption.hpp>

+ Inheritance diagram for OutperformanceOption:
+ Collaboration diagram for OutperformanceOption:

Classes

class  arguments
 Arguments for Outperformance option calculation More...
 
class  engine
 base class for outperformance option engines More...
 
class  results
 Results from Outperformance option calculation More...
 

Public Member Functions

 OutperformanceOption (const QuantLib::ext::shared_ptr< Exercise > &exercise, const Option::Type optionType, const Real strikeReturn, const Real initialValue1, const Real initialValue2, const Real notional, const Real knockInPrice=Null< Real >(), const Real knockOutPrice=Null< Real >(), QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex1=nullptr, QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex2=nullptr)
 

Instrument interface

QuantLib::ext::shared_ptr< Exercise > exercise_
 
Option::Type optionType_
 
Real strikeReturn_
 
Real initialValue1_
 
Real initialValue2_
 
Real notional_
 
Real knockInPrice_
 
Real knockOutPrice_
 
QuantLib::ext::shared_ptr< QuantExt::FxIndexfxIndex1_
 
QuantLib::ext::shared_ptr< QuantExt::FxIndexfxIndex2_
 
bool isExpired () const override
 
void setupArguments (PricingEngine::arguments *) const override
 
QuantLib::ext::shared_ptr< Exercise > exercise () const
 
Option::Type optionType () const
 
Real strikeReturn () const
 
Real initialValue1 () const
 
Real initialValue2 () const
 
Real notional () const
 
Real knockInPrice () const
 
Real knockOutPrice () const
 
QuantLib::ext::shared_ptr< QuantExt::FxIndexfxIndex1 () const
 
QuantLib::ext::shared_ptr< QuantExt::FxIndexfxIndex2 () const
 
void setupExpired () const override
 
void fetchResults (const PricingEngine::results *) const override
 

Detailed Description

Outperformance option.

Definition at line 41 of file outperformanceoption.hpp.

Constructor & Destructor Documentation

◆ OutperformanceOption()

OutperformanceOption ( const QuantLib::ext::shared_ptr< Exercise > &  exercise,
const Option::Type  optionType,
const Real  strikeReturn,
const Real  initialValue1,
const Real  initialValue2,
const Real  notional,
const Real  knockInPrice = Null<Real>(),
const Real  knockOutPrice = Null<Real>(),
QuantLib::ext::shared_ptr< QuantExt::FxIndex fxIndex1 = nullptr,
QuantLib::ext::shared_ptr< QuantExt::FxIndex fxIndex2 = nullptr 
)

Definition at line 34 of file outperformanceoption.cpp.

QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex1() const
QuantLib::ext::shared_ptr< Exercise > exercise_
QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex2() const
QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex1_
QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex2_
QuantLib::ext::shared_ptr< Exercise > exercise() const

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 39 of file outperformanceoption.cpp.

39 {
40 return detail::simple_event(exercise_->dates().back()).hasOccurred();
41 }

◆ setupArguments()

void setupArguments ( PricingEngine::arguments *  args) const
override

Definition at line 47 of file outperformanceoption.cpp.

48 {
49
50 OutperformanceOption::arguments* arguments =
51 dynamic_cast<OutperformanceOption::arguments*>(args);
52
53 QL_REQUIRE(arguments != 0, "wrong argument type");
54
55 arguments->exercise = exercise_;
56 arguments->optionType = optionType_;
57 arguments->strikeReturn = strikeReturn_;
58 arguments->initialValue1 = initialValue1_;
59 arguments->initialValue2 = initialValue2_;
60 arguments->notional = notional_;
61 arguments->knockInPrice = knockInPrice_;
62 arguments->knockOutPrice = knockOutPrice_;
63 arguments->knockInPrice = knockInPrice_;
64 arguments->fxIndex1 = fxIndex1_;
65 arguments->fxIndex2 = fxIndex2_;
66
67 }

◆ exercise()

QuantLib::ext::shared_ptr< Exercise > exercise ( ) const

Definition at line 57 of file outperformanceoption.hpp.

57{ return exercise_; }

◆ optionType()

Option::Type optionType ( ) const

Definition at line 58 of file outperformanceoption.hpp.

58{ return optionType_; }

◆ strikeReturn()

Real strikeReturn ( ) const

Definition at line 59 of file outperformanceoption.hpp.

59{ return strikeReturn_; }

◆ initialValue1()

Real initialValue1 ( ) const

Definition at line 60 of file outperformanceoption.hpp.

60{ return initialValue1_; }

◆ initialValue2()

Real initialValue2 ( ) const

Definition at line 61 of file outperformanceoption.hpp.

61{ return initialValue2_; }

◆ notional()

Real notional ( ) const

Definition at line 62 of file outperformanceoption.hpp.

62{ return notional_; }

◆ knockInPrice()

Real knockInPrice ( ) const

Definition at line 63 of file outperformanceoption.hpp.

63{ return knockInPrice_; }

◆ knockOutPrice()

Real knockOutPrice ( ) const

Definition at line 64 of file outperformanceoption.hpp.

64{ return knockOutPrice_; }

◆ fxIndex1()

QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex1 ( ) const

Definition at line 65 of file outperformanceoption.hpp.

65{ return fxIndex1_; }

◆ fxIndex2()

QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex2 ( ) const

Definition at line 66 of file outperformanceoption.hpp.

66{ return fxIndex2_; }

◆ setupExpired()

void setupExpired ( ) const
overrideprivate

Definition at line 43 of file outperformanceoption.cpp.

43 {
44 NPV_ = 0.0;
45 }

◆ fetchResults()

void fetchResults ( const PricingEngine::results *  r) const
overrideprivate

Definition at line 73 of file outperformanceoption.cpp.

73 {
74 Instrument::fetchResults(r);
75 const OutperformanceOption::results* results =
76 dynamic_cast<const OutperformanceOption::results*>(r);
77
78 QL_ENSURE(results != 0,
79 "wrong result type");
80 }

Member Data Documentation

◆ exercise_

QuantLib::ext::shared_ptr<Exercise> exercise_
private

Definition at line 71 of file outperformanceoption.hpp.

◆ optionType_

Option::Type optionType_
private

Definition at line 72 of file outperformanceoption.hpp.

◆ strikeReturn_

Real strikeReturn_
private

Definition at line 73 of file outperformanceoption.hpp.

◆ initialValue1_

Real initialValue1_
private

Definition at line 74 of file outperformanceoption.hpp.

◆ initialValue2_

Real initialValue2_
private

Definition at line 75 of file outperformanceoption.hpp.

◆ notional_

Real notional_
private

Definition at line 76 of file outperformanceoption.hpp.

◆ knockInPrice_

Real knockInPrice_
private

Definition at line 77 of file outperformanceoption.hpp.

◆ knockOutPrice_

Real knockOutPrice_
private

Definition at line 78 of file outperformanceoption.hpp.

◆ fxIndex1_

QuantLib::ext::shared_ptr<QuantExt::FxIndex> fxIndex1_
private

Definition at line 79 of file outperformanceoption.hpp.

◆ fxIndex2_

QuantLib::ext::shared_ptr<QuantExt::FxIndex> fxIndex2_
private

Definition at line 80 of file outperformanceoption.hpp.