//-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ImmutableMap <SecurityId, RepoGroup>               repoSecurityGroups = ImmutableMap.of(SEC_A1, GROUP_REPO_X);
            ImmutableMap <LegalEntityId, RepoGroup>            repoGroups         = ImmutableMap.of(ISSUER_A, GROUP_REPO_Y, ISSUER_B, GROUP_REPO_Y);
            ImmutableMap <Pair <RepoGroup, Currency>, CurveId> repoCurves         = ImmutableMap.of(Pair.of(GROUP_REPO_X, USD), CURVE_ID_USD1, Pair.of(GROUP_REPO_Y, USD), CURVE_ID_USD2, Pair.of(GROUP_REPO_Y, GBP), CURVE_ID_GBP1);

            ImmutableMap <LegalEntityId, LegalEntityGroup>            issuerGroups = ImmutableMap.of(ISSUER_A, GROUP_ISSUER_M, ISSUER_B, GROUP_ISSUER_N);
            ImmutableMap <Pair <LegalEntityGroup, Currency>, CurveId> issuerCurves = ImmutableMap.of(Pair.of(GROUP_ISSUER_M, USD), CURVE_ID_USD3, Pair.of(GROUP_ISSUER_N, USD), CURVE_ID_USD4, Pair.of(GROUP_ISSUER_N, GBP), CURVE_ID_GBP2);

            LegalEntityDiscountingMarketDataLookup test = LegalEntityDiscountingMarketDataLookup.of(repoSecurityGroups, repoGroups, repoCurves, issuerGroups, issuerCurves);

            coverImmutableBean((ImmutableBean)test);

            ImmutableMap <LegalEntityId, RepoGroup>                   repoGroups2   = ImmutableMap.of();
            ImmutableMap <Pair <RepoGroup, Currency>, CurveId>        repoCurves2   = ImmutableMap.of();
            ImmutableMap <LegalEntityId, LegalEntityGroup>            issuerGroups2 = ImmutableMap.of();
            ImmutableMap <Pair <LegalEntityGroup, Currency>, CurveId> issuerCurves2 = ImmutableMap.of();

            LegalEntityDiscountingMarketDataLookup test2 = LegalEntityDiscountingMarketDataLookup.of(repoGroups2, repoCurves2, issuerGroups2, issuerCurves2, OBS_SOURCE);

            coverBeanEquals((ImmutableBean)test, (ImmutableBean)test2);

            // related coverage
            coverImmutableBean((ImmutableBean)test.marketDataView(MOCK_CALC_MARKET_DATA));
            DefaultLegalEntityDiscountingScenarioMarketData.meta();

            coverImmutableBean((ImmutableBean)test.marketDataView(MOCK_MARKET_DATA));
            DefaultLegalEntityDiscountingMarketData.meta();

            coverImmutableBean((ImmutableBean)test.marketDataView(MOCK_MARKET_DATA).discountingProvider());
            DefaultLookupLegalEntityDiscountingProvider.meta();
        }
        //-------------------------------------------------------------------------
        public virtual void test_presentValue()
        {
            ScenarioMarketData               md       = BondFutureTradeCalculationFunctionTest.marketData();
            LegalEntityDiscountingProvider   provider = LOOKUP.marketDataView(md.scenario(0)).discountingProvider();
            DiscountingBondFutureTradePricer pricer   = DiscountingBondFutureTradePricer.DEFAULT;
            CurrencyAmount expectedPv        = pricer.presentValue(RTRADE, provider, SETTLE_PRICE);
            double         expectedParSpread = pricer.parSpread(RTRADE, provider, SETTLE_PRICE);

            assertEquals(BondFutureTradeCalculations.DEFAULT.presentValue(RTRADE, LOOKUP, md), CurrencyScenarioArray.of(ImmutableList.of(expectedPv)));
            assertEquals(BondFutureTradeCalculations.DEFAULT.parSpread(RTRADE, LOOKUP, md), DoubleScenarioArray.of(ImmutableList.of(expectedParSpread)));
        }
