コード例 #1
0
 /// <summary>
 /// Method constructs QuantLib option price model with necessary estimators of underlying volatility, risk free rate, and underlying dividend yield
 /// </summary>
 /// <param name="pricingEngineFunc">Function modeled stochastic process, and returns new pricing engine to run calculations for that option</param>
 /// <param name="underlyingVolEstimator">The underlying volatility estimator</param>
 /// <param name="riskFreeRateEstimator">The risk free rate estimator</param>
 /// <param name="dividendYieldEstimator">The underlying dividend yield estimator</param>
 public QLOptionPriceModel(PricingEngineFunc pricingEngineFunc, IQLUnderlyingVolatilityEstimator underlyingVolEstimator, IQLRiskFreeRateEstimator riskFreeRateEstimator, IQLDividendYieldEstimator dividendYieldEstimator)
 {
     _pricingEngineFunc      = (option, process) => pricingEngineFunc(process);
     _underlyingVolEstimator = underlyingVolEstimator ?? new ConstantQLUnderlyingVolatilityEstimator();
     _riskFreeRateEstimator  = riskFreeRateEstimator ?? new ConstantQLRiskFreeRateEstimator();
     _dividendYieldEstimator = dividendYieldEstimator ?? new ConstantQLDividendYieldEstimator();
 }
コード例 #2
0
 /// <summary>
 /// Method constructs QuantLib option price model with necessary estimators of underlying volatility, risk free rate, and underlying dividend yield
 /// </summary>
 /// <param name="pricingEngineFunc">Function modeled stochastic process, and returns new pricing engine to run calculations for that option</param>
 /// <param name="underlyingVolEstimator">The underlying volatility estimator</param>
 /// <param name="riskFreeRateEstimator">The risk free rate estimator</param>
 /// <param name="dividendYieldEstimator">The underlying dividend yield estimator</param>
 /// <param name="allowedOptionStyles">List of option styles supported by the pricing model. It defaults to both American and European option styles</param>
 public QLOptionPriceModel(PricingEngineFunc pricingEngineFunc, IQLUnderlyingVolatilityEstimator underlyingVolEstimator, IQLRiskFreeRateEstimator riskFreeRateEstimator, IQLDividendYieldEstimator dividendYieldEstimator, OptionStyle[] allowedOptionStyles = null)
     : this((option, process) => pricingEngineFunc(process), underlyingVolEstimator, riskFreeRateEstimator, dividendYieldEstimator, allowedOptionStyles)
 {
 }