예제 #1
0
        /// <summary>
        /// Calculates the current cash of the FX swap product.
        /// </summary>
        /// <param name="swap">  the product </param>
        /// <param name="valuationDate">  the valuation date </param>
        /// <returns> the current cash </returns>
        public virtual MultiCurrencyAmount currentCash(ResolvedFxSwap swap, LocalDate valuationDate)
        {
            MultiCurrencyAmount farPv  = fxPricer.currentCash(swap.FarLeg, valuationDate);
            MultiCurrencyAmount nearPv = fxPricer.currentCash(swap.NearLeg, valuationDate);

            return(nearPv.plus(farPv));
        }
 public virtual void test_currentCash()
 {
     assertEquals(TRADE_PRICER.currentCash(TRADE, PROVIDER), PRODUCT_PRICER.currentCash(PRODUCT, PROVIDER.ValuationDate));
 }
        public virtual void test_currentCash_zero()
        {
            MultiCurrencyAmount computed = PRICER.currentCash(FWD, PROVIDER.ValuationDate);

            assertEquals(computed, MultiCurrencyAmount.empty());
        }
예제 #4
0
 /// <summary>
 /// Calculates the current cash of the trade.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="provider">  the rates provider </param>
 /// <returns> the current cash of the trade in the settlement currency </returns>
 public virtual MultiCurrencyAmount currentCash(ResolvedFxSingleTrade trade, RatesProvider provider)
 {
     return(productPricer.currentCash(trade.Product, provider.ValuationDate));
 }