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

Pairwise Variance swap. More...

#include <qle/instruments/pairwisevarianceswap.hpp>

+ Inheritance diagram for PairwiseVarianceSwap:
+ Collaboration diagram for PairwiseVarianceSwap:

Classes

class  arguments
 Arguments More...
 
class  engine
 base class for pairwise variance-swap engines More...
 
class  results
 Results from pairwise variance-swap calculation More...
 

Public Member Functions

 PairwiseVarianceSwap (const Position::Type position, const Real strike1, const Real strike2, const Real basketStrike, const Real notional1, const Real notional2, const Real basketNotional, const Real cap, const Real floor, const Real payoffLimit, const int accrualLag, const Schedule valuationSchedule, const Schedule laggedValuationSchedule, const Date settlementDate)
 
Instrument interface
bool isExpired () const override
 

Additional interface

Position::Type position_
 
Real strike1_
 
Real strike2_
 
Real basketStrike_
 
Real notional1_
 
Real notional2_
 
Real basketNotional_
 
Real cap_
 
Real floor_
 
Real payoffLimit_
 
int accrualLag_
 
Schedule valuationSchedule_
 
Schedule laggedValuationSchedule_
 
Date settlementDate_
 
Real variance1_
 
Real finalVariance1_
 
Real variance2_
 
Real finalVariance2_
 
Real basketVariance_
 
Real finalBasketVariance_
 
Position::Type position () const
 
Real strike1 () const
 
Real strike2 () const
 
Real basketStrike () const
 
Real notional1 () const
 
Real notional2 () const
 
Real basketNotional () const
 
Real cap () const
 
Real floor () const
 
Real payoffLimit () const
 
int accrualLag () const
 
Schedule valuationSchedule () const
 
Schedule laggedValuationSchedule () const
 
Date settlementDate () const
 
Real variance1 () const
 
Real variance2 () const
 
Real basketVariance () const
 
void setupArguments (PricingEngine::arguments *args) const override
 
void fetchResults (const PricingEngine::results *) const override
 
void setupExpired () const override
 

Detailed Description

Pairwise Variance swap.

Definition at line 36 of file pairwisevarianceswap.hpp.

Constructor & Destructor Documentation

◆ PairwiseVarianceSwap()

PairwiseVarianceSwap ( const Position::Type  position,
const Real  strike1,
const Real  strike2,
const Real  basketStrike,
const Real  notional1,
const Real  notional2,
const Real  basketNotional,
const Real  cap,
const Real  floor,
const Real  payoffLimit,
const int  accrualLag,
const Schedule  valuationSchedule,
const Schedule  laggedValuationSchedule,
const Date  settlementDate 
)

Definition at line 25 of file pairwisevarianceswap.cpp.

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 110 of file pairwisevarianceswap.cpp.

110{ return detail::simple_event(settlementDate_).hasOccurred(); }

◆ position()

Position::Type position ( ) const

Definition at line 158 of file pairwisevarianceswap.hpp.

158{ return position_; }

◆ strike1()

Real strike1 ( ) const

Definition at line 160 of file pairwisevarianceswap.hpp.

160{ return strike1_; }

◆ strike2()

Real strike2 ( ) const

Definition at line 162 of file pairwisevarianceswap.hpp.

162{ return strike2_; }

◆ basketStrike()

Real basketStrike ( ) const

Definition at line 164 of file pairwisevarianceswap.hpp.

164{ return basketStrike_; }

◆ notional1()

Real notional1 ( ) const

Definition at line 166 of file pairwisevarianceswap.hpp.

166{ return notional1_; }

◆ notional2()

Real notional2 ( ) const

Definition at line 168 of file pairwisevarianceswap.hpp.

168{ return notional2_; }

◆ basketNotional()

Real basketNotional ( ) const

Definition at line 170 of file pairwisevarianceswap.hpp.

170{ return basketNotional_; }

◆ cap()

Real cap ( ) const

Definition at line 172 of file pairwisevarianceswap.hpp.

172{ return cap_; }

◆ floor()

Real floor ( ) const

Definition at line 174 of file pairwisevarianceswap.hpp.

174{ return floor_; }

◆ payoffLimit()

Real payoffLimit ( ) const

Definition at line 176 of file pairwisevarianceswap.hpp.

176{ return payoffLimit_; }

◆ accrualLag()

int accrualLag ( ) const

Definition at line 178 of file pairwisevarianceswap.hpp.

178{ return accrualLag_; }

◆ valuationSchedule()

Schedule valuationSchedule ( ) const

Definition at line 180 of file pairwisevarianceswap.hpp.

180{ return valuationSchedule_; }

◆ laggedValuationSchedule()

Schedule laggedValuationSchedule ( ) const

Definition at line 182 of file pairwisevarianceswap.hpp.

182{ return laggedValuationSchedule_; }

◆ settlementDate()

Date settlementDate ( ) const

