Exemplo n.º 1
0
        /// <summary>
        /// Calculates the NPV for a series of cashflows
        /// </summary>
        /// <param name="request"></param>
        /// <param name="useXnpvFormula"></param>
        /// <returns></returns>
        public NpvResponse CalculateNpvForNpvRequest(NpvRequest request, bool useXnpvFormula)
        {
            var response = new NpvResponse();

            for (double rate = request.LowerRate; rate <= request.UpperRate; rate+= request.Increment)
            {
                var npv = CalculateNpv(request.InitialInvestment, request.Cashflows, rate, request.RollType, useXnpvFormula);
                response.NetPresentValues.Add(new Npv{ Rate = rate, Value = npv});
            }

            return response;
        }
Exemplo n.º 2
0
 public NpvResponse CalculateNpvForNpvRequest(NpvRequest request, bool useXnpvFormula)
 {
     return _npvCalculator.CalculateNpvForNpvRequest(request, useXnpvFormula);
 }