public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case -1321546630:         // template
                    this.template_Renamed = (FixedInflationSwapTemplate)newValue;
                    break;

                case -938107365:         // rateId
                    this.rateId_Renamed = (ObservableId)newValue;
                    break;

                case 291232890:         // additionalSpread
                    this.additionalSpread_Renamed = (double?)newValue.Value;
                    break;

                case 102727412:         // label
                    this.label_Renamed = (string)newValue;
                    break;

                case 3076014:         // date
                    this.date_Renamed = (CurveNodeDate)newValue;
                    break;

                case -263699392:         // dateOrder
                    this.dateOrder_Renamed = (CurveNodeDateOrder)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Exemple #2
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            FixedInflationSwapCurveNode test = FixedInflationSwapCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD);

            coverImmutableBean(test);
            FixedInflationSwapCurveNode test2 = FixedInflationSwapCurveNode.of(FixedInflationSwapTemplate.of(TENOR_10Y, FixedInflationSwapConventions.USD_FIXED_ZC_US_CPI), QuoteId.of(StandardId.of("OG-Ticker", "Deposit2")));

            coverBeanEquals(test, test2);
        }
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(FixedInflationSwapCurveNode beanToCopy)
 {
     this.template_Renamed         = beanToCopy.Template;
     this.rateId_Renamed           = beanToCopy.RateId;
     this.additionalSpread_Renamed = beanToCopy.AdditionalSpread;
     this.label_Renamed            = beanToCopy.Label;
     this.date_Renamed             = beanToCopy.Date;
     this.dateOrder_Renamed        = beanToCopy.DateOrder;
 }
 private FixedInflationSwapCurveNode(FixedInflationSwapTemplate template, ObservableId rateId, double additionalSpread, string label, CurveNodeDate date, CurveNodeDateOrder dateOrder)
 {
     JodaBeanUtils.notNull(template, "template");
     JodaBeanUtils.notNull(rateId, "rateId");
     JodaBeanUtils.notEmpty(label, "label");
     JodaBeanUtils.notNull(dateOrder, "dateOrder");
     this.template         = template;
     this.rateId           = rateId;
     this.additionalSpread = additionalSpread;
     this.label            = label;
     this.date_Renamed     = date;
     this.dateOrder        = dateOrder;
 }
Exemple #5
0
        private static CurveNode curveFixedInflationCurveNode(string conventionStr, string timeStr, string label, QuoteId quoteId, double spread, CurveNodeDate date, CurveNodeDateOrder order)
        {
            Matcher matcher = SIMPLE_YM_TIME_REGEX.matcher(timeStr.ToUpper(Locale.ENGLISH));

            if (!matcher.matches())
            {
                throw new System.ArgumentException(Messages.format("Invalid time format for Fixed-Inflation swap: {}", timeStr));
            }
            Period periodToEnd = Period.parse("P" + matcher.group(1));
            FixedInflationSwapConvention convention = FixedInflationSwapConvention.of(conventionStr);
            FixedInflationSwapTemplate   template   = FixedInflationSwapTemplate.of(Tenor.of(periodToEnd), convention);

            return(FixedInflationSwapCurveNode.builder().template(template).rateId(quoteId).additionalSpread(spread).label(label).date(date).dateOrder(order).build());
        }