Definition at line 184 of file pairwisevarianceswap.hpp.

184{ return settlementDate_; }

◆ variance1()

Real variance1 ( ) const

Definition at line 34 of file pairwisevarianceswap.cpp.

34 {
35 calculate();
36 QL_REQUIRE(variance1_ != Null<Real>(), "result not available");
37 return variance1_;
38}

◆ variance2()

Real variance2 ( ) const

Definition at line 40 of file pairwisevarianceswap.cpp.

40 {
41 calculate();
42 QL_REQUIRE(variance2_ != Null<Real>(), "result not available");
43 return variance2_;
44}

◆ basketVariance()

Real basketVariance ( ) const

Definition at line 46 of file pairwisevarianceswap.cpp.

46 {
47 calculate();
48 QL_REQUIRE(basketVariance_ != Null<Real>(), "result not available");
49 return basketVariance_;
50}

◆ setupArguments()

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

Definition at line 52 of file pairwisevarianceswap.cpp.

52 {
53 auto* arguments = dynamic_cast<PairwiseVarianceSwap::arguments*>(args);
54 QL_REQUIRE(arguments != nullptr, "wrong argument type");
55
56 arguments->position = position_;
57 arguments->strike1 = strike1_;
58 arguments->strike2 = strike2_;
59 arguments->basketStrike = basketStrike_;
60 arguments->notional1 = notional1_;
61 arguments->notional2 = notional2_;
62 arguments->basketNotional = basketNotional_;
63 arguments->cap = cap_;
64 arguments->floor = floor_;
65 arguments->payoffLimit = payoffLimit_;
66 arguments->accrualLag = accrualLag_;
67 arguments->valuationSchedule = valuationSchedule_;
68 arguments->laggedValuationSchedule = laggedValuationSchedule_;
69 arguments->settlementDate = settlementDate_;
70}

◆ fetchResults()

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

Definition at line 72 of file pairwisevarianceswap.cpp.

72 {
73 Instrument::fetchResults(r);
74 const auto* results = dynamic_cast<const PairwiseVarianceSwap::results*>(r);
75 variance1_ = results->variance1;
76 variance2_ = results->variance2;
77 basketVariance_ = results->basketVariance;
78}

◆ setupExpired()

void setupExpired ( ) const
overrideprotected

Definition at line 112 of file pairwisevarianceswap.cpp.

112 {
113 Instrument::setupExpired();
114 variance1_ = variance2_ = basketVariance_ = Null<Real>();
115}

Member Data Documentation

◆ position_

Position::Type position_
protected

Definition at line 79 of file pairwisevarianceswap.hpp.

◆ strike1_

Real strike1_
protected

Definition at line 80 of file pairwisevarianceswap.hpp.

◆ strike2_

Real strike2_
protected

Definition at line 81 of file pairwisevarianceswap.hpp.

◆ basketStrike_

Real basketStrike_
protected

Definition at line 82 of file pairwisevarianceswap.hpp.

◆ notional1_

Real notional1_
protected

Definition at line 83 of file pairwisevarianceswap.hpp.

◆ notional2_

Real notional2_
protected

Definition at line 84 of file pairwisevarianceswap.hpp.

◆ basketNotional_

Real basketNotional_
protected

Definition at line 85 of file pairwisevarianceswap.hpp.

◆ cap_

Real cap_
protected

Definition at line 86 of file pairwisevarianceswap.hpp.

◆ floor_

Real floor_
protected

Definition at line 87 of file pairwisevarianceswap.hpp.

◆ payoffLimit_

Real payoffLimit_
protected

Definition at line 88 of file pairwisevarianceswap.hpp.

◆ accrualLag_

int accrualLag_
protected

Definition at line 89 of file pairwisevarianceswap.hpp.

◆ valuationSchedule_

Schedule valuationSchedule_
protected

Definition at line 90 of file pairwisevarianceswap.hpp.

◆ laggedValuationSchedule_

Schedule laggedValuationSchedule_
protected

Definition at line 90 of file pairwisevarianceswap.hpp.

◆ settlementDate_

Date settlementDate_
protected

Definition at line 91 of file pairwisevarianceswap.hpp.

◆ variance1_

Real variance1_
mutableprotected

Definition at line 93 of file pairwisevarianceswap.hpp.

◆ finalVariance1_

Real finalVariance1_
mutableprotected

Definition at line 94 of file pairwisevarianceswap.hpp.

◆ variance2_

Real variance2_
mutableprotected

Definition at line 95 of file pairwisevarianceswap.hpp.

◆ finalVariance2_

Real finalVariance2_
mutableprotected

Definition at line 96 of file pairwisevarianceswap.hpp.

◆ basketVariance_

Real basketVariance_
mutableprotected

Definition at line 97 of file pairwisevarianceswap.hpp.

◆ finalBasketVariance_

Real finalBasketVariance_
mutableprotected

Definition at line 98 of file pairwisevarianceswap.hpp.