Beispiel #1
0
        public static RatesCurveGroupDefinition config(Period[] dscOisTenors, string[] dscIdValues, Period[] fwd3FraTenors, Period[] fwd3IrsTenors, string[] fwd3IdValues, Period[] fwd6FraTenors, Period[] fwd6IrsTenors, string[] fwd6IdValues)
        {
            CurveNode[] dscNodes = new CurveNode[dscOisTenors.Length];
            for (int i = 0; i < dscOisTenors.Length; i++)
            {
                dscNodes[i] = FixedOvernightSwapCurveNode.of(FixedOvernightSwapTemplate.of(Period.ZERO, Tenor.of(dscOisTenors[i]), EUR_FIXED_1Y_EONIA_OIS), QuoteId.of(StandardId.of(SCHEME, dscIdValues[i])));
            }
            CurveNode[] fwd3Nodes = new CurveNode[fwd3IdValues.Length];
            fwd3Nodes[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(EUR_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, fwd3IdValues[0])));
            for (int i = 0; i < fwd3FraTenors.Length; i++)
            {
                fwd3Nodes[i + 1] = FraCurveNode.of(FraTemplate.of(fwd3FraTenors[i], EUR_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, fwd3IdValues[i + 1])));
            }
            for (int i = 0; i < fwd3IrsTenors.Length; i++)
            {
                fwd3Nodes[i + 1 + fwd3FraTenors.Length] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(fwd3IrsTenors[i]), EUR_FIXED_1Y_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, fwd3IdValues[i + 1 + fwd3FraTenors.Length])));
            }
            CurveNode[] fwd6Nodes = new CurveNode[fwd6IdValues.Length];
            fwd6Nodes[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(EUR_EURIBOR_6M), QuoteId.of(StandardId.of(SCHEME, fwd6IdValues[0])));
            for (int i = 0; i < fwd6FraTenors.Length; i++)
            {
                fwd6Nodes[i + 1] = FraCurveNode.of(FraTemplate.of(fwd6FraTenors[i], EUR_EURIBOR_6M), QuoteId.of(StandardId.of(SCHEME, fwd6IdValues[i + 1])));
            }
            for (int i = 0; i < fwd6IrsTenors.Length; i++)
            {
                fwd6Nodes[i + 1 + fwd6FraTenors.Length] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(fwd6IrsTenors[i]), EUR_FIXED_1Y_EURIBOR_6M), QuoteId.of(StandardId.of(SCHEME, fwd6IdValues[i + 1 + fwd6FraTenors.Length])));
            }
            InterpolatedNodalCurveDefinition DSC_CURVE_DEFN  = InterpolatedNodalCurveDefinition.builder().name(DSCON_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).interpolator(INTERPOLATOR_LINEAR).extrapolatorLeft(EXTRAPOLATOR_FLAT).extrapolatorRight(EXTRAPOLATOR_FLAT).nodes(dscNodes).build();
            InterpolatedNodalCurveDefinition FWD3_CURVE_DEFN = InterpolatedNodalCurveDefinition.builder().name(FWD3_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).interpolator(INTERPOLATOR_LINEAR).extrapolatorLeft(EXTRAPOLATOR_FLAT).extrapolatorRight(EXTRAPOLATOR_FLAT).nodes(fwd3Nodes).build();
            InterpolatedNodalCurveDefinition FWD6_CURVE_DEFN = InterpolatedNodalCurveDefinition.builder().name(FWD6_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).interpolator(INTERPOLATOR_LINEAR).extrapolatorLeft(EXTRAPOLATOR_FLAT).extrapolatorRight(EXTRAPOLATOR_FLAT).nodes(fwd6Nodes).build();

            return(RatesCurveGroupDefinition.builder().name(CURVE_GROUP_NAME).addCurve(DSC_CURVE_DEFN, EUR, EUR_EONIA).addForwardCurve(FWD3_CURVE_DEFN, EUR_EURIBOR_3M).addForwardCurve(FWD6_CURVE_DEFN, EUR_EURIBOR_6M).build());
        }
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case -1321546630:         // template
                    this.template_Renamed = (IborFixingDepositTemplate)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);
            }
Beispiel #3
0
        private static CurveNode curveIborFixingDepositCurveNode(string conventionStr, string label, QuoteId quoteId, double spread, CurveNodeDate date, CurveNodeDateOrder order)
        {
            IborFixingDepositConvention convention = IborFixingDepositConvention.of(conventionStr);
            IborFixingDepositTemplate   template   = IborFixingDepositTemplate.of(convention.Index.Tenor.Period, convention);

            return(IborFixingDepositCurveNode.builder().template(template).rateId(quoteId).additionalSpread(spread).label(label).date(date).dateOrder(order).build());
        }
