예제 #1
0
 private Bond MapBond(BondWcf bondWcf)
 {
     return(new FixRateBond()
     {
         Maturity = bondWcf.Maturity, IssueDate = bondWcf.IssueDate.Date, Nominal = bondWcf.Nominal, Periodicity = bondWcf.Periodicity, Rate = bondWcf.Rate
     });
 }
예제 #2
0
        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);
        }
예제 #3
0
        public double Compute(BondWcf bondwcf, DateTime pricerDate)
        {
            var bond = MapBond(bondwcf);

            return(pricer.Compute(bond, pricerDate.Date));
        }