Quant::Framework::VolSurface
Base class for all volatility surfaces.
The date for which we want to have the volatility surface data
Type of the surface, delta, moneyness or flat.
Contains underlying specific information
Surfaces roll over at 5pm NY time, so the vols of any surfaces recorded after 5pm NY but before GMT midnight are effectively for the next GMT day. This attribute holds this effective date.
Volatility surface in a hash reference.
The symbol of the underlying that this surface is for (e.g. frxUSDJPY)
The date (and time) that the surface was recorded, as a Date::Utility.
The points across a smile.
It can be delta points, moneyness points or any other points that we might have in the future.
This will give an array-reference containing volatility spreads for first tenor which has a volatility spread (or ATM if none).
Get all the terms in a surface in ascending order.
The terms we were originally supplied for this surface.
The original term structure we have for smiles on a surface
The original term structure we have for spreads on a surface
Spread is ask-bid difference which can be stored for different tenor and atm/max. This is value could be adjusted for pricing under certain conditions.
USAGE:
my $spread = $volsurface->get_spread({sought_point=> 'atm', day=> 7}); will return the atm spread for the day. my $spread = $volsurface->get_spread({sought_point=> 'max', day=> 7}); will return the max spread for the day.
Returns the ask/bid spread for smile of this volatility surface This is the raw spread.
my $day = $volsurface->get_day_for_tenor('1W');
Get the corresponding day for a given tenor, if one exists.
Return the rr and bf values for a given smile For more info see: https://en.wikipedia.org/wiki/Risk_reversal and https://en.wikipedia.org/wiki/Butterfly_(options)
Does this volatility surface pass our validation.
Returns the smile on the surface. Returns an empty hash reference if not present.
Returns the volatility point based on the raw volatility surface data. Returns undef if requested smile is not present. Returns the interpolated/raw volatility point across smile if requested smile is present.
my $clone = $s->clone({ surface_data => $surface_data, });
Returns a new Quant::Framework::VolSurface instance. You can pass overrides to override an attribute value as it is on the original surface.
To install Quant::Framework, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Quant::Framework
CPAN shell
perl -MCPAN -e shell install Quant::Framework
For more information on module installation, please visit the detailed CPAN module installation guide.