Class implements flat volatility. More...

#include <flatVolatility.hpp>

Inheritance diagram for julian::FlatVolatility:
julian::Volatility

Public Member Functions

 FlatVolatility (Date date, double volatility, SmartPointer< YearFraction > yf)
 constructor More...
 
double getVolatility (double K, Date T) const override
 Returns volatility. The same value is returned regardless of the given arguments. More...
 
double getVolatility (double K, double T) const override
 Returns volatility. The same value is returned regardless of the given arguments. More...
 
double getVariance (double K, Date T) const override
 Returns annualize variance. More...
 
double getVariance (double K, double T) const override
 Returns annualize variance. More...
 
Date getDate () const override
 Returns the date for which curve was defined. More...
 
void bumpVolatility (double) override
 Shifts volatility by bump size provided. More...
 
double getYearFraction (Date, Date) const override
 Calculates year fraction. More...
 
FlatVolatilityclone () const override
 Virtual copy constructor. More...
 
std::string info () const override
 Returns type of volatility surface. More...
 
- Public Member Functions inherited from julian::Volatility
 Volatility ()
 default constructor More...
 
virtual ~Volatility ()
 destructor More...
 

Private Attributes

Date date_
 represent the date on which the curve is valid More...
 
double volatility_
 volatility level More...
 
SmartPointer< YearFractionyf_
 Year fraction convention. More...
 

Friends

std::ostream & operator<< (std::ostream &, FlatVolatility &)
 Overloads stream operator. More...
 

Detailed Description

Class implements flat volatility.

Flat volatility surface is a volatility with no tenor- nor strike- dependencies. It returns the same volatility level for every strike or tenor.

Examples:
optionPricingExample.cpp.

Constructor & Destructor Documentation

julian::FlatVolatility::FlatVolatility ( Date  date,
double  volatility,
SmartPointer< YearFraction yf 
)
inline

constructor

Member Function Documentation

void julian::FlatVolatility::bumpVolatility ( double  input)
overridevirtual

Shifts volatility by bump size provided.

Parameters
inputbump size

Implements julian::Volatility.

FlatVolatility * julian::FlatVolatility::clone ( ) const
overridevirtual

Virtual copy constructor.

Implements julian::Volatility.

Date julian::FlatVolatility::getDate ( ) const
overridevirtual

Returns the date for which curve was defined.

Implements julian::Volatility.

double julian::FlatVolatility::getVariance ( double  K,
Date  T 
) const
overridevirtual

Returns annualize variance.

\[variance = yearFraction(today, T) \times volatility^{2}\]

Implements julian::Volatility.

double julian::FlatVolatility::getVariance ( double  K,
double  T 
) const
overridevirtual

Returns annualize variance.

\[variance = T *\times volatility^{2}\]

Implements julian::Volatility.

double julian::FlatVolatility::getVolatility ( double  K,
Date  T 
) const
overridevirtual

Returns volatility. The same value is returned regardless of the given arguments.

Implements julian::Volatility.

double julian::FlatVolatility::getVolatility ( double  K,
double  T 
) const
overridevirtual

Returns volatility. The same value is returned regardless of the given arguments.

Implements julian::Volatility.

double julian::FlatVolatility::getYearFraction ( Date  d1,
Date  d2 
) const
overridevirtual

Calculates year fraction.

This methods calculates the year fraction between two dates. The year fraction convention is defined during the construction of interest rate object.

Implements julian::Volatility.

std::string julian::FlatVolatility::info ( ) const
overridevirtual

Returns type of volatility surface.

Implements julian::Volatility.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
FlatVolatility v 
)
friend

Overloads stream operator.

This overloaded operator enables to print the curve on the console.

Member Data Documentation

Date julian::FlatVolatility::date_
private

represent the date on which the curve is valid

double julian::FlatVolatility::volatility_
private

volatility level

SmartPointer<YearFraction> julian::FlatVolatility::yf_
private

Year fraction convention.


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/marketData/volatility/flatVolatility.hpp
  • C:/Unix/home/OEM/jULIAN/src/marketData/volatility/flatVolatility.cpp