Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

BlackScholes Class Reference

#include <BlackScholes.h>

List of all members.

Public Member Functions

 BlackScholes (Real spot, Real volOrPrice, bool isVol, Real r, Real K, Real T, TypeOptionBS typeOption)
 Default constructor.

 BlackScholes ()
virtual ~BlackScholes ()
Real getPrice ()
 Return price of the option.

Real getDelta ()
 Return the Delta value for the option.

Real getGamma ()
 Return the Gamma value for the option.

Real getVega ()
 Return the Vega value for the option.

Real getTheta ()
 Return the Theta value for the option.

Real getRho ()
 Return the Rho value for the option.

Real getVolatility () const
 Return the Volatility for the option.

Real getStrike () const
 Return the strike of the option.

Real getRate () const
 Return the risk free rate at maturity of the option.

Real getSpot () const
 Return the spot of the option.

Real getMaturity () const
 Return the maturity of the option.

bool isCall () const
 Return the type of the option.


Protected Member Functions

void changeRate (Real newRate)
void changeVol (Real newVol)
void changeMaturity (Real newMat)
void changeSpot (Real newSpot)
void changeStrike (Real newVol)

Protected Attributes

friend OptionStrategy
 Allow to change rate for testing sensibility.


Private Member Functions

void recalcInformation ()

Private Attributes

Real _spot
Real _vol
Real _r
Real _K
Real _T
Real d1
Real d2
Real _price
TypeOptionBS _type


Constructor & Destructor Documentation

BlackScholes::BlackScholes Real  spot,
Real  volOrPrice,
bool  isVol,
Real  r,
Real  K,
Real  T,
TypeOptionBS  typeOption
 

Default constructor.

Parameters:
spot: Spot price of the asset
volOrPrice: Parameter given : either vol or price, the other will be computed
isVol: Bool allowing the constructor to know if the col or the price has been given
r: Spot Rate until maturity of option
K: Strike of the option
T: Maturity of the option
typeOption: Type of the option (Call or Put)

Definition at line 10 of file BlackScholes.cpp.

References _K, _price, _r, _spot, _T, _type, _vol, absolute(), BlackScholes(), d1, d2, getPrice(), getVega(), r, and Real.

BlackScholes::BlackScholes  ) 
 

Definition at line 43 of file BlackScholes.cpp.

Referenced by BlackScholes().

BlackScholes::~BlackScholes  )  [virtual]
 

Definition at line 46 of file BlackScholes.cpp.


Member Function Documentation

void BlackScholes::changeMaturity Real  newMat  )  [protected]
 

Definition at line 154 of file BlackScholes.cpp.

References _T, Real, and recalcInformation().

Referenced by OptionStrategy::changeMaturity().

void BlackScholes::changeRate Real  newRate  )  [protected]
 

Definition at line 144 of file BlackScholes.cpp.

References _r, Real, and recalcInformation().

Referenced by OptionStrategy::changeRate().

void BlackScholes::changeSpot Real  newSpot  )  [protected]
 

Definition at line 159 of file BlackScholes.cpp.

References _spot, Real, and recalcInformation().

Referenced by OptionStrategy::changeSpot().

void BlackScholes::changeStrike Real  newVol  )  [protected]
 

Definition at line 164 of file BlackScholes.cpp.

References _K, Real, and recalcInformation().

Referenced by OptionStrategy::changeStrike().

void BlackScholes::changeVol Real  newVol  )  [protected]
 

Definition at line 149 of file BlackScholes.cpp.

References _vol, Real, and recalcInformation().

Referenced by OptionStrategy::changeVol().

Real BlackScholes::getDelta  ) 
 

Return the Delta value for the option.

Definition at line 50 of file BlackScholes.cpp.

References _type, Call, CumulativeNormal(), d1, Put, and Real.

Referenced by inputBSOption(), and mainoption().

Real BlackScholes::getGamma  ) 
 

Return the Gamma value for the option.

Definition at line 68 of file BlackScholes.cpp.

References _spot, _T, _vol, d1, NormalDensity(), and Real.

Referenced by inputBSOption(), and mainoption().

Real BlackScholes::getMaturity  )  const
 

Return the maturity of the option.

Definition at line 136 of file BlackScholes.cpp.

References _T, and Real.

Referenced by OptionStrategy::changeMaturity(), and operator<<().

Real BlackScholes::getPrice  )  [inline]
 

Return price of the option.

Definition at line 72 of file BlackScholes.h.

References _K, _price, _r, _spot, _T, _type, Call, CumulativeNormal(), d1, d2, Put, and Real.

Referenced by BlackScholes(), VarianceSwap::getPrice(), inputBSOption(), mainbinomialtree(), mainoption(), RainbowOption::PriceByClosedForm_MinOf2_call(), RainbowOption::PriceByClosedForm_MinOf2_put(), and RainbowOption::PriceByClosedForm_WorseOf2().

