accruedDays() 공개 메소드

public accruedDays ( Date d ) : int
d Date
리턴 int
예제 #1
0
        public static int accruedDays(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.accruedDays(settlementDate));
                }
            }
            return(0);
        }
예제 #2
0
        public static int accruedDays(List <CashFlow> leg, bool includeSettlementDateFlows, Date settlementDate = null)
        {
            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.accruedDays(settlementDate));
                }
            }
            return(0);
        }