示例#1
0
        public static Money GetFutureValue(CapFloor capFloor, string baseParty)
        {
            List <Money> 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));
        }
示例#2
0
        public static Money GetFutureValue(Swap swap, string baseParty)
        {
            List <Money> list = new List <Money>();

            foreach (InterestRateStream stream in swap.swapStream)
            {
                Money futureValueOfStream = CashflowsHelper.GetForecastValue(stream.cashflows);

                list.AddRange(GetValue(stream.payerPartyReference.href, stream.receiverPartyReference.href, baseParty, futureValueOfStream));
            }

            Money futureValueOfAdditionalPayments = GetValueOfAdditionalPayments(swap, baseParty);

            list.Add(futureValueOfAdditionalPayments);

            return(MoneyHelper.Sum(list));
        }
示例#3
0
        public static Money GetPayFutureValue(CapFloor capFloor, string baseParty)
        {
            List <Money> 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));
        }
示例#4
0
        public static Money GetPayFutureValue(Swap swap, string baseParty)
        {
            List <Money> list = new List <Money>();

            foreach (InterestRateStream stream in swap.swapStream)
            {
                Money presentValueOfStream = CashflowsHelper.GetForecastValue(stream.cashflows);

                if (baseParty == stream.payerPartyReference.href)
                {
                    list.Add(presentValueOfStream);
                }
            }

            Money payFutureValueOfAdditionalPayments = GetPayFutureValueOfAdditionalPayments(swap, baseParty);

            list.Add(payFutureValueOfAdditionalPayments);

            return(MoneyHelper.Sum(list));
        }
示例#5
0
        /// <summary>
        /// Returns present value of the swap for a specified baseParty.
        /// </summary>
        /// <param name="swap"></param>
        /// <param name="baseParty">The party, from which point of view the valuations are computed.</param>
        /// <returns></returns>
        public static Money GetPresentValue(Swap swap, string baseParty)
        {
            var list = new List <Money>();

            foreach (InterestRateStream stream in swap.swapStream)
            {
                Money presentValueOfStream = CashflowsHelper.GetPresentValue(stream.cashflows);

                list.AddRange(GetValue(stream.payerPartyReference.href, stream.receiverPartyReference.href, baseParty, presentValueOfStream));
            }

            Money sumPVs = MoneyHelper.Sum(list);

            //only add a pv in the same currency.
            Money presentValueOfAdditionalPayments = GetPresentValueOfAdditionalPayments(swap, baseParty, sumPVs.currency);

            sumPVs = MoneyHelper.Add(sumPVs, presentValueOfAdditionalPayments);

            return(sumPVs);
        }