Logo Search packages:      
Sourcecode: quantlib version File versions  Download package

QuantLib::VarianceSwap Class Reference

#include <varianceswap.hpp>

Inheritance diagram for QuantLib::VarianceSwap:

QuantLib::Instrument QuantLib::LazyObject QuantLib::Observable QuantLib::Observer

List of all members.


Detailed Description

Variance swap.

Warning:
This class does not manage seasoned variance swaps.

Definition at line 40 of file varianceswap.hpp.


Public Types

typedef std::vector< std::pair
< boost::shared_ptr
< StrikedTypePayoff >, Real > > 
WeightsType

Public Member Functions

void fetchResults (const PricingEngine::results *) const
void notifyObservers ()
void registerWith (const boost::shared_ptr< Observable > &)
void setupArguments (PricingEngine::arguments *args) const
void unregisterWith (const boost::shared_ptr< Observable > &)
 VarianceSwap (Position::Type position, Real strike, Real notional, const boost::shared_ptr< StochasticProcess > &process, const Date &maturityDate, const boost::shared_ptr< PricingEngine > &engine)
Inspectors
const std::map< std::string,
boost::any > & 
additionalResults () const
 returns all additional result returned by the pricing engine.
Real errorEstimate () const
 returns the error estimate on the NPV when available.
Real NPV () const
 returns the net present value of the instrument.
template<typename T>
result (const std::string &tag) const
 returns any additional result returned by the pricing engine.
Additional interface
Real fairVariance () const
Date maturityDate () const
Real notional () const
std::vector< std::pair< Real,
Real > > 
optionWeights (Option::Type) const
Position::Type position () const
Date settlementDate () const
Real strike () const
Calculations
These methods do not modify the structure of the object and are therefore declared as const. Data members which will be calculated on demand need to be declared as mutable.

void freeze ()
void recalculate ()
void unfreeze ()
Instrument interface
bool isExpired () const
 returns whether the instrument is still tradable.
Modifiers
void setPricingEngine (const boost::shared_ptr< PricingEngine > &)
 set the pricing engine to be used.
Observer interface
void update ()

Protected Member Functions

void performCalculations () const
void setupExpired () const
Calculations
void calculate () const

Protected Attributes

bool calculated_
boost::shared_ptr< PricingEngineengine_
Real fairVariance_
bool frozen_
Date maturityDate_
Real notional_
WeightsType optionWeights_
Position::Type position_
boost::shared_ptr
< GeneralizedBlackScholesProcess
process_
Real strike_
Results
The value of this attribute and any other that derived classes might declare must be set during calculation.

std::map< std::string, boost::any > additionalResults_
Real errorEstimate_
Real NPV_

Classes

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

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index