예제 #3
0
        //-------------------------------------------------------------------------
        public virtual void test_presentValue()
        {
            ScenarioMarketData                    md       = FixedCouponBondTradeCalculationFunctionTest.marketData();
            LegalEntityDiscountingProvider        provider = LOOKUP.marketDataView(md.scenario(0)).discountingProvider();
            DiscountingFixedCouponBondTradePricer pricer   = DiscountingFixedCouponBondTradePricer.DEFAULT;
            CurrencyAmount      expectedPv = pricer.presentValue(RTRADE, provider);
            MultiCurrencyAmount expectedCurrencyExposure = pricer.currencyExposure(RTRADE, provider);
            CurrencyAmount      expectedCurrentCash      = pricer.currentCash(RTRADE, provider.ValuationDate);

            assertEquals(FixedCouponBondTradeCalculations.DEFAULT.presentValue(RTRADE, LOOKUP, md), CurrencyScenarioArray.of(ImmutableList.of(expectedPv)));
            assertEquals(FixedCouponBondTradeCalculations.DEFAULT.currencyExposure(RTRADE, LOOKUP, md), MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExposure)));
            assertEquals(FixedCouponBondTradeCalculations.DEFAULT.currentCash(RTRADE, LOOKUP, md), CurrencyScenarioArray.of(ImmutableList.of(expectedCurrentCash)));
        }
예제 #4
0
        public virtual void test_simpleMeasures()
        {
            BondFutureOptionTradeCalculationFunction <BondFutureOptionTrade> function = BondFutureOptionTradeCalculationFunction.TRADE;
            ScenarioMarketData                       md       = marketData();
            LegalEntityDiscountingProvider           provider = LED_LOOKUP.marketDataView(md.scenario(0)).discountingProvider();
            BlackBondFutureOptionMarginedTradePricer pricer   = BlackBondFutureOptionMarginedTradePricer.DEFAULT;
            CurrencyAmount      expectedPv = pricer.presentValue(RTRADE, provider, VOLS, SETTLE_PRICE);
            MultiCurrencyAmount expectedCurrencyExposure = pricer.currencyExposure(RTRADE, provider, VOLS, SETTLE_PRICE);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.CURRENCY_EXPOSURE, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.CURRENCY_EXPOSURE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExposure)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RTRADE));
        }
예제 #5
0
        //-------------------------------------------------------------------------
        public virtual void test_presentValue()
        {
            ScenarioMarketData                       md                       = CapitalIndexedBondTradeCalculationFunctionTest.marketData();
            RatesProvider                            ratesProvider            = RATES_LOOKUP.marketDataView(md.scenario(0)).ratesProvider();
            LegalEntityDiscountingProvider           ledProvider              = LED_LOOKUP.marketDataView(md.scenario(0)).discountingProvider();
            DiscountingCapitalIndexedBondTradePricer pricer                   = DiscountingCapitalIndexedBondTradePricer.DEFAULT;
            CurrencyAmount                           expectedPv               = pricer.presentValue(RTRADE, ratesProvider, ledProvider);
            MultiCurrencyAmount                      expectedCurrencyExposure = pricer.currencyExposure(RTRADE, ratesProvider, ledProvider);
            CurrencyAmount                           expectedCurrentCash      = pricer.currentCash(RTRADE, ratesProvider);

            assertEquals(CapitalIndexedBondTradeCalculations.DEFAULT.presentValue(RTRADE, RATES_LOOKUP, LED_LOOKUP, md), CurrencyScenarioArray.of(ImmutableList.of(expectedPv)));
            assertEquals(CapitalIndexedBondTradeCalculations.DEFAULT.currencyExposure(RTRADE, RATES_LOOKUP, LED_LOOKUP, md), MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExposure)));
            assertEquals(CapitalIndexedBondTradeCalculations.DEFAULT.currentCash(RTRADE, RATES_LOOKUP, LED_LOOKUP, md), CurrencyScenarioArray.of(ImmutableList.of(expectedCurrentCash)));
        }
예제 #6
0
        //-------------------------------------------------------------------------
        public virtual void test_presentValue()
        {
            ScenarioMarketData             md            = BillTradeCalculationFunctionTest.marketData();
            LegalEntityDiscountingProvider provider      = LOOKUP.marketDataView(md.scenario(0)).discountingProvider();
            CurrencyAmount      expectedPv               = PRICER.presentValue(RTRADE, provider);
            MultiCurrencyAmount expectedCurrencyExposure = PRICER.currencyExposure(RTRADE, provider);
            CurrencyAmount      expectedCurrentCash      = PRICER.currentCash(RTRADE, provider.ValuationDate);

            assertEquals(CALC.presentValue(RTRADE, LOOKUP, md), CurrencyScenarioArray.of(ImmutableList.of(expectedPv)));
            assertEquals(CALC.currencyExposure(RTRADE, LOOKUP, md), MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExposure)));
            assertEquals(CALC.currentCash(RTRADE, LOOKUP, md), CurrencyScenarioArray.of(ImmutableList.of(expectedCurrentCash)));
            assertEquals(CALC.presentValue(RTRADE, provider), expectedPv);
            assertEquals(CALC.currencyExposure(RTRADE, provider), expectedCurrencyExposure);
            assertEquals(CALC.currentCash(RTRADE, provider), expectedCurrentCash);
        }
