MCEuropeanHestonGreeksEngine - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English
#include "xf_fintech/mc_engine.hpp"
template <
    typename DT = double,
    int UN = 1,
    DiscreType discretization = kDTQuadraticExponential
    >
void MCEuropeanHestonGreeksEngine (
    DT underlying,
    DT riskFreeRate,
    DT sigma,
    DT v0,
    DT theta,
    DT kappa,
    DT rho,
    DT dividendYield,
    bool optionType,
    DT strike,
    DT timeLength,
    ap_uint <32> seed [UN][2],
    DT* greeks,
    DT requiredTolerance = 0.02,
    unsigned int requiredSamples = 1024,
    unsigned int timeSteps = 100,
    unsigned int maxSamples = 134217727
    )

European Option Greeks Calculating Engine using Monte Carlo Method based on Heston valuation model.

Parameters:

DT supported data type including double and float, which decides the precision of output, default double-precision data type.
UN number of Monte Carlo Module in parallel, which affects the latency and resources utilization, default 10.
DiscreType methods which is used to discrete the stochastic process. Currently, five discrete types, including kDTPartialTruncation, kDTFullTruncation, kDTReflection, kDTQuadraticExponential and kDTQuadraticExponentialMartingale, are supported, default kDTQuadraticExponential.
underlying the initial price of underlying asset at time 0.
riskFreeRate risk-free interest rate.
sigma the volatility of volatility
v0 initial volatility of stock
theta the long variance, as t tends to infinity, the expected value of vt tends to theta.
kappa the rate at which vt tends to theta.
rho the correlation coefficient between price and variance.
dividendYield the constant dividend rate for continuous dividends.
optionType option type. 1: put option, 0: call option.
strike the strike price also known as exericse price, which is settled in the contract.
timeLength time length from now to expiry date.
seed the seeds used to initialize RNG.
greeks output calculated greeks.
requiredTolerance the tolerance required. If requiredSamples is not set, when reaching the required tolerance, simulation will stop.
requiredSamples the samples number required. When reaching the required number, simulation will stop, default 1024.
timeSteps the number of discrete steps from 0 to T, T is the expiry time, default 100.
maxSamples the maximum sample number. When reaching it, the simulation will stop, default 2,147,483,648.