示例#1
0
        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;
            }
        }
示例#2
0
 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);
 }
示例#3
0
文件: Equity.cs 项目: joelhoro/JHLib
 public EquityModel(Equity equity,IEnumerable<Date> diffusiondates, int N)
 {
     this.equity = equity;
     this.diffusiondates = diffusiondates.ToList();
     this.N = N;
 }