/// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(XCcyIborIborSwapCurveNode beanToCopy)
 {
     this.template_Renamed         = beanToCopy.Template;
     this.fxRateId_Renamed         = beanToCopy.FxRateId;
     this.spreadId_Renamed         = beanToCopy.SpreadId;
     this.additionalSpread_Renamed = beanToCopy.AdditionalSpread;
     this.label_Renamed            = beanToCopy.Label;
     this.date_Renamed             = beanToCopy.Date;
     this.dateOrder_Renamed        = beanToCopy.DateOrder;
 }
Exemplo n.º 2
0
        private static CurveNode curveXCcyIborIborCurveNode(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 Cross Currency Swap: {}", timeStr));
            }
            Period periodToEnd = Period.parse("P" + matcher.group(1));
            XCcyIborIborSwapConvention convention = XCcyIborIborSwapConvention.of(conventionStr);
            XCcyIborIborSwapTemplate   template   = XCcyIborIborSwapTemplate.of(Tenor.of(periodToEnd), convention);

            return(XCcyIborIborSwapCurveNode.builder().template(template).spreadId(quoteId).additionalSpread(spread).label(label).date(date).dateOrder(order).build());
        }
 private XCcyIborIborSwapCurveNode(XCcyIborIborSwapTemplate template, FxRateId fxRateId, ObservableId spreadId, double additionalSpread, string label, CurveNodeDate date, CurveNodeDateOrder dateOrder)
 {
     JodaBeanUtils.notNull(template, "template");
     JodaBeanUtils.notNull(fxRateId, "fxRateId");
     JodaBeanUtils.notNull(spreadId, "spreadId");
     JodaBeanUtils.notEmpty(label, "label");
     JodaBeanUtils.notNull(dateOrder, "dateOrder");
     this.template         = template;
     this.fxRateId         = fxRateId;
     this.spreadId         = spreadId;
     this.additionalSpread = additionalSpread;
     this.label            = label;
     this.date_Renamed     = date;
     this.dateOrder        = dateOrder;
 }
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case -1321546630:         // template
                    this.template_Renamed = (XCcyIborIborSwapTemplate)newValue;
                    break;

                case -1054985843:         // fxRateId
                    this.fxRateId_Renamed = (FxRateId)newValue;
                    break;

                case -1759090194:         // spreadId
                    this.spreadId_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);
            }
 //-----------------------------------------------------------------------
 /// <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(XCcyIborIborSwapTemplate template)
 {
     JodaBeanUtils.notNull(template, "template");
     this.template_Renamed = template;
     return(this);
 }
        /// <summary>
        /// Returns a curve node for a cross-currency Ibor-Ibor interest rate swap using the
        /// specified instrument template, rate key, spread and label.
        /// </summary>
        /// <param name="template">  the template defining the node instrument </param>
        /// <param name="spreadId">  the identifier of the market spread used when building the instrument for the node </param>
        /// <param name="additionalSpread">  the additional spread amount added to the market quote </param>
        /// <param name="label">  the label to use for the node, if null or empty an appropriate default label will be used </param>
        /// <returns> a node whose instrument is built from the template using a market rate </returns>
        public static XCcyIborIborSwapCurveNode of(XCcyIborIborSwapTemplate template, ObservableId spreadId, double additionalSpread, string label)
        {
            FxRateId fxRateId = FxRateId.of(template.CurrencyPair);

            return(new XCcyIborIborSwapCurveNode(template, fxRateId, spreadId, additionalSpread, label, CurveNodeDate.END, CurveNodeDateOrder.DEFAULT));
        }
 /// <summary>
 /// Returns a curve node for a cross-currency Ibor-Ibor interest rate 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="spreadId">  the identifier of the market spread used when building the instrument for the node </param>
 /// <param name="additionalSpread">  the additional spread amount added to the market quote </param>
 /// <returns> a node whose instrument is built from the template using a market rate </returns>
 public static XCcyIborIborSwapCurveNode of(XCcyIborIborSwapTemplate template, ObservableId spreadId, double additionalSpread)
 {
     return(builder().template(template).spreadId(spreadId).additionalSpread(additionalSpread).build());
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Returns a curve node for a cross-currency Ibor-Ibor interest rate swap using the
 /// specified instrument template and rate.
 /// <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="spreadId">  the identifier of the market spread 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 XCcyIborIborSwapCurveNode of(XCcyIborIborSwapTemplate template, ObservableId spreadId)
 {
     return(of(template, spreadId, 0d));
 }
        static CalibrationZeroRateUsdOisIrsEurFxXCcyIrsTest()
        {
            USD_DSC_NODES[0] = TermDepositCurveNode.of(TermDepositTemplate.of(Period.ofDays(1), USD_SHORT_DEPOSIT_T0), QuoteId.of(StandardId.of(SCHEME, USD_DSC_ID_VALUE[0])));
            USD_DSC_NODES[1] = TermDepositCurveNode.of(TermDepositTemplate.of(Period.ofDays(1), USD_SHORT_DEPOSIT_T1), QuoteId.of(StandardId.of(SCHEME, USD_DSC_ID_VALUE[1])));
            for (int i = 0; i < USD_DSC_NB_OIS_NODES; i++)
            {
                USD_DSC_NODES[2 + i] = FixedOvernightSwapCurveNode.of(FixedOvernightSwapTemplate.of(Period.ZERO, Tenor.of(USD_DSC_OIS_TENORS[i]), USD_FIXED_1Y_FED_FUND_OIS), QuoteId.of(StandardId.of(SCHEME, USD_DSC_ID_VALUE[2 + i])));
            }
            USD_FWD3_NODES[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, USD_FWD3_ID_VALUE[0])));
            for (int i = 0; i < USD_FWD3_NB_FRA_NODES; i++)
            {
                USD_FWD3_NODES[i + 1] = FraCurveNode.of(FraTemplate.of(USD_FWD3_FRA_TENORS[i], USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, USD_FWD3_ID_VALUE[i + 1])));
            }
            for (int i = 0; i < USD_FWD3_NB_IRS_NODES; i++)
            {
                USD_FWD3_NODES[i + 1 + USD_FWD3_NB_FRA_NODES] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(USD_FWD3_IRS_TENORS[i]), USD_FIXED_6M_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, USD_FWD3_ID_VALUE[i + 1 + USD_FWD3_NB_FRA_NODES])));
            }
            for (int i = 0; i < EUR_DSC_NB_FX_NODES; i++)
            {
                EUR_DSC_NODES[i] = FxSwapCurveNode.of(FxSwapTemplate.of(EUR_DSC_FX_TENORS[i], EUR_USD), QuoteId.of(StandardId.of(SCHEME, EUR_DSC_ID_VALUE[i])));
            }
            for (int i = 0; i < EUR_DSC_NB_XCCY_NODES; i++)
            {
                EUR_DSC_NODES[EUR_DSC_NB_FX_NODES + i] = XCcyIborIborSwapCurveNode.of(XCcyIborIborSwapTemplate.of(Tenor.of(EUR_DSC_XCCY_TENORS[i]), EUR_EURIBOR_3M_USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, EUR_DSC_ID_VALUE[EUR_DSC_NB_FX_NODES + i])));
            }
            EUR_FWD3_NODES[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(EUR_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, EUR_FWD3_ID_VALUE[0])));
            for (int i = 0; i < EUR_FWD3_NB_FRA_NODES; i++)
            {
                EUR_FWD3_NODES[i + 1] = FraCurveNode.of(FraTemplate.of(EUR_FWD3_FRA_TENORS[i], EUR_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, EUR_FWD3_ID_VALUE[i + 1])));
            }
            for (int i = 0; i < EUR_FWD3_NB_IRS_NODES; i++)
            {
                EUR_FWD3_NODES[i + 1 + EUR_FWD3_NB_FRA_NODES] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(EUR_FWD3_IRS_TENORS[i]), EUR_FIXED_1Y_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, EUR_FWD3_ID_VALUE[i + 1 + EUR_FWD3_NB_FRA_NODES])));
            }
            ImmutableMarketDataBuilder builder = ImmutableMarketData.builder(VAL_DATE);

            for (int i = 0; i < USD_DSC_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, USD_DSC_ID_VALUE[i])), USD_DSC_MARKET_QUOTES[i]);
            }
            for (int i = 0; i < USD_FWD3_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, USD_FWD3_ID_VALUE[i])), USD_FWD3_MARKET_QUOTES[i]);
            }
            for (int i = 0; i < EUR_DSC_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, EUR_DSC_ID_VALUE[i])), EUR_DSC_MARKET_QUOTES[i]);
            }
            for (int i = 0; i < EUR_FWD3_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, EUR_FWD3_ID_VALUE[i])), EUR_FWD3_MARKET_QUOTES[i]);
            }
            builder.addValue(QuoteId.of(StandardId.of(SCHEME, EUR_USD_ID_VALUE)), FX_RATE_EUR_USD);
            builder.addValue(FxRateId.of(EUR, USD), FxRate.of(EUR, USD, FX_RATE_EUR_USD));
            ALL_QUOTES = builder.build();
        }