public ActionResult <decimal> ZSpread(PlainListTermCashFlowSet cashFlowSet) { var cashFlowList = new ListTermCashflowSet(cashFlowSet.cashflowSet, cashFlowSet.termType); var res = new ZSpread(cashFlowList, cashFlowSet.nominal); var result = res.CalculateZspread(); return(result); }
public void AssertInterpolationTest1() { var flows = new ListTermCashflowSet(cashFlowSet, Term.MonthlyEffective); var zSpread = new ZSpread(flows, 2000000m); var result = zSpread.Spread(); var annuity = new Annuity(flows, 30); var check = annuity.GetZSpreadPV(0.0132866482605499030537820089M); Assert.IsTrue(IsEqualWithinThreshold(result, 0.0132866482605499030537820089M)); Assert.IsTrue(IsEqualWithinThreshold(check, 2000000m)); }