public static InterestRateStream GetReceiverStream(CapFloor capFloor, string baseParty) { if (capFloor.capFloorStream.receiverPartyReference.href == baseParty) { return(capFloor.capFloorStream); } throw new System.Exception(String.Format("No receiver stream was found for the specified receiver : '{0}'", baseParty)); }
public static Money GetPayFutureValueOfAdditionalPayments(CapFloor capFloor, string baseParty) { var valueList = new List <MoneyBase>(); if (null != capFloor.additionalPayment) { valueList.AddRange((from payment in capFloor.additionalPayment where baseParty == payment.payerPartyReference.href select payment.paymentAmount)); } return(MoneyHelper.Sum(valueList)); }
public static Money GetFutureValue(CapFloor capFloor, string baseParty) { var list = new List <Money>(); InterestRateStream stream = capFloor.capFloorStream; Money futureValueOfStream = CashflowsHelper.GetForecastValue(stream.cashflows); list.AddRange(GetValue(stream.payerPartyReference.href, stream.receiverPartyReference.href, baseParty, futureValueOfStream)); Money futureValueOfAdditionalPayments = GetValueOfAdditionalPayments(capFloor, baseParty); list.Add(futureValueOfAdditionalPayments); return(MoneyHelper.Sum(list)); }
public static Money GetPresentValueOfAdditionalPayments(CapFloor capFloor, string baseParty) { var list = new List <Money>(); if (null != capFloor.additionalPayment) { foreach (Payment payment in capFloor.additionalPayment) { list.AddRange(GetValue(payment.payerPartyReference.href, payment.receiverPartyReference.href, baseParty, payment.presentValueAmount)); } } return(MoneyHelper.Sum(list)); }
public static Money GetPayFutureValue(CapFloor capFloor, string baseParty) { var list = new List <Money>(); InterestRateStream stream = capFloor.capFloorStream; { Money presentValueOfStream = CashflowsHelper.GetForecastValue(stream.cashflows); if (baseParty == stream.payerPartyReference.href) { list.Add(presentValueOfStream); } } Money payFutureValueOfAdditionalPayments = GetPayFutureValueOfAdditionalPayments(capFloor, baseParty); list.Add(payFutureValueOfAdditionalPayments); return(MoneyHelper.Sum(list)); }
public static void TradeSetCapFloor(Trade trade, CapFloor capFloor) { trade.Item = capFloor; //trade.ItemElementName = ItemChoiceType15.capFloor; }