17 using MathNet.Numerics.Distributions;
41 : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)
56 : this($
"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRateModel,
57 dividendYieldModel, mirrorOption, optionModel, ivModel)
71 public Rho(
string name,
Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel,
Symbol mirrorOption =
null,
73 : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)
86 public Rho(
Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel,
Symbol mirrorOption =
null,
88 : this($
"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRateModel,
89 dividendYieldModel, mirrorOption, optionModel, ivModel)
105 : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)
120 : this($
"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRateModel,
121 dividendYield, mirrorOption, optionModel, ivModel)
135 public Rho(
string name,
Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m,
Symbol mirrorOption =
null,
137 : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)
150 public Rho(
Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m,
Symbol mirrorOption =
null,
152 : this($
"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRateModel,
153 dividendYield, mirrorOption, optionModel, ivModel)
167 public Rho(
string name,
Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m,
Symbol mirrorOption =
null,
169 : base(name, option, riskFreeRate, dividendYield, mirrorOption, optionModel, ivModel)
182 public Rho(
Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m,
Symbol mirrorOption =
null,
184 : this($
"Rho({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRate, dividendYield,
185 mirrorOption, optionModel, ivModel)
195 var strike = (
double)
Strike;
196 var timeTillExpiryDouble = (double)timeTillExpiry;
208 var deltaRho = 0.0001;
223 result = (newPrice - price) / deltaRho / 100d;
228 var norm =
new Normal();
231 var discount = Math.Exp(-riskFreeRate * timeTillExpiryDouble);
235 result = strike * timeTillExpiryDouble * discount * norm.CumulativeDistribution(d2) / 100d;
239 result = -strike * timeTillExpiryDouble * discount * norm.CumulativeDistribution(-d2) / 100d;
244 return Convert.ToDecimal(result);