public EquityOptionHedgingVM(StochasticEngine stochasticEngine) { StochasticEngine = stochasticEngine; PlotStockPrice = new PlotModel(); PlotModelDaily = new PlotModel(); PlotModelCumulative = new PlotModel(); }
private SortedList <DateTime, OptionPricingData> GenerateOptionPricingData(DateTime startDate, DateTime expiryDate, GbmParameters gbmParams, OptionPricingData basicPricingData, int?seed) { int days = startDate.GetWorkingDaysTo(expiryDate); var stockPrices = StochasticEngine.GetGeometricBrownianSeries(gbmParams, 1.0 / TimePeriods.BusinessDaysInYear, days, seed); var pricingData = new SortedList <DateTime, OptionPricingData>(); var date = startDate; if (!date.IsWorkingDay()) { date = date.AddWorkingDay(); } foreach (double price in stockPrices) { pricingData.Add(date, new OptionPricingData(price, basicPricingData.Vol, basicPricingData.InterestRate, basicPricingData.DivYield)); date = date.AddWorkingDay(); } return(pricingData); }