コード例 #1
0
        //-------------------------------------------------------------------------
        public CurrencyParameterSensitivities parameterSensitivity(OvernightRateSensitivity pointSensitivity)
        {
            OvernightIndex                 index          = pointSensitivity.Index;
            LocalDate                      startDate      = pointSensitivity.Observation.EffectiveDate;
            LocalDate                      endDate        = pointSensitivity.EndDate;
            double                         accrualFactor  = index.DayCount.yearFraction(startDate, endDate);
            double                         forwardBar     = pointSensitivity.Sensitivity;
            double                         dfForwardStart = discountFactors.discountFactor(startDate);
            double                         dfForwardEnd   = discountFactors.discountFactor(endDate);
            double                         dfStartBar     = forwardBar / (accrualFactor * dfForwardEnd);
            double                         dfEndBar       = -forwardBar * dfForwardStart / (accrualFactor * dfForwardEnd * dfForwardEnd);
            ZeroRateSensitivity            zrsStart       = discountFactors.zeroRatePointSensitivity(startDate, pointSensitivity.Currency);
            ZeroRateSensitivity            zrsEnd         = discountFactors.zeroRatePointSensitivity(endDate, pointSensitivity.Currency);
            CurrencyParameterSensitivities psStart        = discountFactors.parameterSensitivity(zrsStart).multipliedBy(dfStartBar);
            CurrencyParameterSensitivities psEnd          = discountFactors.parameterSensitivity(zrsEnd).multipliedBy(dfEndBar);

            return(psStart.combinedWith(psEnd));
        }
コード例 #2
0
 private OvernightFutureSecurity(SecurityInfo info, double notional, double accrualFactor, LocalDate lastTradeDate, LocalDate startDate, LocalDate endDate, OvernightIndex index, OvernightAccrualMethod accrualMethod, Rounding rounding)
 {
     JodaBeanUtils.notNull(info, "info");
     ArgChecker.notNegativeOrZero(notional, "notional");
     ArgChecker.notNegativeOrZero(accrualFactor, "accrualFactor");
     JodaBeanUtils.notNull(lastTradeDate, "lastTradeDate");
     JodaBeanUtils.notNull(startDate, "startDate");
     JodaBeanUtils.notNull(endDate, "endDate");
     JodaBeanUtils.notNull(index, "index");
     JodaBeanUtils.notNull(accrualMethod, "accrualMethod");
     JodaBeanUtils.notNull(rounding, "rounding");
     this.info          = info;
     this.notional      = notional;
     this.accrualFactor = accrualFactor;
     this.lastTradeDate = lastTradeDate;
     this.startDate     = startDate;
     this.endDate       = endDate;
     this.index         = index;
     this.accrualMethod = accrualMethod;
     this.rounding      = rounding;
 }
コード例 #3
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 100346066:         // index
                    this.index = (OvernightIndex)newValue;
                    break;

                case -91613053:         // discountFactors
                    this.discountFactors = (DiscountFactors)newValue;
                    break;

                case -843784602:         // fixings
                    this.fixings = (LocalDateDoubleTimeSeries)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
コード例 #4
0
        public virtual void test_usdFedFund_dates()
        {
            OvernightIndex test = OvernightIndex.of("USD-FED-FUND");

            assertEquals(test.calculatePublicationFromFixing(date(2014, 10, 27), REF_DATA), date(2014, 10, 28));
            assertEquals(test.calculateEffectiveFromFixing(date(2014, 10, 27), REF_DATA), date(2014, 10, 27));
            assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 27), REF_DATA), date(2014, 10, 28));
            assertEquals(test.calculateFixingFromEffective(date(2014, 10, 27), REF_DATA), date(2014, 10, 27));
            assertEquals(test.calculateMaturityFromEffective(date(2014, 10, 27), REF_DATA), date(2014, 10, 28));
            // weekend and US holiday
            assertEquals(test.calculatePublicationFromFixing(date(2014, 10, 10), REF_DATA), date(2014, 10, 14));
            assertEquals(test.calculateEffectiveFromFixing(date(2014, 10, 10), REF_DATA), date(2014, 10, 10));
            assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 10), REF_DATA), date(2014, 10, 14));
            assertEquals(test.calculateFixingFromEffective(date(2014, 10, 10), REF_DATA), date(2014, 10, 10));
            assertEquals(test.calculateMaturityFromEffective(date(2014, 10, 10), REF_DATA), date(2014, 10, 14));
            // input date is Sunday, 13th is US holiday
            assertEquals(test.calculatePublicationFromFixing(date(2014, 10, 12), REF_DATA), date(2014, 10, 15));
            assertEquals(test.calculateEffectiveFromFixing(date(2014, 10, 12), REF_DATA), date(2014, 10, 14));
            assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 12), REF_DATA), date(2014, 10, 15));
            assertEquals(test.calculateFixingFromEffective(date(2014, 10, 12), REF_DATA), date(2014, 10, 14));
            assertEquals(test.calculateMaturityFromEffective(date(2014, 10, 12), REF_DATA), date(2014, 10, 15));
        }