예제 #7
0
        public virtual void test_simpleMeasures()
        {
            CapitalIndexedBondTradeCalculationFunction <CapitalIndexedBondTrade> function = CapitalIndexedBondTradeCalculationFunction.TRADE;
            ScenarioMarketData                       md                       = marketData();
            RatesProvider                            ratesProvider            = RATES_LOOKUP.marketDataView(md.scenario(0)).ratesProvider();
            LegalEntityDiscountingProvider           ledProvider              = LED_LOOKUP.marketDataView(md.scenario(0)).discountingProvider();
            DiscountingCapitalIndexedBondTradePricer pricer                   = DiscountingCapitalIndexedBondTradePricer.DEFAULT;
            CurrencyAmount                           expectedPv               = pricer.presentValue(RTRADE, ratesProvider, ledProvider);
            MultiCurrencyAmount                      expectedCurrencyExposure = pricer.currencyExposure(RTRADE, ratesProvider, ledProvider);
            CurrencyAmount                           expectedCurrentCash      = pricer.currentCash(RTRADE, ratesProvider);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.CURRENCY_EXPOSURE, Measures.CURRENT_CASH, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.CURRENCY_EXPOSURE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExposure)))).containsEntry(Measures.CURRENT_CASH, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedCurrentCash)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RTRADE));
        }
예제 #8
0
        public LegalEntityDiscountingMarketData scenario(int scenarioIndex)
        {
            LegalEntityDiscountingMarketData current = cache.get(scenarioIndex);

            if (current != null)
            {
                return(current);
            }
            return(cache.updateAndGet(scenarioIndex, v => v != null ? v : lookup.marketDataView(marketData.scenario(scenarioIndex))));
        }
예제 #9
0
        //-------------------------------------------------------------------------
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: @Override public java.util.Map<com.opengamma.strata.calc.Measure, com.opengamma.strata.collect.result.Result<?>> calculate(T target, java.util.Set<com.opengamma.strata.calc.Measure> measures, com.opengamma.strata.calc.runner.CalculationParameters parameters, com.opengamma.strata.data.scenario.ScenarioMarketData scenarioMarketData, com.opengamma.strata.basics.ReferenceData refData)
        public virtual IDictionary <Measure, Result <object> > calculate(T target, ISet <Measure> measures, CalculationParameters parameters, ScenarioMarketData scenarioMarketData, ReferenceData refData)
        {
            // resolve the trade once for all measures and all scenarios
            ResolvedBillTrade resolved = target.resolve(refData);

            // use lookup to query market data
            LegalEntityDiscountingMarketDataLookup   lookup     = parameters.getParameter(typeof(LegalEntityDiscountingMarketDataLookup));
            LegalEntityDiscountingScenarioMarketData marketData = lookup.marketDataView(scenarioMarketData);

            // loop around measures, calculating all scenarios for one measure
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<com.opengamma.strata.calc.Measure, com.opengamma.strata.collect.result.Result<?>> results = new java.util.HashMap<>();
            IDictionary <Measure, Result <object> > results = new Dictionary <Measure, Result <object> >();

            foreach (Measure measure in measures)
            {
                results[measure] = calculate(measure, resolved, marketData);
            }
            return(results);
        }
        //-------------------------------------------------------------------------
        public virtual void test_marketDataView()
        {
            ImmutableMap <SecurityId, RepoGroup> repoSecurityGroups       = ImmutableMap.of(SEC_A1, GROUP_REPO_X);
            ImmutableMap <Pair <RepoGroup, Currency>, CurveId> repoCurves = ImmutableMap.of(Pair.of(GROUP_REPO_X, USD), CURVE_ID_USD1);

            ImmutableMap <LegalEntityId, LegalEntityGroup>            issuerGroups = ImmutableMap.of(ISSUER_A, GROUP_ISSUER_M);
            ImmutableMap <Pair <LegalEntityGroup, Currency>, CurveId> issuerCurves = ImmutableMap.of(Pair.of(GROUP_ISSUER_M, USD), CURVE_ID_USD3);

            LegalEntityDiscountingMarketDataLookup test = LegalEntityDiscountingMarketDataLookup.of(repoSecurityGroups, ImmutableMap.of(), repoCurves, issuerGroups, issuerCurves);

            LocalDate          valDate = date(2015, 6, 30);
            ScenarioMarketData md      = new TestMarketDataMap(valDate, ImmutableMap.of(), ImmutableMap.of());
            LegalEntityDiscountingScenarioMarketData multiScenario = test.marketDataView(md);

            assertEquals(multiScenario.Lookup, test);
            assertEquals(multiScenario.MarketData, md);
            assertEquals(multiScenario.ScenarioCount, 1);
            LegalEntityDiscountingMarketData scenario = multiScenario.scenario(0);

            assertEquals(scenario.Lookup, test);
            assertEquals(scenario.MarketData, md.scenario(0));
            assertEquals(scenario.ValuationDate, valDate);
        }
