Exemplo n.º 1
0
 public void CalculateReturn(ReturnType returnType, IEnumerable <Tuple <DateTime, DateTime> > periods, IEnumerable <Tuple <decimal, DateTime> > incomes)
 {
     switch (returnType)
     {
     case ReturnType.HoldingPeriodReturn:
         var holdingPeriodReturn = new HoldingPeriodReturn(periods, incomes);
         holdingPeriodReturn.Calculate();
         Returns.Add(holdingPeriodReturn);
         break;
     }
 }
Exemplo n.º 2
0
        public void CalculateReturn(ReturnType returnType, IEnumerable <Tuple <DateTime, DateTime> > periods, IEnumerable <Tuple <decimal, DateTime> > incomes)
        {
            switch (returnType)
            {
            case ReturnType.HoldingPeriodReturn:
                var holdingPeriodReturn = new HoldingPeriodReturn(periods, incomes);
                holdingPeriodReturn.Calculate();
                Returns.Add(holdingPeriodReturn);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(returnType), returnType, null);
            }
        }