Example #1
0
        public void TestBondCleanPriceAndPV()
        {
            bondPricerYield.Calculate();
            Assert.AreEqual(0.084295197233745636d, bondPricerYield.YieldToMaturity, Mathematics.Error, "Test calculation of Bond Yield to Maturity");

            bondPricerClean.Calculate();
            Assert.AreEqual(0.97d, bondPricerClean.Clean, Mathematics.Error, "Test calculation of Bond Clean Price");

            Assert.AreEqual(bondPricerClean.PV, bondPricerYield.PV, Mathematics.Error, "Test bonds' PV values match");
        }
Example #2
0
        static void Main()
        {
            var cashflowPricer = new CashflowPricer();

            cashflowPricer.Calculate();
            Console.WriteLine(cashflowPricer);

            var bondPricer = new BondPricer();

            bondPricer.Calculate();
            Console.WriteLine(bondPricer);

            var yieldCurve = new YieldCurve();

            yieldCurve.BootstrapSpotYields();
            Console.WriteLine(yieldCurve);

            var depositCertificate = new CertificateDeposit();

            depositCertificate.Calculate();
            Console.WriteLine(depositCertificate);

            var discountPaper = new DiscountPaper();

            discountPaper.Calculate();
            Console.WriteLine(discountPaper);

            var fixedDeposit = new FixedDeposit();

            fixedDeposit.Calculate();
            Console.WriteLine(fixedDeposit);

            var fxQuote = new FXQuote();

            Console.WriteLine(fxQuote);

            Console.ReadKey();
        }