예제 #11
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value sensitivity across one or more scenarios.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedBillTrade, LegalEntityDiscountingMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the market quotes used to calibrate the curves.
 /// The result is provided for each affected curve and currency, bucketed by curve node.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="lookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value sensitivity, one entry per scenario </returns>
 public virtual ScenarioArray <CurrencyParameterSensitivities> pv01MarketQuoteBucketed(ResolvedBillTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
 {
     return(calc.pv01MarketQuoteBucketed(trade, lookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value sensitivity across one or more scenarios.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedCapitalIndexedBondTrade, RatesMarketDataLookup, LegalEntityDiscountingMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the calibrated curves.
 /// The result is provided for each affected curve and currency, bucketed by curve node.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="ratesLookup">  the lookup used to query the market data </param>
 /// <param name="legalEntityLookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value sensitivity, one entry per scenario </returns>
 public virtual ScenarioArray <CurrencyParameterSensitivities> pv01CalibratedBucketed(ResolvedCapitalIndexedBondTrade trade, RatesMarketDataLookup ratesLookup, LegalEntityDiscountingMarketDataLookup legalEntityLookup, ScenarioMarketData marketData)
 {
     return(calc.pv01CalibratedBucketed(trade, ratesLookup.marketDataView(marketData), legalEntityLookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value across one or more scenarios.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="ratesLookup">  the lookup used to query the market data </param>
 /// <param name="legalEntityLookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value, one entry per scenario </returns>
 public virtual CurrencyScenarioArray presentValue(ResolvedCapitalIndexedBondTrade trade, RatesMarketDataLookup ratesLookup, LegalEntityDiscountingMarketDataLookup legalEntityLookup, ScenarioMarketData marketData)
 {
     return(calc.presentValue(trade, ratesLookup.marketDataView(marketData), legalEntityLookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value across one or more scenarios.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="legalEntityLookup">  the lookup used to query the rates market data </param>
 /// <param name="volsLookup">  the lookup used to query the volatility market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value, one entry per scenario </returns>
 public virtual CurrencyScenarioArray presentValue(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingMarketDataLookup legalEntityLookup, BondFutureOptionMarketDataLookup volsLookup, ScenarioMarketData marketData)
 {
     return(calc.presentValue(trade, legalEntityLookup.marketDataView(marketData), volsLookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates unit price across one or more scenarios.
 /// <para>
 /// This is the price of a single unit of the security.
 ///
 /// <h4>Price</h4>
 /// Strata uses <i>decimal prices</i> for bond futures options in the trade model, pricers and market data.
 /// This is coherent with the pricing of <seealso cref="BondFuture"/>.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="legalEntityLookup">  the lookup used to query the rates market data </param>
 /// <param name="volsLookup">  the lookup used to query the volatility market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value, one entry per scenario </returns>
 public virtual DoubleScenarioArray unitPrice(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingMarketDataLookup legalEntityLookup, BondFutureOptionMarketDataLookup volsLookup, ScenarioMarketData marketData)
 {
     return(calc.unitPrice(trade, legalEntityLookup.marketDataView(marketData), volsLookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value sensitivity across one or more scenarios.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedBondFutureOptionTrade, LegalEntityDiscountingMarketDataLookup, BondFutureOptionMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the calibrated curves.
 /// The result is provided for each affected curve and currency, bucketed by curve node.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="legalEntityLookup">  the lookup used to query the rates market data </param>
 /// <param name="volsLookup">  the lookup used to query the volatility market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value sensitivity, one entry per scenario </returns>
 public virtual ScenarioArray <CurrencyParameterSensitivities> pv01CalibratedBucketed(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingMarketDataLookup legalEntityLookup, BondFutureOptionMarketDataLookup volsLookup, ScenarioMarketData marketData)
 {
     return(calc.pv01CalibratedBucketed(trade, legalEntityLookup.marketDataView(marketData), volsLookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value sensitivity across one or more scenarios.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedBondFutureOptionTrade, LegalEntityDiscountingMarketDataLookup, BondFutureOptionMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the calibrated curves.
 /// The result is the sum of the sensitivities of all affected curves.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="legalEntityLookup">  the lookup used to query the rates market data </param>
 /// <param name="volsLookup">  the lookup used to query the volatility market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value sensitivity, one entry per scenario </returns>
 public virtual MultiCurrencyScenarioArray pv01CalibratedSum(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingMarketDataLookup legalEntityLookup, BondFutureOptionMarketDataLookup volsLookup, ScenarioMarketData marketData)
 {
     return(calc.pv01CalibratedSum(trade, legalEntityLookup.marketDataView(marketData), volsLookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value sensitivity across one or more scenarios.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedFixedCouponBondTrade, LegalEntityDiscountingMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the calibrated curves.
 /// The result is provided for each affected curve and currency, bucketed by curve node.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="lookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value sensitivity, one entry per scenario </returns>
 public virtual ScenarioArray <CurrencyParameterSensitivities> pv01CalibratedBucketed(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
 {
     return(calc.pv01CalibratedBucketed(trade, lookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates current cash across one or more scenarios.
 /// <para>
 /// The sum of all cash flows paid on the valuation date.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="lookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the current cash, one entry per scenario </returns>
 public virtual CurrencyScenarioArray currentCash(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
 {
     return(calc.currentCash(trade, lookup.marketDataView(marketData)));
 }
예제 #20
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value sensitivity across one or more scenarios.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedBillTrade, LegalEntityDiscountingMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the calibrated curves.
 /// The result is the sum of the sensitivities of all affected curves.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="lookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value sensitivity, one entry per scenario </returns>
 public virtual MultiCurrencyScenarioArray pv01CalibratedSum(ResolvedBillTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
 {
     return(calc.pv01CalibratedSum(trade, lookup.marketDataView(marketData)));
 }
예제 #21
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value across one or more scenarios.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="lookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value, one entry per scenario </returns>
 public virtual CurrencyScenarioArray presentValue(ResolvedBillTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
 {
     return(calc.presentValue(trade, lookup.marketDataView(marketData)));
 }
예제 #22
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates currency exposure across one or more scenarios.
 /// <para>
 /// The currency risk, expressed as the equivalent amount in each currency.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="lookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the currency exposure, one entry per scenario </returns>
 public virtual MultiCurrencyScenarioArray currencyExposure(ResolvedBillTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
 {
     return(calc.currencyExposure(trade, lookup.marketDataView(marketData)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value sensitivity across one or more scenarios.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedCapitalIndexedBondTrade, RatesMarketDataLookup, LegalEntityDiscountingMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the calibrated curves.
 /// The result is the sum of the sensitivities of all affected curves.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="ratesLookup">  the lookup used to query the market data </param>
 /// <param name="legalEntityLookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value sensitivity, one entry per scenario </returns>
 public virtual MultiCurrencyScenarioArray pv01CalibratedSum(ResolvedCapitalIndexedBondTrade trade, RatesMarketDataLookup ratesLookup, LegalEntityDiscountingMarketDataLookup legalEntityLookup, ScenarioMarketData marketData)
 {
     return(calc.pv01CalibratedSum(trade, ratesLookup.marketDataView(marketData), legalEntityLookup.marketDataView(marketData)));
 }
예제 #24
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates par spread across one or more scenarios.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="lookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the par spread, one entry per scenario </returns>
 public virtual DoubleScenarioArray parSpread(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
 {
     return(calc.parSpread(trade, lookup.marketDataView(marketData)));
 }
예제 #25
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates present value sensitivity across one or more scenarios.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedBondFutureTrade, LegalEntityDiscountingMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the market quotes used to calibrate the curves.
 /// The result is the sum of the sensitivities of all affected curves.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="lookup">  the lookup used to query the market data </param>
 /// <param name="marketData">  the market data </param>
 /// <returns> the present value sensitivity, one entry per scenario </returns>
 public virtual MultiCurrencyScenarioArray pv01MarketQuoteSum(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
 {
     return(calc.pv01MarketQuoteSum(trade, lookup.marketDataView(marketData)));
 }