ZSpreadPresentValue(ListTermCashflowSet cashFlowSet, int days, decimal nominal) { Annuity annuity = new Annuity(cashFlowSet, days); var result = Interpolation.Interpolate(annuity.GetZSpreadPV, 0.01m, 0.09m, nominal); return(result); }
AnnuityPresentValue(PlainListTermCashFlowSet cashFlowSet, int days, decimal nominal) { var cashFlowList = new ListTermCashflowSet(cashFlowSet.cashflowSet, cashFlowSet.termType); Annuity annuity = new Annuity(cashFlowList, days); var result = annuity.GetPV(); 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)); }
private void addAnnuityButton_Click(object sender, RoutedEventArgs e) { var annuity = new Annuity() { Year = addAnnuitiyYearIntUpDown.Value.ToString(), Amount = decimal.Parse(addAnnuityAmountTextBox.Text) }; this.plot.Annuities.Add(annuity); addAnnuitiyYearIntUpDown.Value--; addAnnuityAmountTextBox.Clear(); }
private void addAnnuityButton_Click(object sender, RoutedEventArgs e) { var annuity = new Annuity() { Year = addAnnuitiyYearIntUpDown.Value.ToString(), Amount = decimal.Parse(addAnnuityAmountTextBox.Text) }; this.plot.Annuities.Add(annuity); addAnnuitiyYearIntUpDown.Value--; addAnnuityAmountTextBox.Clear(); }
public void buyAnnuity() { // Method + _ + scenario + _ + expected behavior (naming convention) //Arrange double beginningBal = 1000.00; Annuity ann = new Annuity(); //Act ann.Buy(beginningBal); double actualBal = ann.GetShares; // assert Assert.AreEqual(actualBal, 1000.00); }
public void EarnAnnuity() { double beginningBal = 800.00; double transactionAmount = 20.00; //Arrange Annuity ann = new Annuity(); //Act ann.Buy(beginningBal); ann.Earn(transactionAmount); double actualBal = ann.GetShares; // assert Assert.AreEqual(actualBal, 820.00); }
public void showPortfolio() { //Arrange double stocksBal = 5500.00; double bondsBal = 3450.00; double annuityBal = 820.00; Annuity ann = new Annuity(); Stocks sto = new Stocks(); Bonds bond = new Bonds(); //Act ann.Buy(annuityBal); sto.Buy(stocksBal); bond.Buy(bondsBal); double actualBal = ann.GetShares + sto.GetShares + bond.GetShares; // assert Assert.AreEqual(actualBal, 9770.00); }
public AnnuityEquations(Annuity annuity1, Annuity annuity2) { this.annuity1 = annuity1; this.annuity2 = annuity2; }