#include "xf_fintech/mc_engine.hpp"
template < typename DT = double, int ASSETS = 5, int UN = 1, DiscreType discretization = kDTQuadraticExponential > void MCMultiAssetEuropeanHestonEngine ( DT underlying [ASSETS], DT riskFreeRate, DT sigma [ASSETS], DT v0 [ASSETS], DT theta [ASSETS], DT kappa [ASSETS], DT corrMatrix [ASSETS *2+1][ASSETS], DT rho [ASSETS], DT dividendYield [ASSETS], bool optionType, DT strike, DT timeLength, ap_uint <32> seed [UN][2], DT* outputs, DT requiredTolerance = 0.02, ap_uint <32> requiredSamples = 0, ap_uint <32> timeSteps = 100, ap_uint <32> maxSamples = 134217727 )
Multiple Asset European Option Pricing 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. |
ASSETS | number of underlying assets supported. |
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. |
corrMatrix | the LU decomposition result of correlation matrix of all stochastic variables, only none-zero elements are stored. |
rho | the correlation coefficient between price and variance. |
dividendYield | the constant dividend rate for continuous dividends. |
optionType | option type. 1: call option, 0: put 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. |
outputs | pricing result array of this engine. |
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. |