Beispiel #4
0
        static CalibrationDiscountingSimple1Test()
        {
            IBOR_INDICES.Add(USD_LIBOR_3M);
            DSC_NAMES[ALL_CURVE_NAME] = USD;
            IDX_NAMES[ALL_CURVE_NAME] = IBOR_INDICES;
            ALL_NODES[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[0])));
            for (int i = 0; i < FWD3_NB_FRA_NODES; i++)
            {
                ALL_NODES[i + 1] = FraCurveNode.of(FraTemplate.of(FWD3_FRA_TENORS[i], USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[1])));
            }
            for (int i = 0; i < FWD3_NB_IRS_NODES; i++)
            {
                ALL_NODES[i + 1 + FWD3_NB_FRA_NODES] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(FWD3_IRS_TENORS[i]), USD_FIXED_6M_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i])));
            }
            ImmutableMarketDataBuilder builder = ImmutableMarketData.builder(VAL_DATE);

            for (int i = 0; i < FWD3_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i])), FWD3_MARKET_QUOTES[i]);
            }
            ALL_QUOTES = builder.build();
            IList <CurveNode[]> groupNodes = new List <CurveNode[]>();

            groupNodes.Add(ALL_NODES);
            CURVES_NODES.Add(groupNodes);
            IList <CurveMetadata> groupMetadata = new List <CurveMetadata>();

            groupMetadata.Add(DefaultCurveMetadata.builder().curveName(ALL_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).build());
            CURVES_METADATA.Add(groupMetadata);
        }
        static CalibrationZeroRateAndDiscountFactorUsd2OisIrsTest()
        {
            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[FWD3_CURVE_NAME] = usdLibor3Set;
            double fixingValue = 0.002345;
            LocalDateDoubleTimeSeries tsBdUsdLibor3M = LocalDateDoubleTimeSeries.builder().put(VAL_DATE_BD, fixingValue).build();
            LocalDate fixingDateHo = LocalDate.of(2015, 12, 24);
            LocalDateDoubleTimeSeries tsHoUsdLibor3M = LocalDateDoubleTimeSeries.builder().put(fixingDateHo, fixingValue).build();

            TS_BD_LIBOR3M = ImmutableMarketData.builder(VAL_DATE_BD).addTimeSeries(IndexQuoteId.of(USD_LIBOR_3M), tsBdUsdLibor3M).build();
            TS_HO_LIBOR3M = ImmutableMarketData.builder(VAL_DATE_HO).addTimeSeries(IndexQuoteId.of(USD_LIBOR_3M), tsHoUsdLibor3M).build();
            for (int i = 0; i < DSC_NB_OIS_NODES; i++)
            {
                DSC_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[i])));
            }
            FWD3_NODES[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[0])));
            for (int i = 0; i < FWD3_NB_FRA_NODES; i++)
            {
                FWD3_NODES[i + 1] = FraCurveNode.of(FraTemplate.of(FWD3_FRA_TENORS[i], USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i + 1])));
            }
            for (int i = 0; i < FWD3_NB_IRS_NODES; i++)
            {
                FWD3_NODES[i + 1 + FWD3_NB_FRA_NODES] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(FWD3_IRS_TENORS[i]), USD_FIXED_6M_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i + 1 + FWD3_NB_FRA_NODES])));
            }
            ImmutableMarketDataBuilder builder = ImmutableMarketData.builder(VAL_DATE_BD);

            for (int i = 0; i < FWD3_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i])), FWD3_MARKET_QUOTES[i]);
            }
            for (int i = 0; i < DSC_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, DSC_ID_VALUE[i])), DSC_MARKET_QUOTES[i]);
            }
            ALL_QUOTES_BD = builder.build();
            IList <CurveNode[]> groupDsc = new List <CurveNode[]>();

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

            groupFwd3.Add(FWD3_NODES);
            CURVES_NODES.Add(groupFwd3);
            IList <CurveMetadata> groupDsc = new List <CurveMetadata>();

            groupDsc.Add(DefaultCurveMetadata.builder().curveName(DSCON_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).build());
            CURVES_METADATA.Add(groupDsc);
            IList <CurveMetadata> groupFwd3 = new List <CurveMetadata>();

            groupFwd3.Add(DefaultCurveMetadata.builder().curveName(FWD3_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).build());
            CURVES_METADATA.Add(groupFwd3);
        }
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(IborFixingDepositCurveNode 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;
 }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            IborFixingDepositCurveNode test = IborFixingDepositCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD);

            coverImmutableBean(test);
            IborFixingDepositCurveNode test2 = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(GBP_LIBOR_6M), QuoteId.of(StandardId.of("OG-Ticker", "Deposit2")));

            coverBeanEquals(test, test2);
        }
        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();
        }
 private IborFixingDepositCurveNode(IborFixingDepositTemplate 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;
 }
        static CalibrationDiscountFactorUsd2FomcDatesOisIrsTest()
        {
            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[FWD3_CURVE_NAME] = usdLibor3Set;
            double fixingValue = 0.002345;
            LocalDateDoubleTimeSeries tsBdUsdLibor3M = LocalDateDoubleTimeSeries.builder().put(VAL_DATE_BD, fixingValue).build();

            TS_BD_LIBOR3M = ImmutableMarketData.builder(VAL_DATE_BD).addTimeSeries(IndexQuoteId.of(USD_LIBOR_3M), tsBdUsdLibor3M).build();
            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));
                LocalDate             nodeDate   = FOMC_NODES[i];
                if (nodeDate != null)
                {
                    DSC_NODES[i] = TermDepositCurveNode.builder().template(TermDepositTemplate.of(Period.ofDays(1), convention)).rateId(QuoteId.of(StandardId.of(SCHEME, DSC_ID_VALUE[i]))).date(CurveNodeDate.of(nodeDate)).build();
                }
                else
                {
                    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++)
            {
                LocalDate nodeDate = FOMC_NODES[DSC_NB_DEPO_NODES + i];
                if (nodeDate != null)
                {
                    DSC_NODES[DSC_NB_DEPO_NODES + i] = FixedOvernightSwapCurveNode.builder().template(FixedOvernightSwapTemplate.of(Period.ZERO, Tenor.of(DSC_OIS_TENORS[i]), USD_FIXED_1Y_FED_FUND_OIS)).rateId(QuoteId.of(StandardId.of(SCHEME, DSC_ID_VALUE[DSC_NB_DEPO_NODES + i]))).date(CurveNodeDate.of(nodeDate)).build();
                }
                else
                {
                    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])));
                }
            }
            FWD3_NODES[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[0])));
            for (int i = 0; i < FWD3_NB_FRA_NODES; i++)
            {
                FWD3_NODES[i + 1] = FraCurveNode.of(FraTemplate.of(FWD3_FRA_TENORS[i], USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i + 1])));
            }
            for (int i = 0; i < FWD3_NB_IRS_NODES; i++)
            {
                FWD3_NODES[i + 1 + FWD3_NB_FRA_NODES] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(FWD3_IRS_TENORS[i]), USD_FIXED_6M_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i + 1 + FWD3_NB_FRA_NODES])));
            }
            ImmutableMarketDataBuilder builder = ImmutableMarketData.builder(VAL_DATE_BD);

            for (int i = 0; i < FWD3_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i])), FWD3_MARKET_QUOTES[i]);
            }
            for (int i = 0; i < DSC_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, DSC_ID_VALUE[i])), DSC_MARKET_QUOTES[i]);
            }
            ALL_QUOTES_BD = builder.build();
            IList <CurveNode[]> groupDsc = new List <CurveNode[]>();

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

            groupFwd3.Add(FWD3_NODES);
            CURVES_NODES.Add(groupFwd3);
            IList <CurveMetadata> groupDsc = new List <CurveMetadata>();

            groupDsc.Add(DefaultCurveMetadata.builder().curveName(DSCON_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).build());
            CURVES_METADATA.Add(groupDsc);
            IList <CurveMetadata> groupFwd3 = new List <CurveMetadata>();

            groupFwd3.Add(DefaultCurveMetadata.builder().curveName(FWD3_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).build());
            CURVES_METADATA.Add(groupFwd3);
        }
 //-----------------------------------------------------------------------
 /// <summary>
 /// Sets the template for the Ibor fixing deposit associated with this node. </summary>
 /// <param name="template">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder template(IborFixingDepositTemplate template)
 {
     JodaBeanUtils.notNull(template, "template");
     this.template_Renamed = template;
     return(this);
 }
 /// <summary>
 /// Returns a curve node for an Ibor deposit using the specified 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, 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 IborFixingDepositCurveNode of(IborFixingDepositTemplate template, ObservableId rateId, double additionalSpread, string label)
 {
     return(new IborFixingDepositCurveNode(template, rateId, additionalSpread, label, CurveNodeDate.END, CurveNodeDateOrder.DEFAULT));
 }
 /// <summary>
 /// Returns a curve node for an Ibor deposit using the specified 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 IborFixingDepositCurveNode of(IborFixingDepositTemplate template, ObservableId rateId, double additionalSpread)
 {
     return(builder().template(template).rateId(rateId).additionalSpread(additionalSpread).build());
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Returns a curve node for an Ibor deposit using the specified 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 IborFixingDepositCurveNode of(IborFixingDepositTemplate template, ObservableId rateId)
 {
     return(of(template, rateId, 0d));
 }
Beispiel #15
0
        static CalibrationZeroRateUsd3OisIrsBsTest()
        {
            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[FWD3_CURVE_NAME] = usdLibor3Set;
            ISet <Index> usdLibor6Set = new HashSet <Index>();

            usdLibor6Set.Add(USD_LIBOR_6M);
            IDX_NAMES[FWD6_CURVE_NAME] = usdLibor6Set;
            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])));
            }
            FWD3_NODES[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[0])));
            for (int i = 0; i < FWD3_NB_FRA_NODES; i++)
            {
                FWD3_NODES[i + 1] = FraCurveNode.of(FraTemplate.of(FWD3_FRA_TENORS[i], USD_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i + 1])));
            }
            for (int i = 0; i < FWD3_NB_IRS_NODES; i++)
            {
                FWD3_NODES[i + 1 + FWD3_NB_FRA_NODES] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(FWD3_IRS_TENORS[i]), USD_FIXED_6M_LIBOR_3M), QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i + 1 + FWD3_NB_FRA_NODES])));
            }
            FWD6_NODES[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(USD_LIBOR_6M), QuoteId.of(StandardId.of(SCHEME, FWD6_ID_VALUE[0])));
            for (int i = 0; i < FWD6_NB_FRA_NODES; i++)
            {
                FWD6_NODES[i + 1] = FraCurveNode.of(FraTemplate.of(FWD6_FRA_TENORS[i], USD_LIBOR_6M), QuoteId.of(StandardId.of(SCHEME, FWD6_ID_VALUE[i + 1])));
            }
            for (int i = 0; i < FWD6_NB_IRS_NODES; i++)
            {
                FWD6_NODES[i + 1 + FWD6_NB_FRA_NODES] = IborIborSwapCurveNode.of(IborIborSwapTemplate.of(Period.ZERO, Tenor.of(FWD6_IRS_TENORS[i]), USD_LIBOR_3M_LIBOR_6M), QuoteId.of(StandardId.of(SCHEME, FWD6_ID_VALUE[i + 1 + FWD6_NB_FRA_NODES])));
            }
            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 < FWD3_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, FWD3_ID_VALUE[i])), FWD3_MARKET_QUOTES[i]);
            }
            for (int i = 0; i < FWD6_NB_NODES; i++)
            {
                builder.addValue(QuoteId.of(StandardId.of(SCHEME, FWD6_ID_VALUE[i])), FWD6_MARKET_QUOTES[i]);
            }
            ALL_QUOTES = builder.build();
            IList <CurveNode[]> groupDsc = new List <CurveNode[]>();

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

            groupFwd3.Add(FWD3_NODES);
            CURVES_NODES.Add(groupFwd3);
            IList <CurveNode[]> groupFwd6 = new List <CurveNode[]>();

            groupFwd6.Add(FWD6_NODES);
            CURVES_NODES.Add(groupFwd6);
            IList <CurveMetadata> groupDsc = new List <CurveMetadata>();

            groupDsc.Add(DefaultCurveMetadata.builder().curveName(DSCON_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).build());
            CURVES_METADATA.Add(groupDsc);
            IList <CurveMetadata> groupFwd3 = new List <CurveMetadata>();

            groupFwd3.Add(DefaultCurveMetadata.builder().curveName(FWD3_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).build());
            CURVES_METADATA.Add(groupFwd3);
            IList <CurveMetadata> groupFwd6 = new List <CurveMetadata>();

            groupFwd6.Add(DefaultCurveMetadata.builder().curveName(FWD6_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).build());
            CURVES_METADATA.Add(groupFwd6);
        }