Exemple #6
0
        static CalibrationInflationUsdTest()
        {
            DSC_NAMES[DSCON_CURVE_NAME] = USD;
            ISet <Index> usdFedFundSet = new HashSet <Index>();

            usdFedFundSet.Add(USD_FED_FUND);
            IDX_NAMES[DSCON_CURVE_NAME] = usdFedFundSet;
            ISet <Index> usdLibor3Set = new HashSet <Index>();

            usdLibor3Set.Add(USD_LIBOR_3M);
            IDX_NAMES[CPI_CURVE_NAME] = usdLibor3Set;
            for (int i = 0; i < DSC_NB_DEPO_NODES; i++)
            {
                BusinessDayAdjustment bda        = BusinessDayAdjustment.of(FOLLOWING, USNY);
                TermDepositConvention convention = ImmutableTermDepositConvention.of("USD-Dep", USD, bda, ACT_360, DaysAdjustment.ofBusinessDays(DSC_DEPO_OFFSET[i], USNY));
                DSC_NODES[i] = TermDepositCurveNode.of(TermDepositTemplate.of(Period.ofDays(1), convention), QuoteId.of(StandardId.of(SCHEME, DSC_ID_VALUE[i])));
            }
            for (int i = 0; i < DSC_NB_OIS_NODES; i++)
            {
                DSC_NODES[DSC_NB_DEPO_NODES + i] = FixedOvernightSwapCurveNode.of(FixedOvernightSwapTemplate.of(Period.ZERO, Tenor.of(DSC_OIS_TENORS[i]), USD_FIXED_1Y_FED_FUND_OIS), QuoteId.of(StandardId.of(SCHEME, DSC_ID_VALUE[DSC_NB_DEPO_NODES + i])));
            }
            for (int i = 0; i < CPI_NB_NODES; i++)
            {
                CPI_NODES[i] = FixedInflationSwapCurveNode.builder().template(FixedInflationSwapTemplate.of(Tenor.of(CPI_TENORS[i]), FixedInflationSwapConventions.USD_FIXED_ZC_US_CPI)).rateId(QuoteId.of(StandardId.of(SCHEME, CPI_ID_VALUE[i]))).date(CurveNodeDate.LAST_FIXING).build();
            }
            ImmutableMarketDataBuilder builder = ImmutableMarketData.builder(VAL_DATE);

            for (int i = 0; i < DSC_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, DSC_ID_VALUE[i])), DSC_MARKET_QUOTES[i]);
            }
            for (int i = 0; i < CPI_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, CPI_ID_VALUE[i])), CPI_MARKET_QUOTES[i]);
            }
            builder.addTimeSeries(IndexQuoteId.of(US_CPI_U), TS_USD_CPI);
            ALL_QUOTES = builder.build();
            IList <CurveNode[]> groupDsc = new List <CurveNode[]>();

            groupDsc.Add(DSC_NODES);
            CURVES_NODES.Add(groupDsc);
            IList <CurveNode[]> groupCpi = new List <CurveNode[]>();

            groupCpi.Add(CPI_NODES);
            CURVES_NODES.Add(groupCpi);
        }
 //-----------------------------------------------------------------------
 /// <summary>
 /// Sets the template for the swap associated with this node. </summary>
 /// <param name="template">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder template(FixedInflationSwapTemplate template)
 {
     JodaBeanUtils.notNull(template, "template");
     this.template_Renamed = template;
     return(this);
 }
 /// <summary>
 /// Returns a curve node for a Fixed-Inflation swap using the specified instrument template,
 /// rate key, spread and label.
 /// </summary>
 /// <param name="template">  the template defining the node instrument </param>
 /// <param name="rateId">  the identifier of the market data providing the rate for the node instrument </param>
 /// <param name="additionalSpread">  the additional spread amount added to the rate </param>
 /// <param name="label">  the label to use for the node </param>
 /// <returns> a node whose instrument is built from the template using a market rate </returns>
 public static FixedInflationSwapCurveNode of(FixedInflationSwapTemplate template, ObservableId rateId, double additionalSpread, string label)
 {
     return(new FixedInflationSwapCurveNode(template, rateId, additionalSpread, label, CurveNodeDate.END, CurveNodeDateOrder.DEFAULT));
 }
 /// <summary>
 /// Returns a curve node for a Fixed-Inflation swap using the specified instrument template, rate key and spread.
 /// <para>
 /// A suitable default label will be created.
 ///
 /// </para>
 /// </summary>
 /// <param name="template">  the template defining the node instrument </param>
 /// <param name="rateId">  the identifier of the market data providing the rate for the node instrument </param>
 /// <param name="additionalSpread">  the additional spread amount added to the rate </param>
 /// <returns> a node whose instrument is built from the template using a market rate </returns>
 public static FixedInflationSwapCurveNode of(FixedInflationSwapTemplate template, ObservableId rateId, double additionalSpread)
 {
     return(builder().template(template).rateId(rateId).additionalSpread(additionalSpread).build());
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Returns a curve node for a Fixed-Inflation swap using the specified instrument template and rate key.
 /// <para>
 /// A suitable default label will be created.
 ///
 /// </para>
 /// </summary>
 /// <param name="template">  the template used for building the instrument for the node </param>
 /// <param name="rateId">  the identifier of the market rate used when building the instrument for the node </param>
 /// <returns> a node whose instrument is built from the template using a market rate </returns>
 public static FixedInflationSwapCurveNode of(FixedInflationSwapTemplate template, ObservableId rateId)
 {
     return(of(template, rateId, 0d));
 }