class xf::fintech::FDHeston

#include "xf_fintech_fd_heston.hpp"

Overview

This class implements the Finite Difference Heston Model.

It is intended that the user will populate the asset data when calling the run() method. A number of overriden methods have been provided that allow configuration of the number of steps and return of the Greeks.

class FDHeston: public xf::fintech::OCLController

Inherited Members


Methods

run

run overload (1)

int run (
    double stockPrice,
    double strikePrice,
    double riskFreeRateDomestic,
    double volatility,
    double timeToMaturity,
    double meanReversionRate,
    double volatilityOfVolatility,
    double correlationCoefficient,
    double longRunAveragePrice,
    double* pOptionPrice
    )

Calculate a single option price with default number of steps.

Parameters:

stockPrice the stock price
strikePrice the strike price
riskFreeRateDomestic the risk free domestic interest rate
volatility the volatility
timeToMaturity the time to maturity
meanReversionRate the mean reversion rate (kappa)
volatilityOfVolatility the volatility of volatility (sigma)
correlationCoefficient the correlation coefficient (rho)
longRunAveragePrice the returned option price (eta)
pOptionPrice the returned option price

run overload (2)

int run (
    double stockPrice,
    double strikePrice,
    double riskFreeRateDomestic,
    double volatility,
    double timeToMaturity,
    double meanReversionRate,
    double volatilityOfVolatility,
    double correlationCoefficient,
    double longRunAveragePrice,
    int numSteps,
    double* pOptionPrice
    )

Calculate a single option price with a configurable number of steps.

Parameters:

stockPrice the stock price
strikePrice the strike price
riskFreeRateDomestic the risk free domestic interest rate
volatility the volatility
timeToMaturity the time to maturity
meanReversionRate the mean reversion rate (kappa)
volatilityOfVolatility the volatility of volatility (sigma)
correlationCoefficient the correlation coefficient (rho)
longRunAveragePrice the returned option price (eta)
numSteps the number of steps
pOptionPrice the returned option price

run overload (3)

int run (
    double stockPrice,
    double strikePrice,
    double riskFreeRateDomestic,
    double volatility,
    double timeToMaturity,
    double meanReversionRate,
    double volatilityOfVolatility,
    double correlationCoefficient,
    double longRunAveragePrice,
    double* pOptionPrice,
    double* pDelta,
    double* pVega,
    double* pGamma,
    double* pVolga,
    double* pVanna
    )

Calculate a single option price with a default number of steps and return the greeks.

Parameters:

stockPrice the stock price
strikePrice the strike price
riskFreeRateDomestic the risk free domestic interest rate
volatility the volatility
timeToMaturity the time to maturity
meanReversionRate the mean reversion rate (kappa)
volatilityOfVolatility the volatility of volatility (sigma)
correlationCoefficient the correlation coefficient (rho)
longRunAveragePrice the returned option price (eta)
pOptionPrice the returned option price
pDelta the returned greek Delta
pVega the returned greek Vega
pGamma the returned greek Gamma
pVolga the returned greek Volga
pVanna the returned greek Vanna

run overload (4)

int run (
    double stockPrice,
    double strikePrice,
    double riskFreeRateDomestic,
    double volatility,
    double timeToMaturity,
    double meanReversionRate,
    double volatilityOfVolatility,
    double correlationCoefficient,
    double longRunAveragePrice,
    int numSteps,
    double* pOptionPrice,
    double* pDelta,
    double* pVega,
    double* pGamma,
    double* pVolga,
    double* pVanna
    )

Calculate a single option price with a configurable number of steps and return the greeks.

Parameters:

stockPrice the stock price
strikePrice the strike price
riskFreeRateDomestic the risk free domestic interest rate
volatility the volatility
timeToMaturity the time to maturity
meanReversionRate the mean reversion rate (kappa)
volatilityOfVolatility the volatility of volatility (sigma)
correlationCoefficient the correlation coefficient (rho)
longRunAveragePrice the returned option price (eta)
numSteps the number of steps
pOptionPrice the returned option price
pDelta the returned greek Delta
pVega the returned greek Vega
pGamma the returned greek Gamma
pVolga the returned greek Volga
pVanna the returned greek Vanna

getLastRunTime

long long int getLastRunTime (void)

This method returns the time the execution of the last call to run() took.