accruedPeriod() 공개 메소드

public accruedPeriod ( Date d ) : double
d Date
리턴 double
예제 #1
0
        public static double accruedPeriod(Leg leg, bool includeSettlementDateFlows, Date settlementDate = null)
        {
            if (settlementDate == null)
            {
                settlementDate = Settings.evaluationDate();
            }

            CashFlow cf = nextCashFlow(leg, includeSettlementDateFlows, settlementDate);

            if (cf == null)
            {
                return(0);
            }

            Date paymentDate = cf.date();

            foreach (CashFlow x in leg.Where(x => x.date() == paymentDate))
            {
                Coupon cp = x as Coupon;
                if (cp != null)
                {
                    return(cp.accruedPeriod(settlementDate));
                }
            }
            return(0);
        }