コード例 #1
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);
        }
コード例 #2
0
 // currency exposure for one scenario
 internal virtual MultiCurrencyAmount currencyExposure(ResolvedBillTrade trade, LegalEntityDiscountingProvider discountingProvider)
 {
     return(tradePricer.currencyExposure(trade, discountingProvider));
 }