Exemple #1
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)));
        }
 // currency exposure for one scenario
 internal MultiCurrencyAmount currencyExposure(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider discountingProvider)
 {
     return(tradePricer.currencyExposure(trade, discountingProvider));
 }