public virtual void test_currencyExposureOnFixing_noTimeSeries() { double eps = 1.0e-14; LocalDate valuationDate = date(2014, 6, 27); LocalDate paymentDate = date(2014, 7, 1); LocalDate fixingDate = date(2014, 6, 27); FxResetNotionalExchange resetNotionalUSD = FxResetNotionalExchange.of(CurrencyAmount.of(USD, NOTIONAL), paymentDate, FxIndexObservation.of(GBP_USD_WM, fixingDate, REF_DATA)); FxResetNotionalExchange resetNotionalGBP = FxResetNotionalExchange.of(CurrencyAmount.of(GBP, -NOTIONAL), paymentDate, FxIndexObservation.of(GBP_USD_WM, fixingDate, REF_DATA)); ImmutableRatesProvider prov = ImmutableRatesProvider.builder(valuationDate).fxRateProvider(FX_MATRIX).discountCurve(GBP, DISCOUNT_CURVE_GBP).discountCurve(USD, DISCOUNT_CURVE_USD).build(); DiscountingFxResetNotionalExchangePricer test = new DiscountingFxResetNotionalExchangePricer(); // USD MultiCurrencyAmount computedUSD = test.currencyExposure(resetNotionalUSD, prov); PointSensitivities pointUSD = test.presentValueSensitivity(resetNotionalUSD, prov).build(); MultiCurrencyAmount expectedUSD = prov.currencyExposure(pointUSD.convertedTo(USD, prov)).plus(CurrencyAmount.of(resetNotionalUSD.Currency, test.presentValue(resetNotionalUSD, prov))); assertFalse(computedUSD.contains(GBP)); // 0 GBP assertEquals(computedUSD.getAmount(USD).Amount, expectedUSD.getAmount(USD).Amount, eps * NOTIONAL); // GBP MultiCurrencyAmount computedGBP = test.currencyExposure(resetNotionalGBP, prov); PointSensitivities pointGBP = test.presentValueSensitivity(resetNotionalGBP, prov).build(); MultiCurrencyAmount expectedGBP = prov.currencyExposure(pointGBP.convertedTo(GBP, prov)).plus(CurrencyAmount.of(resetNotionalGBP.Currency, test.presentValue(resetNotionalGBP, prov))); assertFalse(computedGBP.contains(USD)); // 0 USD assertEquals(computedGBP.getAmount(GBP).Amount, expectedGBP.getAmount(GBP).Amount, eps * NOTIONAL); // FD approximation FxMatrix fxMatrixUp = FxMatrix.of(GBP, USD, FX_RATE + EPS_FD); ImmutableRatesProvider provUp = ImmutableRatesProvider.builder(valuationDate).fxRateProvider(fxMatrixUp).discountCurve(GBP, DISCOUNT_CURVE_GBP).discountCurve(USD, DISCOUNT_CURVE_USD).build(); double expectedFdUSD = -(test.presentValue(resetNotionalUSD, provUp) - test.presentValue(resetNotionalUSD, prov)) * FX_RATE * FX_RATE / EPS_FD; assertEquals(computedUSD.getAmount(USD).Amount, expectedFdUSD, EPS_FD * NOTIONAL); double expectedFdGBP = (test.presentValue(resetNotionalGBP, provUp) - test.presentValue(resetNotionalGBP, prov)) / EPS_FD; assertEquals(computedGBP.getAmount(GBP).Amount, expectedFdGBP, EPS_FD * NOTIONAL); }
//------------------------------------------------------------------------- public virtual void test_currencyExposure() { double eps = 1.0e-14; ImmutableRatesProvider prov = ImmutableRatesProvider.builder(VAL_DATE).fxRateProvider(FX_MATRIX).discountCurve(GBP, DISCOUNT_CURVE_GBP).discountCurve(USD, DISCOUNT_CURVE_USD).build(); DiscountingFxResetNotionalExchangePricer test = new DiscountingFxResetNotionalExchangePricer(); // USD MultiCurrencyAmount computedUSD = test.currencyExposure(FX_RESET_NOTIONAL_EXCHANGE_REC_USD, prov); PointSensitivities pointUSD = test.presentValueSensitivity(FX_RESET_NOTIONAL_EXCHANGE_REC_USD, prov).build(); MultiCurrencyAmount expectedUSD = prov.currencyExposure(pointUSD.convertedTo(USD, prov)).plus(CurrencyAmount.of(FX_RESET_NOTIONAL_EXCHANGE_REC_USD.Currency, test.presentValue(FX_RESET_NOTIONAL_EXCHANGE_REC_USD, prov))); assertFalse(computedUSD.contains(GBP)); // 0 GBP assertEquals(computedUSD.getAmount(USD).Amount, expectedUSD.getAmount(USD).Amount, eps * NOTIONAL); // GBP MultiCurrencyAmount computedGBP = test.currencyExposure(FX_RESET_NOTIONAL_EXCHANGE_PAY_GBP, prov); PointSensitivities pointGBP = test.presentValueSensitivity(FX_RESET_NOTIONAL_EXCHANGE_PAY_GBP, prov).build(); MultiCurrencyAmount expectedGBP = prov.currencyExposure(pointGBP.convertedTo(GBP, prov)).plus(CurrencyAmount.of(FX_RESET_NOTIONAL_EXCHANGE_PAY_GBP.Currency, test.presentValue(FX_RESET_NOTIONAL_EXCHANGE_PAY_GBP, prov))); assertFalse(computedGBP.contains(USD)); // 0 USD assertEquals(computedGBP.getAmount(GBP).Amount, expectedGBP.getAmount(GBP).Amount, eps * NOTIONAL); // FD approximation FxMatrix fxMatrixUp = FxMatrix.of(GBP, USD, FX_RATE + EPS_FD); ImmutableRatesProvider provUp = ImmutableRatesProvider.builder(VAL_DATE).fxRateProvider(fxMatrixUp).discountCurve(GBP, DISCOUNT_CURVE_GBP).discountCurve(USD, DISCOUNT_CURVE_USD).build(); double expectedFdUSD = -(test.presentValue(FX_RESET_NOTIONAL_EXCHANGE_REC_USD, provUp) - test.presentValue(FX_RESET_NOTIONAL_EXCHANGE_REC_USD, prov)) * FX_RATE * FX_RATE / EPS_FD; assertEquals(computedUSD.getAmount(USD).Amount, expectedFdUSD, EPS_FD * NOTIONAL); double expectedFdGBP = (test.presentValue(FX_RESET_NOTIONAL_EXCHANGE_PAY_GBP, provUp) - test.presentValue(FX_RESET_NOTIONAL_EXCHANGE_PAY_GBP, prov)) / EPS_FD; assertEquals(computedGBP.getAmount(GBP).Amount, expectedFdGBP, EPS_FD * NOTIONAL); }
public virtual void test_currentCash_zero() { ImmutableRatesProvider prov = ImmutableRatesProvider.builder(VAL_DATE).discountCurve(GBP, DISCOUNT_CURVE_GBP).build(); DiscountingNotionalExchangePricer test = DiscountingNotionalExchangePricer.DEFAULT; double computed = test.currentCash(NOTIONAL_EXCHANGE_REC_GBP, prov); assertEquals(computed, 0d); }
public virtual void test_currentCash_zero() { ImmutableRatesProvider prov = ImmutableRatesProvider.builder(VAL_DATE).fxRateProvider(FX_MATRIX).discountCurve(GBP, DISCOUNT_CURVE_GBP).discountCurve(USD, DISCOUNT_CURVE_USD).build(); DiscountingFxResetNotionalExchangePricer test = new DiscountingFxResetNotionalExchangePricer(); double cc = test.currentCash(FX_RESET_NOTIONAL_EXCHANGE_REC_USD, prov); assertEquals(cc, 0d); }
//------------------------------------------------------------------------- /// <summary> /// Calibrates a single curve group, containing one or more curves. /// <para> /// The calibration is defined using <seealso cref="RatesCurveGroupDefinition"/>. /// Observable market data, time-series and FX are also needed to complete the calibration. /// The valuation date is defined by the market data. /// </para> /// <para> /// The Jacobian matrices are computed and stored in curve metadata. /// /// </para> /// </summary> /// <param name="curveGroupDefn"> the curve group definition </param> /// <param name="marketData"> the market data required to build a trade for the instrument, including time-series </param> /// <param name="refData"> the reference data, used to resolve the trades </param> /// <returns> the rates provider resulting from the calibration </returns> public ImmutableRatesProvider calibrate(RatesCurveGroupDefinition curveGroupDefn, MarketData marketData, ReferenceData refData) { //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: IDictionary <Index, LocalDateDoubleTimeSeries> timeSeries = marketData.TimeSeriesIds.Where(typeof(IndexQuoteId).isInstance).Select(typeof(IndexQuoteId).cast).collect(toImmutableMap(id => id.Index, id => marketData.getTimeSeries(id))); ImmutableRatesProvider knownData = ImmutableRatesProvider.builder(marketData.ValuationDate).fxRateProvider(MarketDataFxRateProvider.of(marketData)).timeSeries(timeSeries).build(); return(calibrate(ImmutableList.of(curveGroupDefn), knownData, marketData, refData)); }
public virtual void test_currentCash_onPayment() { ImmutableRatesProvider prov = ImmutableRatesProvider.builder(NOTIONAL_EXCHANGE_REC_GBP.PaymentDate).discountCurve(GBP, DISCOUNT_CURVE_GBP).build(); DiscountingNotionalExchangePricer test = DiscountingNotionalExchangePricer.DEFAULT; double notional = NOTIONAL_EXCHANGE_REC_GBP.PaymentAmount.Amount; double computed = test.currentCash(NOTIONAL_EXCHANGE_REC_GBP, prov); assertEquals(computed, notional); }
//------------------------------------------------------------------------- public virtual void test_currencyExposure() { ImmutableRatesProvider prov = ImmutableRatesProvider.builder(VAL_DATE).discountCurve(GBP, DISCOUNT_CURVE_GBP).build(); DiscountingNotionalExchangePricer test = DiscountingNotionalExchangePricer.DEFAULT; MultiCurrencyAmount computed = test.currencyExposure(NOTIONAL_EXCHANGE_REC_GBP, prov); PointSensitivities point = test.presentValueSensitivity(NOTIONAL_EXCHANGE_REC_GBP, prov).build(); MultiCurrencyAmount expected = prov.currencyExposure(point).plus(CurrencyAmount.of(NOTIONAL_EXCHANGE_REC_GBP.Currency, test.presentValue(NOTIONAL_EXCHANGE_REC_GBP, prov))); assertEquals(computed, expected); }
static DiscountingFraProductPricerTest() { CurveInterpolator interp = CurveInterpolators.DOUBLE_QUADRATIC; DoubleArray time_gbp = DoubleArray.of(0.0, 0.1, 0.25, 0.5, 0.75, 1.0, 2.0); DoubleArray rate_gbp = DoubleArray.of(0.0160, 0.0165, 0.0155, 0.0155, 0.0155, 0.0150, 0.014); InterpolatedNodalCurve dscCurve = InterpolatedNodalCurve.of(Curves.zeroRates("GBP-Discount", DAY_COUNT), time_gbp, rate_gbp, interp); DoubleArray time_index = DoubleArray.of(0.0, 0.25, 0.5, 1.0); DoubleArray rate_index = DoubleArray.of(0.0180, 0.0180, 0.0175, 0.0165); InterpolatedNodalCurve indexCurve = InterpolatedNodalCurve.of(Curves.zeroRates("GBP-GBPIBOR3M", DAY_COUNT), time_index, rate_index, interp); IMM_PROV = ImmutableRatesProvider.builder(VAL_DATE).discountCurve(GBP, dscCurve).iborIndexCurve(GBP_LIBOR_3M, indexCurve).build(); }
public virtual void test_currentCash_onPayment() { double eps = 1.0e-14; ImmutableRatesProvider prov = ImmutableRatesProvider.builder(FX_RESET_NOTIONAL_EXCHANGE_REC_USD.PaymentDate).fxRateProvider(FX_MATRIX).discountCurve(GBP, DISCOUNT_CURVE_GBP).discountCurve(USD, DISCOUNT_CURVE_USD).build(); DiscountingFxResetNotionalExchangePricer test = new DiscountingFxResetNotionalExchangePricer(); double rate = prov.fxIndexRates(FX_RESET_NOTIONAL_EXCHANGE_REC_USD.Observation.Index).rate(FX_RESET_NOTIONAL_EXCHANGE_REC_USD.Observation, FX_RESET_NOTIONAL_EXCHANGE_REC_USD.ReferenceCurrency); double ccUSD = test.currentCash(FX_RESET_NOTIONAL_EXCHANGE_REC_USD, prov); assertEquals(ccUSD, NOTIONAL * rate, eps); double ccGBP = test.currentCash(FX_RESET_NOTIONAL_EXCHANGE_PAY_GBP, prov); assertEquals(ccGBP, -NOTIONAL / rate, eps); }
static CurveSensitivityUtilsJacobianTest() { Tenor[] tenors = new Tenor[] { Tenor.TENOR_1D, Tenor.TENOR_1M, Tenor.TENOR_3M, Tenor.TENOR_6M, Tenor.TENOR_1Y, Tenor.TENOR_2Y, Tenor.TENOR_3Y, Tenor.TENOR_4Y, Tenor.TENOR_5Y, Tenor.TENOR_7Y, Tenor.TENOR_10Y, Tenor.TENOR_15Y, Tenor.TENOR_20Y, Tenor.TENOR_30Y }; IList <TenorParameterMetadata> metadataList = new List <TenorParameterMetadata>(); for (int looptenor = 0; looptenor < tenors.Length; looptenor++) { metadataList.Add(TenorParameterMetadata.of(tenors[looptenor])); } DoubleArray rate_eur = DoubleArray.of(0.0160, 0.0165, 0.0155, 0.0155, 0.0155, 0.0150, 0.0150, 0.0160, 0.0165, 0.0155, 0.0155, 0.0155, 0.0150, 0.0140); InterpolatedNodalCurve curve_single_eur = InterpolatedNodalCurve.builder().metadata(DefaultCurveMetadata.builder().curveName(EUR_SINGLE_NAME).parameterMetadata(metadataList).dayCount(ACT_365F).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).build()).xValues(TIME_EUR).yValues(rate_eur).extrapolatorLeft(CurveExtrapolators.FLAT).extrapolatorRight(CurveExtrapolators.FLAT).interpolator(CurveInterpolators.LINEAR).build(); MULTICURVE_EUR_SINGLE_INPUT = ImmutableRatesProvider.builder(VALUATION_DATE).discountCurve(EUR, curve_single_eur).iborIndexCurve(EUR_EURIBOR_6M, curve_single_eur).build(); LIST_CURVE_NAMES_1.Add(CurveParameterSize.of(EUR_SINGLE_NAME, TIME_EUR.size())); }
//------------------------------------------------------------------------- public virtual void test_forecastValueSensitivity() { ImmutableRatesProvider prov = ImmutableRatesProvider.builder(VAL_DATE).fxRateProvider(FX_MATRIX).discountCurve(GBP, DISCOUNT_CURVE_GBP).discountCurve(USD, DISCOUNT_CURVE_USD).build(); FxResetNotionalExchange[] expanded = new FxResetNotionalExchange[] { FX_RESET_NOTIONAL_EXCHANGE_REC_USD, FX_RESET_NOTIONAL_EXCHANGE_PAY_GBP }; for (int i = 0; i < 2; ++i) { FxResetNotionalExchange fxReset = expanded[i]; DiscountingFxResetNotionalExchangePricer test = new DiscountingFxResetNotionalExchangePricer(); PointSensitivityBuilder pointSensitivityComputed = test.forecastValueSensitivity(expanded[i], prov); CurrencyParameterSensitivities parameterSensitivityComputed = prov.parameterSensitivity(pointSensitivityComputed.build()); CurrencyParameterSensitivities parameterSensitivityExpected = FD_CALCULATOR.sensitivity(prov, (p) => CurrencyAmount.of(fxReset.Currency, test.forecastValue(fxReset, (p)))); assertTrue(parameterSensitivityComputed.equalWithTolerance(parameterSensitivityExpected, Math.Abs(expanded[i].Notional) * EPS_FD * 10.0)); } }
public virtual void test_ratesProvider() { ImmutableMap <Currency, CurveId> discounts = ImmutableMap.of(USD, CURVE_ID_DSC); ImmutableMap <Index, CurveId> forwards = ImmutableMap.of(USD_FED_FUND, CURVE_ID_DSC, USD_LIBOR_3M, CURVE_ID_FWD, US_CPI_U, CURVE_ID_FWD); RatesMarketDataLookup test = RatesMarketDataLookup.of(discounts, forwards); LocalDate valDate = date(2015, 6, 30); Curve dscCurve = ConstantCurve.of(Curves.discountFactors(CURVE_ID_DSC.CurveName, ACT_360), 1d); Curve fwdCurve = ConstantCurve.of(Curves.discountFactors(CURVE_ID_FWD.CurveName, ACT_360), 2d); MarketData md = ImmutableMarketData.of(valDate, ImmutableMap.of(CURVE_ID_DSC, dscCurve, CURVE_ID_FWD, fwdCurve)); RatesProvider ratesProvider = test.ratesProvider(md); assertEquals(ratesProvider.ValuationDate, valDate); assertEquals(ratesProvider.findData(CURVE_ID_DSC.CurveName), dscCurve); assertEquals(ratesProvider.findData(CURVE_ID_FWD.CurveName), fwdCurve); assertEquals(ratesProvider.findData(CurveName.of("Rubbish")), null); assertEquals(ratesProvider.IborIndices, ImmutableSet.of(USD_LIBOR_3M)); assertEquals(ratesProvider.OvernightIndices, ImmutableSet.of(USD_FED_FUND)); assertEquals(ratesProvider.PriceIndices, ImmutableSet.of(US_CPI_U)); assertEquals(ratesProvider.TimeSeriesIndices, ImmutableSet.of()); // check discount factors SimpleDiscountFactors df = (SimpleDiscountFactors)ratesProvider.discountFactors(USD); assertEquals(df.Curve.Name, dscCurve.Name); assertThrowsIllegalArg(() => ratesProvider.discountFactors(GBP)); // check Ibor DiscountIborIndexRates ibor = (DiscountIborIndexRates)ratesProvider.iborIndexRates(USD_LIBOR_3M); SimpleDiscountFactors iborDf = (SimpleDiscountFactors)ibor.DiscountFactors; assertEquals(iborDf.Curve.Name, fwdCurve.Name); assertThrowsIllegalArg(() => ratesProvider.iborIndexRates(GBP_LIBOR_3M)); // check Overnight DiscountOvernightIndexRates on = (DiscountOvernightIndexRates)ratesProvider.overnightIndexRates(USD_FED_FUND); SimpleDiscountFactors onDf = (SimpleDiscountFactors)on.DiscountFactors; assertEquals(onDf.Curve.Name, dscCurve.Name); assertThrowsIllegalArg(() => ratesProvider.overnightIndexRates(GBP_SONIA)); // check price curve must be interpolated assertThrowsIllegalArg(() => ratesProvider.priceIndexValues(US_CPI_U)); // to immutable ImmutableRatesProvider expectedImmutable = ImmutableRatesProvider.builder(valDate).fxRateProvider(MarketDataFxRateProvider.of(md)).discountCurve(USD, dscCurve).indexCurve(USD_FED_FUND, dscCurve).indexCurve(USD_LIBOR_3M, fwdCurve).indexCurve(US_CPI_U, fwdCurve).build(); assertEquals(ratesProvider.toImmutableRatesProvider(), expectedImmutable); }
/// <summary> /// Test parameter sensitivity with finite difference sensitivity calculator. No cutoff period. </summary> public virtual void rateChfNoCutOffParameterSensitivity() { LocalDate[] valuationDate = new LocalDate[] { date(2015, 1, 1), date(2015, 1, 8) }; DoubleArray time = DoubleArray.of(0.0, 0.5, 1.0, 2.0, 5.0, 10.0); DoubleArray rate = DoubleArray.of(0.0100, 0.0110, 0.0115, 0.0130, 0.0135, 0.0135); for (int loopvaldate = 0; loopvaldate < 2; loopvaldate++) { Curve onCurve = InterpolatedNodalCurve.of(Curves.zeroRates("ON", ACT_ACT_ISDA), time, rate, INTERPOLATOR); ImmutableRatesProvider prov = ImmutableRatesProvider.builder(valuationDate[loopvaldate]).overnightIndexCurve(CHF_TOIS, onCurve, TIME_SERIES).build(); OvernightAveragedRateComputation ro = OvernightAveragedRateComputation.of(CHF_TOIS, START_DATE, END_DATE, 0, REF_DATA); ForwardOvernightAveragedRateComputationFn obsFn = ForwardOvernightAveragedRateComputationFn.DEFAULT; PointSensitivityBuilder sensitivityBuilderComputed = obsFn.rateSensitivity(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, prov); CurrencyParameterSensitivities parameterSensitivityComputed = prov.parameterSensitivity(sensitivityBuilderComputed.build()); CurrencyParameterSensitivities parameterSensitivityExpected = CAL_FD.sensitivity(prov, (p) => CurrencyAmount.of(CHF_TOIS.Currency, obsFn.rate(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, (p)))); assertTrue(parameterSensitivityComputed.equalWithTolerance(parameterSensitivityExpected, EPS_FD * 10.0)); } }
public static ImmutableRatesProvider singleUsd(LocalDate valDate) { return(ImmutableRatesProvider.builder(valDate).fxRateProvider(FX_MATRIX_USD).discountCurve(USD, USD_SINGLE_CURVE).overnightIndexCurve(USD_FED_FUND, USD_SINGLE_CURVE).iborIndexCurve(USD_LIBOR_3M, USD_SINGLE_CURVE).iborIndexCurve(USD_LIBOR_6M, USD_SINGLE_CURVE).build()); }
//------------------------------------------------------------------------- /// <summary> /// Obtains {@code ImmutableRatesProvider} for specified valuation date. /// </summary> /// <param name="valuationDate"> the valuation date </param> /// <param name="index"> the index </param> /// <param name="timeSeries"> the time series </param> /// <returns> the rates provider </returns> public static ImmutableRatesProvider getRatesProvider(LocalDate valuationDate, IborIndex index, LocalDateDoubleTimeSeries timeSeries) { return(ImmutableRatesProvider.builder(valuationDate).discountCurve(EUR, EUR_DSC_CURVE).iborIndexCurve(index, EUR_FWD_CURVE).timeSeries(index, timeSeries).build()); }
/// <summary> /// Obtains {@code ImmutableRatesProvider} for specified valuation date and time series of swap index. /// </summary> /// <param name="valuationDate"> the valuation date </param> /// <param name="timeSeries"> the time series </param> /// <returns> the rates provider </returns> public static ImmutableRatesProvider getRatesProviderEur(LocalDate valuationDate, LocalDateDoubleTimeSeries timeSeries) { return(ImmutableRatesProvider.builder(valuationDate).discountCurve(EUR, CURVE_DSC_EUR).iborIndexCurve(EUR_EURIBOR_6M, CURVE_FWD_EUR).timeSeries(EUR_EURIBOR_1100_5Y, timeSeries).build()); }
/// <summary> /// Obtains {@code ImmutableRatesProvider} for specified valuation date. /// </summary> /// <param name="valuationDate"> the valuation date </param> /// <returns> the rates provider </returns> public static ImmutableRatesProvider getRatesProviderEur(LocalDate valuationDate) { return(ImmutableRatesProvider.builder(valuationDate).discountCurve(EUR, CURVE_DSC_EUR).iborIndexCurve(EUR_EURIBOR_6M, CURVE_FWD_EUR).build()); }
/// <summary> /// Obtains {@code ImmutableRatesProvider} for specified valuation date. /// </summary> /// <param name="valuationDate"> the valuation date </param> /// <returns> the rates provider </returns> public static ImmutableRatesProvider getRatesProviderUsd(LocalDate valuationDate) { return(ImmutableRatesProvider.builder(valuationDate).discountCurve(USD, CURVE_DSC_USD).iborIndexCurve(USD_LIBOR_3M, CURVE_FWD_USD).build()); }
public static ImmutableRatesProvider multiUsd(LocalDate valDate) { return(ImmutableRatesProvider.builder(valDate).fxRateProvider(FX_MATRIX_USD).discountCurve(USD, USD_DSC).overnightIndexCurve(USD_FED_FUND, USD_DSC).iborIndexCurve(USD_LIBOR_3M, USD_L3).iborIndexCurve(USD_LIBOR_6M, USD_L6).build()); }
public static ImmutableRatesProvider multiGbp(LocalDate valDate) { return(ImmutableRatesProvider.builder(valDate).fxRateProvider(FX_MATRIX_GBP).discountCurve(GBP, GBP_DSC).overnightIndexCurve(GBP_SONIA, GBP_DSC).iborIndexCurve(GBP_LIBOR_3M, GBP_L3).iborIndexCurve(GBP_LIBOR_6M, GBP_L6).build()); }
public static ImmutableRatesProvider multiEur(LocalDate valDate) { return(ImmutableRatesProvider.builder(valDate).fxRateProvider(FX_MATRIX_EUR).discountCurve(EUR, EUR_DSC).overnightIndexCurve(EUR_EONIA, EUR_DSC).iborIndexCurve(EUR_EURIBOR_3M, EUR_L3).iborIndexCurve(EUR_EURIBOR_6M, EUR_L6).build()); }
public static ImmutableRatesProvider multiGbpUsdSimple(LocalDate valDate) { return(ImmutableRatesProvider.builder(valDate).fxRateProvider(FX_MATRIX_GBP_USD).discountCurve(GBP, GBP_DSC_SIMPLE).discountCurve(USD, USD_DSC_SIMPLE).overnightIndexCurve(GBP_SONIA, GBP_DSC_SIMPLE).iborIndexCurve(GBP_LIBOR_3M, GBP_L3_SIMPLE).iborIndexCurve(GBP_LIBOR_6M, GBP_L6_SIMPLE).overnightIndexCurve(USD_FED_FUND, USD_DSC_SIMPLE).iborIndexCurve(USD_LIBOR_3M, USD_L3_SIMPLE).iborIndexCurve(USD_LIBOR_6M, USD_L6_SIMPLE).build()); }
// rates provider internal static RatesProvider provider() { // StandardDataSets.providerUsdDscOnL1L3L6() with locked holidays and time-series return(ImmutableRatesProvider.builder(VAL_DATE).fxRateProvider(StandardDataSets.FX_MATRIX).discountCurve(USD, StandardDataSets.GROUP1_USD_DSC).overnightIndexCurve(USD_FED_FUND, StandardDataSets.GROUP1_USD_ON, TS_USDON).iborIndexCurve(USD_LIBOR_1M, StandardDataSets.GROUP1_USD_L1M, TS_USDLIBOR1M).iborIndexCurve(USD_LIBOR_3M, StandardDataSets.GROUP1_USD_L3M, TS_USDLIBOR3M).iborIndexCurve(USD_LIBOR_6M, StandardDataSets.GROUP1_USD_L6M, TS_USDLIBOR6M).build()); }