当前位置: 首页>>代码示例>>C#>>正文


C# DayCounter类代码示例

本文整理汇总了C#中DayCounter的典型用法代码示例。如果您正苦于以下问题:C# DayCounter类的具体用法?C# DayCounter怎么用?C# DayCounter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DayCounter类属于命名空间,在下文中一共展示了DayCounter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TermStructure

 public TermStructure(DayCounter dc)
 {
     moving_ = false;
     updated_ = true;
     settlementDays_ = default(int);
     dayCounter_ = dc;
 }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:7,代码来源:TermStructure.cs

示例2: FixedRateBond

        public FixedRateBond(int settlementDays, double faceAmount, Schedule schedule,
            List<double> coupons, DayCounter accrualDayCounter,
            BusinessDayConvention paymentConvention, double redemption, Date issueDate)
            : this(settlementDays, faceAmount, schedule, coupons, accrualDayCounter,
				   paymentConvention, redemption, issueDate, new Calendar())
        {
        }
开发者ID:ammachado,项目名称:QLNet,代码行数:7,代码来源:Fixedratebond.cs

示例3: FloatingRateCoupon

        // constructors
        public FloatingRateCoupon(double nominal, 
            Date paymentDate,
            Date startDate,
            Date endDate,
            int fixingDays,
            InterestRateIndex index,
            double gearing = 1.0,
            double spread = 0.0,
            Date refPeriodStart = null,
            Date refPeriodEnd = null,
            DayCounter dayCounter = null,
            bool isInArrears = false)
            : base(nominal, paymentDate, startDate, endDate, refPeriodStart, refPeriodEnd)
        {
            index_ = index;
             dayCounter_ = dayCounter ?? index_.dayCounter() ?? new DayCounter();
             fixingDays_ = fixingDays == default(int) ? index.fixingDays() : fixingDays;
             gearing_ = gearing;
             spread_ = spread;
             isInArrears_ = isInArrears;

             if (gearing_ == 0) throw new ArgumentException("Null gearing not allowed");

             // add as observer
             index_.registerWith(update);
             Settings.registerWith(update);
        }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:28,代码来源:FloatingRateCoupon.cs

示例4: FlatForward

 public FlatForward(Date referenceDate, double forward, DayCounter dayCounter, Compounding compounding, Frequency frequency)
     : base(referenceDate, new Calendar(), dayCounter)
 {
     forward_ = new SimpleQuote(forward);
     compounding_ = compounding;
     frequency_ = frequency;
 }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:7,代码来源:Flatforward.cs

示例5: BasisSwap

 // constructor
 public BasisSwap(Type type, double nominal,
     Schedule float1Schedule, IborIndex iborIndex1, double spread1, DayCounter float1DayCount,
     Schedule float2Schedule, IborIndex iborIndex2, double spread2, DayCounter float2DayCount)
     : this(type, nominal, float1Schedule, iborIndex1, spread1, float1DayCount,
                        float2Schedule, iborIndex2, spread2, float2DayCount, null)
 {
 }
开发者ID:ariesy,项目名称:QLNet,代码行数:8,代码来源:BasisSwap.cs

示例6: FloatingRateBond

        public FloatingRateBond(int settlementDays, double faceAmount, Schedule schedule, IborIndex index, DayCounter paymentDayCounter,
            BusinessDayConvention paymentConvention, int fixingDays, List<double> gearings, List<double> spreads,
            List<double> caps, List<double> floors, bool inArrears, double redemption, Date issueDate)
            : base(settlementDays, schedule.calendar(), issueDate)
        {
            maturityDate_ = schedule.endDate();
            cashflows_ = new IborLeg(schedule, index)
                            .withPaymentDayCounter(paymentDayCounter)
                            .withFixingDays(fixingDays)
                            .withGearings(gearings)
                            .withSpreads(spreads)
                            .withCaps(caps)
                            .withFloors(floors)
                            .inArrears(inArrears)
                            .withNotionals(faceAmount)
                            .withPaymentAdjustment(paymentConvention);

            addRedemptionsToCashflows(new List<double>() { redemption });

            if (cashflows().Count == 0)
                throw new ApplicationException("bond with no cashflows!");
            if (redemptions_.Count != 1)
                throw new ApplicationException("multiple redemptions created");

            index.registerWith(update);
        }
开发者ID:ariesy,项目名称:QLNet,代码行数:26,代码来源:FloatingRateBond.cs

示例7: factory

 // Factory - for Leg generators
 public override CashFlow factory(double nominal, Date paymentDate, Date startDate, Date endDate, int fixingDays,
     InterestRateIndex index, double gearing, double spread,
     Date refPeriodStart, Date refPeriodEnd, DayCounter dayCounter, bool isInArrears)
 {
     return new IborCoupon(nominal, paymentDate, startDate, endDate, fixingDays,
             (IborIndex)index, gearing, spread, refPeriodStart, refPeriodEnd, dayCounter, isInArrears);
 }
开发者ID:vdt,项目名称:QLNet,代码行数:8,代码来源:Iborcoupon.cs