Real BlackScholes::getRate  )  const
 

Return the risk free rate at maturity of the option.

Definition at line 128 of file BlackScholes.cpp.

References _r, and Real.

Referenced by OptionStrategy::changeRate(), and operator<<().

Real BlackScholes::getRho  ) 
 

Return the Rho value for the option.

Definition at line 102 of file BlackScholes.cpp.

References _K, _r, _T, _type, Call, CumulativeNormal(), d2, Put, and Real.

Referenced by inputBSOption(), and mainoption().

Real BlackScholes::getSpot  )  const
 

Return the spot of the option.

Definition at line 132 of file BlackScholes.cpp.

References _spot, and Real.

Referenced by OptionStrategy::changeSpot(), and operator<<().

Real BlackScholes::getStrike  )  const
 

Return the strike of the option.

Definition at line 124 of file BlackScholes.cpp.

References _K, and Real.

Referenced by OptionStrategy::changeStrike(), VarianceSwap::getPrice(), and operator<<().

Real BlackScholes::getTheta  ) 
 

Return the Theta value for the option.

Definition at line 84 of file BlackScholes.cpp.

References _K, _r, _spot, _T, _type, _vol, Call, CumulativeNormal(), d1, d2, NormalDensity(), Put, and Real.

Referenced by inputBSOption(), and mainoption().

Real BlackScholes::getVega  ) 
 

Return the Vega value for the option.

Definition at line 72 of file BlackScholes.cpp.

References _spot, _T, d1, NormalDensity(), and Real.

Referenced by BlackScholes(), inputBSOption(), and mainoption().

Real BlackScholes::getVolatility  )  const
 

Return the Volatility for the option.

Definition at line 120 of file BlackScholes.cpp.

References _vol, and Real.

Referenced by OptionStrategy::changeVol(), volsurface::invertBSformula(), mainoption(), and operator<<().

bool BlackScholes::isCall  )  const
 

Return the type of the option.

Definition at line 140 of file BlackScholes.cpp.

References _type, and Call.

Referenced by VarianceSwap::getPrice(), and operator<<().

void BlackScholes::recalcInformation  )  [private]
 

Definition at line 169 of file BlackScholes.cpp.

References _K, _r, _spot, _T, _vol, d1, and d2.

Referenced by changeMaturity(), changeRate(), changeSpot(), changeStrike(), and changeVol().


Member Data Documentation

Real BlackScholes::_K [private]
 

Definition at line 66 of file BlackScholes.h.

Referenced by BlackScholes(), changeStrike(), getPrice(), getRho(), getStrike(), getTheta(), and recalcInformation().

Real BlackScholes::_price [private]
 

Definition at line 68 of file BlackScholes.h.

Referenced by BlackScholes(), and getPrice().

Real BlackScholes::_r [private]
 

Definition at line 66 of file BlackScholes.h.

Referenced by BlackScholes(), changeRate(), getPrice(), getRate(), getRho(), getTheta(), and recalcInformation().

Real BlackScholes::_spot [private]
 

Definition at line 66 of file BlackScholes.h.

Referenced by BlackScholes(), changeSpot(), getGamma(), getPrice(), getSpot(), getTheta(), getVega(), and recalcInformation().

Real BlackScholes::_T [private]
 

Definition at line 66 of file BlackScholes.h.

Referenced by BlackScholes(), changeMaturity(), getGamma(), getMaturity(), getPrice(), getRho(), getTheta(), getVega(), and recalcInformation().

TypeOptionBS BlackScholes::_type [private]
 

Definition at line 69 of file BlackScholes.h.

Referenced by BlackScholes(), getDelta(), getPrice(), getRho(), getTheta(), and isCall().

Real BlackScholes::_vol [private]
 

Definition at line 66 of file BlackScholes.h.

Referenced by BlackScholes(), changeVol(), getGamma(), getTheta(), getVolatility(), and recalcInformation().

Real BlackScholes::d1 [private]
 

Definition at line 67 of file BlackScholes.h.

Referenced by BlackScholes(), getDelta(), getGamma(), getPrice(), getTheta(), getVega(), and recalcInformation().

Real BlackScholes::d2 [private]
 

Definition at line 67 of file BlackScholes.h.

Referenced by BlackScholes(), getPrice(), getRho(), getTheta(), and recalcInformation().

friend BlackScholes::OptionStrategy [protected]
 

Allow to change rate for testing sensibility.

Definition at line 57 of file BlackScholes.h.


The documentation for this class was generated from the following files:
Note: Generated nightly - reload for latest version
Generated on Thu Dec 22 23:12:38 2005 for terreneuve by doxygen 1.3.6