コード例 #1
0
ファイル: RateHelpers.cs プロジェクト: OpenDerivatives/QLCore
        public SwapRateHelper(double rate,
                              SwapIndex swapIndex,
                              Handle <Quote> spread = null,
                              Period fwdStart       = null,
                              // exogenous discounting curve
                              Handle <YieldTermStructure> discount = null,
                              Pillar.Choice pillarChoice           = Pillar.Choice.LastRelevantDate,
                              Date customPillarDate = null)
            : base(rate)
        {
            settlementDays_  = swapIndex.fixingDays();
            tenor_           = swapIndex.tenor();
            pillarChoice_    = pillarChoice;
            calendar_        = swapIndex.fixingCalendar();
            fixedConvention_ = swapIndex.fixedLegConvention();
            fixedFrequency_  = swapIndex.fixedLegTenor().frequency();
            fixedDayCount_   = swapIndex.dayCounter();
            spread_          = spread ?? new Handle <Quote>();
            fwdStart_        = fwdStart ?? new Period(0, TimeUnit.Days);
            discountHandle_  = discount ?? new Handle <YieldTermStructure>();

            // take fixing into account
            iborIndex_ = swapIndex.iborIndex().clone(termStructureHandle_);
            // We want to be notified of changes of fixings, but we don't
            // want notifications from termStructureHandle_ (they would
            // interfere with bootstrapping.)
            iborIndex_.registerWith(update);
            spread_.registerWith(update);
            discountHandle_.registerWith(update);

            pillarDate_ = customPillarDate;
            initializeDates();
        }