コード例 #5
0
        public virtual void test_gbpSonia_dates()
        {
            OvernightIndex test = OvernightIndex.of("GBP-SONIA");

            assertEquals(test.calculatePublicationFromFixing(date(2014, 10, 13), REF_DATA), date(2014, 10, 13));
            assertEquals(test.calculateEffectiveFromFixing(date(2014, 10, 13), REF_DATA), date(2014, 10, 13));
            assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 13), REF_DATA), date(2014, 10, 14));
            assertEquals(test.calculateFixingFromEffective(date(2014, 10, 13), REF_DATA), date(2014, 10, 13));
            assertEquals(test.calculateMaturityFromEffective(date(2014, 10, 13), REF_DATA), date(2014, 10, 14));
            // weekend
            assertEquals(test.calculatePublicationFromFixing(date(2014, 10, 10), REF_DATA), date(2014, 10, 10));
            assertEquals(test.calculateEffectiveFromFixing(date(2014, 10, 10), REF_DATA), date(2014, 10, 10));
            assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 10), REF_DATA), date(2014, 10, 13));
            assertEquals(test.calculateFixingFromEffective(date(2014, 10, 10), REF_DATA), date(2014, 10, 10));
            assertEquals(test.calculateMaturityFromEffective(date(2014, 10, 10), REF_DATA), date(2014, 10, 13));
            // input date is Sunday
            assertEquals(test.calculatePublicationFromFixing(date(2014, 10, 12), REF_DATA), date(2014, 10, 13));
            assertEquals(test.calculateEffectiveFromFixing(date(2014, 10, 12), REF_DATA), date(2014, 10, 13));
            assertEquals(test.calculateMaturityFromFixing(date(2014, 10, 12), REF_DATA), date(2014, 10, 14));
            assertEquals(test.calculateFixingFromEffective(date(2014, 10, 12), REF_DATA), date(2014, 10, 13));
            assertEquals(test.calculateMaturityFromEffective(date(2014, 10, 12), REF_DATA), date(2014, 10, 14));
        }
コード例 #6
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 1905311443:         // dayCount
                    this.dayCount_Renamed = (DayCount)newValue;
                    break;

                case 100346066:         // index
                    this.index_Renamed = (OvernightIndex)newValue;
                    break;

                case -1335729296:         // accrualMethod
                    this.accrualMethod_Renamed = (OvernightAccrualMethod)newValue;
                    break;

                case 1969081334:         // negativeRateMethod
                    this.negativeRateMethod_Renamed = (NegativeRateMethod)newValue;
                    break;

                case -92095804:         // rateCutOffDays
                    this.rateCutOffDays_Renamed = (int?)newValue.Value;
                    break;

                case -91774989:         // gearing
                    this.gearing_Renamed = (ValueSchedule)newValue;
                    break;

                case -895684237:         // spread
                    this.spread_Renamed = (ValueSchedule)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
コード例 #7
0
 public OvernightIndexRates overnightIndexRates(OvernightIndex index)
 {
     return(overnightRates);
 }
