Beispiel #1
0
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(OvernightFutureSecurity beanToCopy)
 {
     this.info_Renamed          = beanToCopy.Info;
     this.notional_Renamed      = beanToCopy.Notional;
     this.accrualFactor_Renamed = beanToCopy.AccrualFactor;
     this.lastTradeDate_Renamed = beanToCopy.LastTradeDate;
     this.startDate_Renamed     = beanToCopy.StartDate;
     this.endDate_Renamed       = beanToCopy.EndDate;
     this.index_Renamed         = beanToCopy.Index;
     this.accrualMethod_Renamed = beanToCopy.AccrualMethod;
     this.rounding_Renamed      = beanToCopy.Rounding;
 }
 //-------------------------------------------------------------------------
 // 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());
 }
Beispiel #3
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 3237038:         // info
                    this.info_Renamed = (SecurityInfo)newValue;
                    break;

                case 1585636160:         // notional
                    this.notional_Renamed = (double?)newValue.Value;
                    break;

                case -1540322338:         // accrualFactor
                    this.accrualFactor_Renamed = (double?)newValue.Value;
                    break;

                case -1041950404:         // lastTradeDate
                    this.lastTradeDate_Renamed = (LocalDate)newValue;
                    break;

                case -2129778896:         // startDate
                    this.startDate_Renamed = (LocalDate)newValue;
                    break;

                case -1607727319:         // endDate
                    this.endDate_Renamed = (LocalDate)newValue;
                    break;

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

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

                case -142444:         // rounding
                    this.rounding_Renamed = (Rounding)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Beispiel #4
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;
 }
Beispiel #5
0
        //-------------------------------------------------------------------------
        // build conventions
        private static OvernightIborSwapConvention makeConvention(string name, OvernightIndex onIndex, IborIndex iborIndex, DayCount dayCount, Frequency frequency, int paymentLag, int cutOffDays, OvernightAccrualMethod accrual)
        {
            HolidayCalendarId calendarOn        = onIndex.FixingCalendar;
            DaysAdjustment    paymentDateOffset = DaysAdjustment.ofBusinessDays(paymentLag, calendarOn);

            return(ImmutableOvernightIborSwapConvention.of(name, OvernightRateSwapLegConvention.builder().index(onIndex).accrualMethod(accrual).accrualFrequency(frequency).paymentFrequency(frequency).paymentDateOffset(paymentDateOffset).stubConvention(StubConvention.SMART_INITIAL).rateCutOffDays(cutOffDays).build(), IborRateSwapLegConvention.of(iborIndex)));
        }
Beispiel #6
0
 /// <summary>
 /// Sets the method of accruing Overnight interest.
 /// <para>
 /// The average rate is calculated based on this method over the period between {@code startDate} and {@code endDate}.
 /// </para>
 /// </summary>
 /// <param name="accrualMethod">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder accrualMethod(OvernightAccrualMethod accrualMethod)
 {
     JodaBeanUtils.notNull(accrualMethod, "accrualMethod");
     this.accrualMethod_Renamed = accrualMethod;
     return(this);
 }