private Bond MapBond(BondWcf bondWcf) { return(new FixRateBond() { Maturity = bondWcf.Maturity, IssueDate = bondWcf.IssueDate.Date, Nominal = bondWcf.Nominal, Periodicity = bondWcf.Periodicity, Rate = bondWcf.Rate }); }
public Dictionary <DateTime, double> ComputeToBondLastDate(BondWcf bondwcf) { Dictionary <DateTime, double> prices = new Dictionary <DateTime, double>(); DateTime date = DateTime.Parse("01/01/1993"); var bond = MapBond(bondwcf); while (date <= bond.GetLastDate()) { prices.Add(date, pricer.Compute(bond, date)); date = date.AddDays(1); } return(prices); }
public double Compute(BondWcf bondwcf, DateTime pricerDate) { var bond = MapBond(bondwcf); return(pricer.Compute(bond, pricerDate.Date)); }