public void IncreasingVariance() { var equity = new Equity(100, 0.2); Context.Initialize(); Date today = Context.TODAY; double previousVariance = 0; Trace.WriteLine("Testing trace"); for (Date date = today; date < today + new Frequency(3650); date = date + new Frequency(30) ) { double newVariance = equity.Variance(date); Assert.IsTrue(newVariance >= previousVariance); Console.WriteLine("{0,10}: {1:F4}", date, newVariance); previousVariance = newVariance; } }
public static double Price(OptionType optionType, Equity equity, double K, double T, double r, PriceType priceType = PriceType.Price) { var impliedVol = equity.sigma; return Price(optionType, equity.spot, K, T, r, impliedVol, priceType); }
public EquityModel(Equity equity,IEnumerable<Date> diffusiondates, int N) { this.equity = equity; this.diffusiondates = diffusiondates.ToList(); this.N = N; }