Пример #1
0
        //-------------------------------------------------------------------------
        /// <summary>
        /// Explains the present value of the swap product.
        /// <para>
        /// This returns explanatory information about the calculation.
        ///
        /// </para>
        /// </summary>
        /// <param name="swap">  the product </param>
        /// <param name="provider">  the rates provider </param>
        /// <returns> the explanatory information </returns>
        public virtual ExplainMap explainPresentValue(ResolvedSwap swap, RatesProvider provider)
        {
            ExplainMapBuilder builder = ExplainMap.builder();

            builder.put(ExplainKey.ENTRY_TYPE, "Swap");
            foreach (ResolvedSwapLeg leg in swap.Legs)
            {
                builder.addListEntryWithIndex(ExplainKey.LEGS, child => legPricer.explainPresentValueInternal(leg, provider, child));
            }
            return(builder.build());
        }