// present value for one scenario internal CurrencyAmount presentValue(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider) { // mark to model double settlementPrice = this.settlementPrice(trade, discountingProvider); return(tradePricer.presentValue(trade, discountingProvider, settlementPrice)); }
//------------------------------------------------------------------------- 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))); }