Exemplo n.º 1
0
        //-------------------------------------------------------------------------
        public PortfolioItemSummary summarize()
        {
            // 5Y USD 2mm Rec USD-LIBOR-6M Cap 1% / Pay Premium : 21Jan17-21Jan22
            StringBuilder   buf     = new StringBuilder(96);
            IborCapFloorLeg mainLeg = product.CapFloorLeg;

            buf.Append(SummarizerUtils.datePeriod(mainLeg.StartDate.Unadjusted, mainLeg.EndDate.Unadjusted));
            buf.Append(' ');
            buf.Append(SummarizerUtils.amount(mainLeg.Currency, mainLeg.Notional.InitialValue));
            buf.Append(' ');
            if (mainLeg.PayReceive.Receive)
            {
                buf.Append("Rec ");
                summarizeMainLeg(mainLeg, buf);
                buf.Append(Premium.Present ? " / Pay Premium" : (product.PayLeg.Present ? " /  Pay Periodic" : ""));
            }
            else
            {
                buf.Append(Premium.Present ? "Rec Premium / Pay " : (product.PayLeg.Present ? "Rec Periodic / Pay " : ""));
                summarizeMainLeg(mainLeg, buf);
            }
            buf.Append(" : ");
            buf.Append(SummarizerUtils.dateRange(mainLeg.StartDate.Unadjusted, mainLeg.EndDate.Unadjusted));
            return(SummarizerUtils.summary(this, ProductType.IBOR_CAP_FLOOR, buf.ToString(), mainLeg.Currency));
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------
        public PortfolioItemSummary summarize()
        {
            // 3x6 USD 1mm Rec GBP-LIBOR / Pay 2.5% : 21Jan18-21Apr18
            StringBuilder        buf       = new StringBuilder(64);
            Optional <LocalDate> tradeDate = info.TradeDate;

            if (tradeDate.Present)
            {
                // use a three day fudge to avoid most holiday and end of month issues when calculating months
                buf.Append(MONTHS.between(tradeDate.get(), product.StartDate.plusDays(3)));
                buf.Append("x");
                buf.Append(MONTHS.between(tradeDate.get(), product.EndDate.plusDays(3)));
            }
            else
            {
                buf.Append(product.Index.Tenor);
            }
            buf.Append(' ');
            string floatingRate = product.Index.FloatingRateName.normalized().ToString();
            string fixedRate    = SummarizerUtils.percent(product.FixedRate);

            buf.Append(SummarizerUtils.amount(product.Currency, product.Notional));
            buf.Append(" Rec ");
            buf.Append(product.BuySell.Buy ? floatingRate : fixedRate);
            buf.Append(" / Pay ");
            buf.Append(product.BuySell.Buy ? fixedRate : floatingRate);
            buf.Append(" : ");
            buf.Append(SummarizerUtils.dateRange(product.StartDate, product.EndDate));
            return(SummarizerUtils.summary(this, ProductType.FRA, buf.ToString(), product.Currency));
        }
Exemplo n.º 3
0
        //-------------------------------------------------------------------------
        public PortfolioItemSummary summarize()
        {
            // F-ECAG-FGBS-201706 x 200, Jun17
            string future      = security.summaryDescription();
            string description = SecurityId.StandardId.Value + " x " + SummarizerUtils.value(Quantity) + ", " + future;

            return(SummarizerUtils.summary(this, ProductType.ETD_FUTURE, description, Currency));
        }
        //-------------------------------------------------------------------------
        public PortfolioItemSummary summarize()
        {
            // 6M USD 2mm Deposit 0.8% :  21Jan18-21Jul18
            StringBuilder buf = new StringBuilder(64);

            buf.Append(SummarizerUtils.datePeriod(product.StartDate, product.EndDate));
            buf.Append(' ');
            buf.Append(SummarizerUtils.amount(product.Currency, product.Notional));
            buf.Append(' ');
            buf.Append(product.BuySell == BuySell.BUY ? "Deposit " : "Loan ");
            buf.Append(SummarizerUtils.percent(product.Rate));
            buf.Append(" : ");
            buf.Append(SummarizerUtils.dateRange(product.StartDate, product.EndDate));
            return(SummarizerUtils.summary(this, ProductType.TERM_DEPOSIT, buf.ToString(), product.Currency));
        }
        //-------------------------------------------------------------------------
        public PortfolioItemSummary summarize()
        {
            // Long 5Y USD 2mm Rec USD-LIBOR-6M / Pay 1% : 21Jan18
            string swapDesc = product.Underlying.summaryDescription();

            swapDesc = swapDesc.Contains(":") ? swapDesc.Substring(0, swapDesc.LastIndexOf(':')).Trim() : swapDesc;
            StringBuilder buf = new StringBuilder(96);

            buf.Append(product.LongShort);
            buf.Append(' ');
            buf.Append(swapDesc);
            buf.Append(" : ");
            buf.Append(SummarizerUtils.date(product.ExpiryDate.Unadjusted));
            return(SummarizerUtils.summary(this, ProductType.SWAPTION, buf.ToString(), product.Currency));
        }
Exemplo n.º 6
0
        //-------------------------------------------------------------------------
        public PortfolioItemSummary summarize()
        {
            // Pay USD 1mm @ GBP/USD 1.32 : Rec USD 1mm @ GBP/USD 1.35 : 21Jan18-21Apr18
            StringBuilder  buf      = new StringBuilder(96);
            CurrencyAmount base1    = product.NearLeg.BaseCurrencyAmount;
            CurrencyAmount counter1 = product.NearLeg.CounterCurrencyAmount;
            CurrencyAmount base2    = product.FarLeg.BaseCurrencyAmount;
            CurrencyAmount counter2 = product.FarLeg.CounterCurrencyAmount;

            buf.Append(SummarizerUtils.fx(base1, counter1));
            buf.Append(" / ");
            buf.Append(SummarizerUtils.fx(base2, counter2));
            buf.Append(" : ");
            buf.Append(SummarizerUtils.dateRange(product.NearLeg.PaymentDate, product.FarLeg.PaymentDate));
            CurrencyPair currencyPair = product.NearLeg.CurrencyPair;

            return(SummarizerUtils.summary(this, ProductType.FX_SWAP, buf.ToString(), currencyPair.Base, currencyPair.Counter));
        }
Exemplo n.º 7
0
        //-------------------------------------------------------------------------
        public PortfolioItemSummary summarize()
        {
            string description = "Ibor calibration trade";

            return(SummarizerUtils.summary(this, ProductType.CALIBRATION, description, product.Currency));
        }