コード例 #8
0
 public DatedOISRateHelper(Date startDate, Date endDate, QuoteHandle rate, OvernightIndex index, YieldTermStructureHandle discountingCurve) : this(NQuantLibcPINVOKE.new_DatedOISRateHelper__SWIG_0(Date.getCPtr(startDate), Date.getCPtr(endDate), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index), YieldTermStructureHandle.getCPtr(discountingCurve)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #9
0
ファイル: DatedOISRateHelper.cs プロジェクト: minikie/test
 public DatedOISRateHelper(Date startDate, Date endDate, QuoteHandle rate, OvernightIndex index) : this(NQuantLibcPINVOKE.new_DatedOISRateHelper__SWIG_1(Date.getCPtr(startDate), Date.getCPtr(endDate), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #10
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates an instance from an index and accrual period dates
 /// <para>
 /// The dates represent the accrual period.
 /// </para>
 /// <para>
 /// No rate cut-off applies.
 ///
 /// </para>
 /// </summary>
 /// <param name="index">  the index </param>
 /// <param name="startDate">  the first date of the accrual period </param>
 /// <param name="endDate">  the last date of the accrual period </param>
 /// <param name="refData">  the reference data to use when resolving holiday calendars </param>
 /// <returns> the rate computation </returns>
 public static OvernightAveragedRateComputation of(OvernightIndex index, LocalDate startDate, LocalDate endDate, ReferenceData refData)
 {
     return(of(index, startDate, endDate, 0, refData));
 }
コード例 #11
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains a rate calculation for the specified index with accrual by compounding.
 /// <para>
 /// The calculation will use the day count of the index.
 /// All optional fields will be set to their default values.
 /// Thus, there will be no spread, gearing or rate cut-off.
 /// If this method provides insufficient control, use the <seealso cref="#builder() builder"/>.
 ///
 /// </para>
 /// </summary>
 /// <param name="index">  the index </param>
 /// <returns> the calculation </returns>
 public static OvernightRateCalculation of(OvernightIndex index)
 {
     return(OvernightRateCalculation.builder().index(index).build());
 }
コード例 #12
0
 public OvernightIndexedSwap(_OvernightIndexedSwap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex overnightIndex, double spread, uint paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar, bool telescopicValueDates) : this(NQuantLibcPINVOKE.new_OvernightIndexedSwap__SWIG_0((int)type, nominal, Schedule.getCPtr(schedule), fixedRate, DayCounter.getCPtr(fixedDC), OvernightIndex.getCPtr(overnightIndex), spread, paymentLag, (int)paymentAdjustment, Calendar.getCPtr(paymentCalendar), telescopicValueDates), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #13
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(OvernightIndex obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
コード例 #14
0
 public OISRateHelper(uint settlementDays, Period tenor, QuoteHandle rate, OvernightIndex index, YieldTermStructureHandle discountingCurve, bool telescopicValueDates, uint paymentLag, BusinessDayConvention paymentConvention, Frequency paymentFrequency) : this(NQuantLibcPINVOKE.new_OISRateHelper__SWIG_3(settlementDays, Period.getCPtr(tenor), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index), YieldTermStructureHandle.getCPtr(discountingCurve), telescopicValueDates, paymentLag, (int)paymentConvention, (int)paymentFrequency), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #15
0
        // checks that the index on a stub matches the main index (this is handling bad FpML)
        private void checkStubForOvernightIndex(XmlElement baseEl, FpmlDocument document, OvernightIndex index)
        {
            document.validateNotPresent(baseEl, "stubAmount");
            document.validateNotPresent(baseEl, "stubRate");
            IList <XmlElement> indicesEls = baseEl.getChildren("floatingRate");

            if (indicesEls.Count == 1)
            {
                XmlElement indexEl = indicesEls[0];
                document.validateNotPresent(indexEl, "floatingRateMultiplierSchedule");
                document.validateNotPresent(indexEl, "spreadSchedule");
                document.validateNotPresent(indexEl, "rateTreatment");
                document.validateNotPresent(indexEl, "capRateSchedule");
                document.validateNotPresent(indexEl, "floorRateSchedule");
                Index parsed = document.parseIndex(indexEl);
                if (parsed.Equals(index))
                {
                    return;
                }
                throw new FpmlParseException("OvernightIndex swap cannot have a different index in the stub: " + baseEl);
            }
            throw new FpmlParseException("Unknown stub structure: " + baseEl);
        }
コード例 #16
0
        public virtual void test_serialization()
        {
            OvernightIndex index = ImmutableOvernightIndex.builder().name("Test").currency(Currency.GBP).fixingCalendar(GBLO).publicationDateOffset(0).effectiveDateOffset(0).dayCount(ACT_360).build();

            assertSerialization(index);
        }
コード例 #17
0
 public virtual void test_of_lookup_null()
 {
     assertThrowsIllegalArg(() => OvernightIndex.of(null));
 }
コード例 #18
0
 public IBOROISBasisSwap(_IBOROISBasisSwap.Type type, double nominal, Schedule floatingSchedule, IborIndex iborIndex, DayCounter floatingDC, Schedule fixedSchedule, OvernightIndex overnightIndex, double spread, DayCounter fixedDC) : this(NQuantLibcPINVOKE.new_IBOROISBasisSwap__SWIG_2((int)type, nominal, Schedule.getCPtr(floatingSchedule), IborIndex.getCPtr(iborIndex), DayCounter.getCPtr(floatingDC), Schedule.getCPtr(fixedSchedule), OvernightIndex.getCPtr(overnightIndex), spread, DayCounter.getCPtr(fixedDC)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #19
0
 public OISRateHelper(uint settlementDays, Period tenor, QuoteHandle rate, OvernightIndex index, YieldTermStructureHandle discountingCurve, bool telescopicValueDates) : this(NQuantLibcPINVOKE.new_OISRateHelper__SWIG_6(settlementDays, Period.getCPtr(tenor), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index), YieldTermStructureHandle.getCPtr(discountingCurve), telescopicValueDates), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #20
0
 public OvernightIndexedSwap(_OvernightIndexedSwap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex overnightIndex, double spread) : this(NQuantLibcPINVOKE.new_OvernightIndexedSwap__SWIG_10((int)type, DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), fixedRate, DayCounter.getCPtr(fixedDC), OvernightIndex.getCPtr(overnightIndex), spread), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #21
0
ファイル: OISRateHelper.cs プロジェクト: minikie/test
 public OISRateHelper(uint settlementDays, Period tenor, QuoteHandle rate, OvernightIndex index, YieldTermStructureHandle discountingCurve) : this(NQuantLibcPINVOKE.new_OISRateHelper__SWIG_0(settlementDays, Period.getCPtr(tenor), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index), YieldTermStructureHandle.getCPtr(discountingCurve)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #22
0
 public IBOROISBasisRateHelper(int settlementDays, Period tenor, QuoteHandle overnightSpread, IborIndex iborIndex, OvernightIndex overnightIndex) : this(NQuantLibcPINVOKE.new_IBOROISBasisRateHelper__SWIG_1(settlementDays, Period.getCPtr(tenor), QuoteHandle.getCPtr(overnightSpread), IborIndex.getCPtr(iborIndex), OvernightIndex.getCPtr(overnightIndex)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #23
0
ファイル: OISRateHelper.cs プロジェクト: minikie/test
 public OISRateHelper(uint settlementDays, Period tenor, QuoteHandle rate, OvernightIndex index) : this(NQuantLibcPINVOKE.new_OISRateHelper__SWIG_1(settlementDays, Period.getCPtr(tenor), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #24
0
 //-----------------------------------------------------------------------
 /// <summary>
 /// Sets the Overnight index.
 /// <para>
 /// The rate to be paid is based on this index.
 /// It will be a well known market index such as 'GBP-SONIA'.
 /// </para>
 /// </summary>
 /// <param name="index">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder index(OvernightIndex index)
 {
     JodaBeanUtils.notNull(index, "index");
     this.index_Renamed = index;
     return(this);
 }
コード例 #25
0
 public OvernightIndexedSwap(OvernightIndexedSwap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, uint paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar) : this(NQuantLibcPINVOKE.new_OvernightIndexedSwap__SWIG_7((int)type, DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), fixedRate, DayCounter.getCPtr(fixedDC), OvernightIndex.getCPtr(index), spread, paymentLag, (int)paymentAdjustment, Calendar.getCPtr(paymentCalendar)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #26
0
 /// <summary>
 /// Creates an instance from an index, accrual period dates and rate cut-off.
 /// <para>
 /// Rate cut-off applies if the cut-off is 2 or greater.
 /// A value of 0 or 1 should be used if no cut-off applies.
 ///
 /// </para>
 /// </summary>
 /// <param name="index">  the index </param>
 /// <param name="startDate">  the first date of the accrual period </param>
 /// <param name="endDate">  the last date of the accrual period </param>
 /// <param name="rateCutOffDays">  the rate cut-off days offset, not negative or zero </param>
 /// <param name="refData">  the reference data to use when resolving holiday calendars </param>
 /// <returns> the rate computation </returns>
 public static OvernightAveragedRateComputation of(OvernightIndex index, LocalDate startDate, LocalDate endDate, int rateCutOffDays, ReferenceData refData)
 {
     return(OvernightAveragedRateComputation.builder().index(index).fixingCalendar(index.FixingCalendar.resolve(refData)).startDate(index.calculateFixingFromEffective(startDate, refData)).endDate(index.calculateFixingFromEffective(endDate, refData)).rateCutOffDays(rateCutOffDays).build());
 }
コード例 #27
0
ファイル: DatedOISRateHelper.cs プロジェクト: minikie/test
 public DatedOISRateHelper(Date startDate, Date endDate, QuoteHandle rate, OvernightIndex index, YieldTermStructureHandle discountingCurve) : this(NQuantLibcPINVOKE.new_DatedOISRateHelper__SWIG_0(Date.getCPtr(startDate), Date.getCPtr(endDate), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index), YieldTermStructureHandle.getCPtr(discountingCurve)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #28
0
 public OvernightIndexedSwap(OvernightIndexedSwap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index) : this(NQuantLibcPINVOKE.new_OvernightIndexedSwap__SWIG_5((int)type, nominal, Schedule.getCPtr(schedule), fixedRate, DayCounter.getCPtr(fixedDC), OvernightIndex.getCPtr(index)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #29
0
 public OISRateHelper(uint settlementDays, Period tenor, QuoteHandle rate, OvernightIndex index) : this(NQuantLibcPINVOKE.new_OISRateHelper__SWIG_1(settlementDays, Period.getCPtr(tenor), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #30
0
 //-------------------------------------------------------------------------
 // overnight rate calculation
 private static RateCalculation parseOvernightRateCalculation(CsvRow row, string leg, OvernightIndex overnightIndex, OvernightAccrualMethod accrualMethod)
 {
     OvernightRateCalculation.Builder builder = OvernightRateCalculation.builder();
     // basics
     builder.index(overnightIndex);
     builder.accrualMethod(findValue(row, leg, ACCRUAL_METHOD_FIELD).map(s => OvernightAccrualMethod.of(s)).orElse(accrualMethod));
     // optionals
     findValue(row, leg, DAY_COUNT_FIELD).map(s => LoaderUtils.parseDayCount(s)).ifPresent(v => builder.dayCount(v));
     findValue(row, leg, RATE_CUT_OFF_DAYS_FIELD).map(s => Convert.ToInt32(s)).ifPresent(v => builder.rateCutOffDays(v));
     findValue(row, leg, NEGATIVE_RATE_METHOD_FIELD).map(s => NegativeRateMethod.of(s)).ifPresent(v => builder.negativeRateMethod(v));
     findValue(row, leg, GEARING_FIELD).map(s => LoaderUtils.parseDouble(s)).ifPresent(v => builder.gearing(ValueSchedule.of(v)));
     findValue(row, leg, SPREAD_FIELD).map(s => LoaderUtils.parseDoublePercent(s)).ifPresent(v => builder.spread(ValueSchedule.of(v)));
     return(builder.build());
 }
コード例 #31
0
ファイル: OvernightIndex.cs プロジェクト: minikie/test
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(OvernightIndex obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
コード例 #32
0
 public DatedOISRateHelper(Date startDate, Date endDate, QuoteHandle rate, OvernightIndex index) : this(NQuantLibcPINVOKE.new_DatedOISRateHelper__SWIG_1(Date.getCPtr(startDate), Date.getCPtr(endDate), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates an instance from an index and accrual period dates
 /// <para>
 /// The dates represent the accrual period.
 ///
 /// </para>
 /// </summary>
 /// <param name="index">  the index </param>
 /// <param name="startDate">  the first date of the accrual period </param>
 /// <param name="endDate">  the last date of the accrual period </param>
 /// <param name="refData">  the reference data to use when resolving holiday calendars </param>
 /// <returns> the rate computation </returns>
 public static OvernightAveragedDailyRateComputation of(OvernightIndex index, LocalDate startDate, LocalDate endDate, ReferenceData refData)
 {
     return(OvernightAveragedDailyRateComputation.builder().index(index).fixingCalendar(index.FixingCalendar.resolve(refData)).startDate(startDate).endDate(endDate).build());
 }
            // Check that the fixing is present. Throws an exception if not and return the rate as double.
            internal static double checkedFixing(LocalDate currentFixingTs, LocalDateDoubleTimeSeries indexFixingDateSeries, OvernightIndex index)
            {
                double?fixedRate = indexFixingDateSeries.get(currentFixingTs);

                return(fixedRate.orElseThrow(() => new PricingException("Could not get fixing value of index " + index.Name + " for date " + currentFixingTs)));
            }
コード例 #35
0
 public IBOROISBasisSwap(_IBOROISBasisSwap.Type type, double nominal, Schedule floatingSchedule, IborIndex iborIndex, DayCounter floatingDC, Schedule fixedSchedule, OvernightIndex overnightIndex, double spread, DayCounter fixedDC, BusinessDayConvention paymentConvention, bool arithmeticAveragedCoupon) : this(NQuantLibcPINVOKE.new_IBOROISBasisSwap__SWIG_0((int)type, nominal, Schedule.getCPtr(floatingSchedule), IborIndex.getCPtr(iborIndex), DayCounter.getCPtr(floatingDC), Schedule.getCPtr(fixedSchedule), OvernightIndex.getCPtr(overnightIndex), spread, DayCounter.getCPtr(fixedDC), (int)paymentConvention, arithmeticAveragedCoupon), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }