#include "xf_fintech/mc_engine.hpp"
template < typename DT = double, int UN = 16 > void MCAsianArithmeticASEngine ( 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 Strike Engine using Monte Carlo Method Based on Black-Scholes Model. The settlement price of the underlying asset at expiry time is the asset price at expiry time, but the stock price is the arithmetic 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, when reaching the required tolerance, simulation will stop, default 0.02. |
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. |