#include "xf_fintech/mc_engine.hpp"
template < typename DT = double, int UN = 16 > void MCAsianGeometricAPEngine ( DT underlying, DT volatility, DT dividendYield, DT riskFreeRate, DT timeLength, DT strike, bool optionType, ap_uint <32>* seed, DT* output, DT requiredTolerance = 0.02, unsigned int requiredSamples = 1024, unsigned int timeSteps = 100, unsigned int maxSamples = 134217727 )
Asian Arithmetic Average Price Engine using Monte Carlo Method Based on Black-Scholes Model. The settlement price of the underlying asset at expiry time is the geomertic average of asset price during the option lifetime.
Parameters:
DT | Supported data type including double and float, which decides the precision of output. |
UN | The number of Monte Carlo Module in parallel, which affects the latency and resources utilization. |
underlying | The initial price of underlying asset. |
volatility | The market’s price volatility. |
dividendYield | The dividend yield is the company’s total annual dividend payments divided by its market capitalization, or the dividend per share, divided by the price per share. |
riskFreeRate | The risk-free interest rate is the rate of return of a hypothetical investment with no risk of financial loss, over a given period of time. |
timeLength | The given period of time. |
strike | The strike price also known as exericse price, which is settled in the contract. |
optionType | Option type. 1: put option, 0: call option. |
seed | array of seed to initialize RNG. |
output | Output array. |
requiredTolerance | The tolerance required. If requiredSamples is not set, simulation will not stop, unless the requiredTolerance is reached, default 0.02. |
requiredSamples | The samples number required. When reaching the required number, simulation will stop, default 1024. |
timeSteps | Number of interval, default 100. |
maxSamples | The maximum sample number. When reaching it, the simulation will stop, default 2147483648. |