Leisen-Reimer二叉树期权定价算法和CRR二叉树算法大同小异,主要是在每个节点的涨跌幅度和涨跌概率上有变化,加快收敛速度。MATLAB中就提供了这种算法的函数
public class BinomialLR
{
//S:标的资产现价
//X:执行价
//r:无风险利率
//q:连续分红率,Cost of Carry = r-q
//sigma:波动率
//t:距离到期时间
//steps:二叉树步数
//PutCall:Call/Put
//OptionType:European/American
public enum EOptionType
{
European,
American,
}
public EOptionType OptionType
{
get;
set;
}
public enum EPutCall
{
Call,
Put,
}
public EPutCall PutCall
{
get;
set;
}
public double GetOptionValue(double S, double X, double r, double q, double sigma,
double t, int steps, EPutCall PutCall, EOptionType OptionType)
{
double timeStep = t/steps;
double t_sqrt = Math.Sqrt(t);
double sigma2 = sigma*sigma;
double d1 = (