• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DayCounter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CapletVarianceCurve

 public CapletVarianceCurve( Date referenceDate,
     List<Date> dates,
     List<double> capletVolCurve,
     DayCounter dayCounter)
     : base(referenceDate, new Calendar(), BusinessDayConvention.Following, new DayCounter())
 {
     blackCurve_=new BlackVarianceCurve(referenceDate, dates, capletVolCurve, dayCounter, false);
 }
开发者ID:ammachado,项目名称:QLNet,代码行数:8,代码来源:capletvariancecurve.cs


示例17: ConstantCapFloorTermVolatility

 // fixed reference date, fixed market data
 public ConstantCapFloorTermVolatility(Date referenceDate,
     Calendar cal,
     BusinessDayConvention bdc,
     double volatility,
     DayCounter dc)
     : base(referenceDate, cal, bdc, dc)
 {
     volatility_ = new Handle<Quote>(new SimpleQuote(volatility));
 }
开发者ID:ammachado,项目名称:QLNet,代码行数:10,代码来源:ConstantCapFloorTermVolatility.cs


示例18: ConstantSwaptionVolatility

 //! floating reference date, fixed market data
 public ConstantSwaptionVolatility(int settlementDays,
     Calendar cal,
     BusinessDayConvention bdc,
     double vol,
     DayCounter dc)
     : base(settlementDays, cal, bdc, dc)
 {
     volatility_ = new Handle<Quote>(new SimpleQuote(vol));
     maxSwapTenor_ = new Period(100, TimeUnit.Years);
 }
开发者ID:ariesy,项目名称:QLNet,代码行数:11,代码来源:swaptionconstantvol.cs


示例19: FRARateHelper

        public FRARateHelper(double rate, int monthsToStart, int monthsToEnd, int fixingDays, Calendar calendar,
            BusinessDayConvention convention, bool endOfMonth, DayCounter dayCounter)
            : base(rate)
        {
            periodToStart_ = new Period(monthsToStart, TimeUnit.Months);

            if (!(monthsToEnd > monthsToStart)) throw new ArgumentException("monthsToEnd must be grater than monthsToStart");
            iborIndex_ = new IborIndex("no-fix", new Period(monthsToEnd - monthsToStart, TimeUnit.Months), fixingDays,
                                       new Currency(), calendar, convention, endOfMonth, dayCounter, termStructureHandle_);
            initializeDates();
        }
开发者ID:ammachado,项目名称:QLNet,代码行数:11,代码来源:FRARateHelper.cs


示例20: AverageBMACoupon

        // double gearing = 1.0, double spread = 0.0,
        // Date refPeriodStart = Date(), Date refPeriodEnd = Date(), DayCounter dayCounter = DayCounter());
        public AverageBMACoupon(double nominal, Date paymentDate, Date startDate, Date endDate, BMAIndex index,
            double gearing, double spread, Date refPeriodStart, Date refPeriodEnd, DayCounter dayCounter)
            : base(nominal, paymentDate, startDate, endDate, index.fixingDays(), index, gearing, spread,
						 refPeriodStart, refPeriodEnd, dayCounter, false)
        {
            fixingSchedule_ = index.fixingSchedule(
                                index.fixingCalendar()
                                    .advance(startDate, new Period(-index.fixingDays() + bmaCutoffDays, TimeUnit.Days),
                                                   BusinessDayConvention.Preceding), endDate);
            setPricer(new AverageBMACouponPricer());
        }
开发者ID:ariesy,项目名称:QLNet,代码行数:13,代码来源:averagebmacoupon.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DayOfWeek类代码示例发布时间:2022-05-24
下一篇:
C# Datum类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap