QLNet.InterestRate.dayCounter C# (CSharp) Метод

dayCounter() публичный Метод

public dayCounter ( ) : DayCounter
Результат DayCounter
        public DayCounter dayCounter()
        {
            return dc_;
        }

Usage Example

        public static double simpleDuration(List <CashFlow> cashflows, InterestRate y, Date settlementDate)
        {
            if (cashflows.Count == 0)
            {
                return(0.0);
            }

            double     P = 0, dPdy = 0;
            DayCounter dc = y.dayCounter();

            foreach (CashFlow cf in cashflows.Where(cf => !cf.hasOccurred(settlementDate)))
            {
                double t = dc.yearFraction(settlementDate, cf.date());
                double c = cf.amount();
                double B = y.discountFactor(t);
                P    += c * B;
                dPdy += t * c * B;
            }


            // no cashflows
            if (P == 0.0)
            {
                return(0.0);
            }
            return(dPdy / P);
        }
All Usage Examples Of QLNet.InterestRate::dayCounter