示例8: BlackConstantVol

        public BlackConstantVol(Date referenceDate, Calendar cal, Handle<Quote> volatility, DayCounter dc)
            : base(referenceDate, cal, BusinessDayConvention.Following, dc)
        {
            volatility_ = volatility;

            volatility_.registerWith(update);
        }
开发者ID:ariesy,项目名称:QLNet,代码行数:7,代码来源:BlackConstantVol.cs

示例9: SwaptionVolatilityDiscrete

        public SwaptionVolatilityDiscrete(List<Period> optionTenors,
            List<Period> swapTenors,
            int settlementDays,
            Calendar cal,
            BusinessDayConvention bdc,
            DayCounter dc)
            : base(settlementDays, cal, bdc, dc)
        {
            nOptionTenors_ = optionTenors.Count;
            optionTenors_ = optionTenors;
            optionDates_ = new InitializedList<Date>(nOptionTenors_);
            optionTimes_ = new InitializedList<double>(nOptionTenors_);
            optionDatesAsReal_ = new InitializedList<double>(nOptionTenors_);
            nSwapTenors_ = swapTenors.Count;
            swapTenors_ = swapTenors;
            swapLengths_ = new InitializedList<double>(nSwapTenors_);

            checkOptionTenors();
            initializeOptionDatesAndTimes();

            checkSwapTenors();
            initializeSwapLengths();

            optionInterpolator_ = new LinearInterpolation(optionTimes_,
                                            optionTimes_.Count,
                                            optionDatesAsReal_);
            optionInterpolator_.update();
            optionInterpolator_.enableExtrapolation();
            evaluationDate_ = Settings.evaluationDate();
            Settings.registerWith(update);
        }
开发者ID:ammachado,项目名称:QLNet,代码行数:31,代码来源:swaptionvoldiscrete.cs

示例10: SwapRateHelper

        public SwapRateHelper(double rate, Period tenor, Calendar calendar,
            Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount,
            IborIndex iborIndex)
            : this(rate, tenor, calendar, fixedFrequency, fixedConvention, fixedDayCount, iborIndex,
		                      	     new Handle<Quote>(), new Period(0, TimeUnit.Days))
        {
        }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:7,代码来源:SwapRateHelper.cs

示例11: YoYInflationCoupon

 public YoYInflationCoupon(Date paymentDate, double nominal, Date startDate, Date endDate, int fixingDays, YoYInflationIndex yoyIndex, Period observationLag, DayCounter dayCounter, double gearing, double spread, Date refPeriodStart, Date refPeriodEnd)
     : base(paymentDate, nominal, startDate, endDate, fixingDays, yoyIndex, observationLag, dayCounter, refPeriodStart, refPeriodEnd)
 {
     yoyIndex_ = yoyIndex;
     gearing_ = gearing;
     spread_ = spread;
 }
开发者ID:vdt,项目名称:QLNet,代码行数:7,代码来源:YoYInflationCoupon.cs

示例12: DailyTenorLibor

 public DailyTenorLibor(string familyName, int settlementDays, Currency currency, Calendar financialCenterCalendar, DayCounter dayCounter, Handle<YieldTermStructure> h)
     : base(familyName, new Period(1, TimeUnit.Days), settlementDays, currency, new JointCalendar(new UnitedKingdom(UnitedKingdom.Market.Exchange), financialCenterCalendar, JointCalendar.JointCalendarRule.JoinHolidays), Utils.liborConvention(new Period(1, TimeUnit.Days)), Utils.liborEOM(new Period(1, TimeUnit.Days)), dayCounter, h)
 {
     if (!(currency != new EURCurrency()))
     {
         throw new ApplicationException("for EUR Libor dedicated EurLibor constructor must be used");
     }
 }
开发者ID:ammachado,项目名称:QLNet,代码行数:8,代码来源:DailyTenorLibor.cs

示例13: ConstantOptionletVolatility

        //! fixed reference date, floating market data
        public ConstantOptionletVolatility(Date referenceDate, Calendar cal, BusinessDayConvention bdc,
            Handle<Quote> vol, DayCounter dc)
            : base(referenceDate, cal, bdc, dc)
        {
            volatility_ = vol;

            volatility_.registerWith(update);
        }
开发者ID:ariesy,项目名称:QLNet,代码行数:9,代码来源:ConstantOptionletVolatility.cs

示例14: LocalConstantVol

        public LocalConstantVol(int settlementDays, Calendar calendar, Handle<Quote> volatility, DayCounter dayCounter)
            : base(settlementDays,calendar)
        {
            volatility_ = volatility;
            dayCounter_ = dayCounter;

            volatility_.registerWith(update);
        }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:8,代码来源:LocalConstantVol.cs

示例15: DepositRateHelper

 public DepositRateHelper(double rate, Period tenor, int fixingDays, Calendar calendar,
     BusinessDayConvention convention, bool endOfMonth, DayCounter dayCounter)
     : base(rate)
 {
     iborIndex_ = new IborIndex("no-fix", tenor, fixingDays, new Currency(), calendar, convention,
                                endOfMonth, dayCounter, termStructureHandle_);
     initializeDates();
 }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:8,代码来源:DepositRateHelper.cs


注:本文中的DayCounter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。