Exemplo n.º 1
0
        Get(ListTermCashflowSet cashFlowSet, int days, decimal nominal)
        {
            ZSpreadSpecificAnnuity annuity = new ZSpreadSpecificAnnuity(cashFlowSet, days);
            var result = Interpolation.Interpolate(annuity.GetPV, 0.01m, 0.09m, nominal);

            return(result);
        }
Exemplo n.º 2
0
        public void AssertInterpolationTest1()
        {
            var flows   = new ListTermCashflowSet(cashFlowSet, Term.MonthlyEffective);
            var zSpread = new ZSpread(flows, 2000000m);
            var result  = zSpread.Spread();
            var annuity = new ZSpreadSpecificAnnuity(flows, 30);
            var check   = annuity.GetPV(0.0132866482605499030537820089M);

            Assert.IsTrue(IsEqualWithinThreshold(result, 0.0132866482605499030537820089M));
            Assert.IsTrue(IsEqualWithinThreshold(check, 2000000m));
        }