17 using MathNet.Numerics.Distributions;
41 : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)
56 : this($
"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRateModel,
57 dividendYieldModel, mirrorOption, optionModel, ivModel)
71 public Theta(
string name,
Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel,
Symbol mirrorOption =
null,
73 : base(name, option, riskFreeRateModel, dividendYieldModel, mirrorOption, optionModel, ivModel)
86 public Theta(
Symbol option, PyObject riskFreeRateModel, PyObject dividendYieldModel,
Symbol mirrorOption =
null,
88 : this($
"Theta({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($
"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRateModel,
121 dividendYield, mirrorOption, optionModel, ivModel)
135 public Theta(
string name,
Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m,
Symbol mirrorOption =
null,
137 : base(name, option, riskFreeRateModel, dividendYield, mirrorOption, optionModel, ivModel)
150 public Theta(
Symbol option, PyObject riskFreeRateModel, decimal dividendYield = 0.0m,
Symbol mirrorOption =
null,
152 : this($
"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRateModel,
153 dividendYield, mirrorOption, optionModel, ivModel)
167 public Theta(
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 Theta(
Symbol option, decimal riskFreeRate = 0.05m, decimal dividendYield = 0.0m,
Symbol mirrorOption =
null,
184 : this($
"Theta({option},{mirrorOption},{GetOptionModel(optionModel, option.ID.OptionStyle)})", option, riskFreeRate, dividendYield,
185 mirrorOption, optionModel, ivModel)
195 var strike = (
double)
Strike;
196 var timeTillExpiryDouble = (double)timeTillExpiry;
209 var forwardPrice = 0d;
222 result = (forwardPrice - price) * 0.5 / deltaTime / 365d;
227 var norm =
new Normal();
230 var discount = Math.Exp(-riskFreeRate * timeTillExpiryDouble);
231 var adjustment = Math.Exp(-dividendYield * timeTillExpiryDouble);
234 var theta = -underlyingPrice * Math.Max(iv, 0.01) * norm.Density(d1) * adjustment * 0.5 / Math.Sqrt(timeTillExpiryDouble);
238 d1 = norm.CumulativeDistribution(d1);
239 d2 = -norm.CumulativeDistribution(d2);
243 d1 = -norm.CumulativeDistribution(-d1);
244 d2 = norm.CumulativeDistribution(-d2);
247 theta += dividendYield * underlyingPrice * d1 * adjustment + riskFreeRate * strike * discount * d2;
248 result = theta / 365;
252 return Convert.ToDecimal(result);