PreferredFixedBullet.java

  1. package org.drip.sample.preferred;

  2. import java.util.Map;

  3. import org.drip.analytics.date.*;
  4. import org.drip.analytics.output.BondRVMeasures;
  5. import org.drip.analytics.support.Helper;
  6. import org.drip.numerical.common.FormatUtil;
  7. import org.drip.param.creator.MarketParamsBuilder;
  8. import org.drip.param.market.CurveSurfaceQuoteContainer;
  9. import org.drip.param.quote.*;
  10. import org.drip.param.valuation.*;
  11. import org.drip.product.creator.BondBuilder;
  12. import org.drip.product.credit.BondComponent;
  13. import org.drip.product.definition.*;
  14. import org.drip.service.env.EnvManager;
  15. import org.drip.service.template.*;
  16. import org.drip.state.discount.MergedDiscountForwardCurve;
  17. import org.drip.state.govvie.GovvieCurve;

  18. /*
  19.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  20.  */

  21. /*!
  22.  * Copyright (C) 2018 Lakshmi Krishnamurthy
  23.  * Copyright (C) 2017 Lakshmi Krishnamurthy
  24.  *
  25.  *  This file is part of DRIP, a free-software/open-source library for buy/side financial/trading model
  26.  *      libraries targeting analysts and developers
  27.  *      https://lakshmidrip.github.io/DRIP/
  28.  *  
  29.  *  DRIP is composed of four main libraries:
  30.  *  
  31.  *  - DRIP Fixed Income - https://lakshmidrip.github.io/DRIP-Fixed-Income/
  32.  *  - DRIP Asset Allocation - https://lakshmidrip.github.io/DRIP-Asset-Allocation/
  33.  *  - DRIP Numerical Optimizer - https://lakshmidrip.github.io/DRIP-Numerical-Optimizer/
  34.  *  - DRIP Statistical Learning - https://lakshmidrip.github.io/DRIP-Statistical-Learning/
  35.  *
  36.  *  - DRIP Fixed Income: Library for Instrument/Trading Conventions, Treasury Futures/Options,
  37.  *      Funding/Forward/Overnight Curves, Multi-Curve Construction/Valuation, Collateral Valuation and XVA
  38.  *      Metric Generation, Calibration and Hedge Attributions, Statistical Curve Construction, Bond RV
  39.  *      Metrics, Stochastic Evolution and Option Pricing, Interest Rate Dynamics and Option Pricing, LMM
  40.  *      Extensions/Calibrations/Greeks, Algorithmic Differentiation, and Asset Backed Models and Analytics.
  41.  *
  42.  *  - DRIP Asset Allocation: Library for model libraries for MPT framework, Black Litterman Strategy
  43.  *      Incorporator, Holdings Constraint, and Transaction Costs.
  44.  *
  45.  *  - DRIP Numerical Optimizer: Library for Numerical Optimization and Spline Functionality.
  46.  *
  47.  *  - DRIP Statistical Learning: Library for Statistical Evaluation and Machine Learning.
  48.  *
  49.  *  Licensed under the Apache License, Version 2.0 (the "License");
  50.  *      you may not use this file except in compliance with the License.
  51.  *  
  52.  *  You may obtain a copy of the License at
  53.  *      http://www.apache.org/licenses/LICENSE-2.0
  54.  *  
  55.  *  Unless required by applicable law or agreed to in writing, software
  56.  *      distributed under the License is distributed on an "AS IS" BASIS,
  57.  *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  58.  *  
  59.  *  See the License for the specific language governing permissions and
  60.  *      limitations under the License.
  61.  */

  62. /**
  63.  * PreferredFixedBullet demonstrates Non-EOS Fixed Coupon Preferred Bond Pricing and Relative Value Measure
  64.  *  Generation Functionality.
  65.  *
  66.  * @author Lakshmi Krishnamurthy
  67.  */

  68. public class PreferredFixedBullet {

  69.     private static final MergedDiscountForwardCurve FundingCurve (
  70.         final JulianDate dtSpot,
  71.         final String strCurrency)
  72.         throws Exception
  73.     {
  74.         String[] astrDepositMaturityTenor = new String[] {
  75.             "2D"
  76.         };

  77.         double[] adblDepositQuote = new double[] {
  78.             0.0111956 // 2D
  79.         };

  80.         double[] adblFuturesQuote = new double[] {
  81.             0.011375,   // 98.8625
  82.             0.013350,   // 98.6650
  83.             0.014800,   // 98.5200
  84.             0.016450,   // 98.3550
  85.             0.017850,   // 98.2150
  86.             0.019300    // 98.0700
  87.         };

  88.         String[] astrFixFloatMaturityTenor = new String[] {
  89.             "02Y",
  90.             "03Y",
  91.             "04Y",
  92.             "05Y",
  93.             "06Y",
  94.             "07Y",
  95.             "08Y",
  96.             "09Y",
  97.             "10Y",
  98.             "11Y",
  99.             "12Y",
  100.             "15Y",
  101.             "20Y",
  102.             "25Y",
  103.             "30Y",
  104.             "40Y",
  105.             "50Y"
  106.         };

  107.         double[] adblFixFloatQuote = new double[] {
  108.             0.017029, //  2Y
  109.             0.019354, //  3Y
  110.             0.021044, //  4Y
  111.             0.022291, //  5Y
  112.             0.023240, //  6Y
  113.             0.024025, //  7Y
  114.             0.024683, //  8Y
  115.             0.025243, //  9Y
  116.             0.025720, // 10Y
  117.             0.026130, // 11Y
  118.             0.026495, // 12Y
  119.             0.027230, // 15Y
  120.             0.027855, // 20Y
  121.             0.028025, // 25Y
  122.             0.028028, // 30Y
  123.             0.027902, // 40Y
  124.             0.027655  // 50Y
  125.         };

  126.         MergedDiscountForwardCurve dcFunding = LatentMarketStateBuilder.SmoothFundingCurve (
  127.             dtSpot,
  128.             strCurrency,
  129.             astrDepositMaturityTenor,
  130.             adblDepositQuote,
  131.             "ForwardRate",
  132.             adblFuturesQuote,
  133.             "ForwardRate",
  134.             astrFixFloatMaturityTenor,
  135.             adblFixFloatQuote,
  136.             "SwapRate"
  137.         );

  138.         Component[] aDepositComp = OTCInstrumentBuilder.FundingDeposit (
  139.             dtSpot,
  140.             strCurrency,
  141.             astrDepositMaturityTenor
  142.         );

  143.         Component[] aFuturesComp = ExchangeInstrumentBuilder.ForwardRateFuturesPack (
  144.             dtSpot,
  145.             adblFuturesQuote.length,
  146.             strCurrency
  147.         );

  148.         Component[] aFixFloatComp = OTCInstrumentBuilder.FixFloatStandard (
  149.             dtSpot,
  150.             strCurrency,
  151.             "ALL",
  152.             astrFixFloatMaturityTenor,
  153.             "MAIN",
  154.             0.
  155.         );

  156.         ValuationParams valParams = new ValuationParams (
  157.             dtSpot,
  158.             dtSpot,
  159.             strCurrency
  160.         );

  161.         CurveSurfaceQuoteContainer csqc = MarketParamsBuilder.Create (
  162.             dcFunding,
  163.             null,
  164.             null,
  165.             null,
  166.             null,
  167.             null,
  168.             null
  169.         );

  170.         System.out.println();

  171.         System.out.println ("\t|-------------------------------------||");

  172.         System.out.println ("\t|        DEPOSIT INPUT vs. CALC       ||");

  173.         System.out.println ("\t|-------------------------------------||");

  174.         for (int i = 0; i < aDepositComp.length; ++i)
  175.             System.out.println ("\t| [" + aDepositComp[i].maturityDate() + "] =" +
  176.                 FormatUtil.FormatDouble (aDepositComp[i].measureValue (
  177.                     valParams,
  178.                     null,
  179.                     csqc,
  180.                     null,
  181.                     "ForwardRate"
  182.                 ), 1, 6, 1.) + " |" +
  183.                 FormatUtil.FormatDouble (adblDepositQuote[i], 1, 6, 1.) + " ||"
  184.             );

  185.         System.out.println ("\t|-------------------------------------||");

  186.         System.out.println();

  187.         System.out.println ("\t|-------------------------------------||");

  188.         System.out.println ("\t|        FUTURES INPUT vs. CALC       ||");

  189.         System.out.println ("\t|-------------------------------------||");

  190.         for (int i = 0; i < aFuturesComp.length; ++i)
  191.             System.out.println ("\t| [" + aFuturesComp[i].maturityDate() + "] =" +
  192.                 FormatUtil.FormatDouble (aFuturesComp[i].measureValue (
  193.                     valParams,
  194.                     null,
  195.                     csqc,
  196.                     null,
  197.                     "ForwardRate"
  198.                 ), 1, 6, 1.) + " |" +
  199.                 FormatUtil.FormatDouble (adblFuturesQuote[i], 1, 6, 1.) + " ||"
  200.             );

  201.         System.out.println ("\t|-------------------------------------||");

  202.         System.out.println();

  203.         System.out.println ("\t|------------------------------------------------|| ");

  204.         System.out.println ("\t|          FIX-FLOAT INPUTS vs CALIB             ||");

  205.         System.out.println ("\t|------------------------------------------------|| ");

  206.         for (int i = 0; i < aFixFloatComp.length; ++i)
  207.             System.out.println ("\t| [" + aFixFloatComp[i].maturityDate() + "] =" +
  208.                 FormatUtil.FormatDouble (aFixFloatComp[i].measureValue (
  209.                     valParams,
  210.                     null,
  211.                     csqc,
  212.                     null,
  213.                     "CalibSwapRate"
  214.                 ), 1, 6, 1.) + " |" +
  215.                 FormatUtil.FormatDouble (adblFixFloatQuote[i], 1, 6, 1.) + " |" +
  216.                 FormatUtil.FormatDouble (aFixFloatComp[i].measureValue (
  217.                     valParams,
  218.                     null,
  219.                     csqc,
  220.                     null,
  221.                     "FairPremium"
  222.                 ), 1, 6, 1.) + " ||"
  223.             );

  224.         System.out.println ("\t|------------------------------------------------||");

  225.         System.out.println();

  226.         return dcFunding;
  227.     }

  228.     private static final Map<String, GovvieCurve> GovvieCurve (
  229.         final JulianDate dtSpot,
  230.         final String strCode,
  231.         final double[] adblCoupon,
  232.         final double[] adblYield)
  233.         throws Exception
  234.     {
  235.         JulianDate[] adtEffective = new JulianDate[] {
  236.             dtSpot,
  237.             dtSpot,
  238.             dtSpot,
  239.             dtSpot,
  240.             dtSpot,
  241.             dtSpot,
  242.             dtSpot,
  243.             dtSpot
  244.         };

  245.         JulianDate[] adtMaturity = new JulianDate[] {
  246.             dtSpot.addTenor ("1Y"),
  247.             dtSpot.addTenor ("2Y"),
  248.             dtSpot.addTenor ("3Y"),
  249.             dtSpot.addTenor ("5Y"),
  250.             dtSpot.addTenor ("7Y"),
  251.             dtSpot.addTenor ("10Y"),
  252.             dtSpot.addTenor ("20Y"),
  253.             dtSpot.addTenor ("30Y")
  254.         };

  255.         Map<String, GovvieCurve> mapGovvieCurve = LatentMarketStateBuilder.BumpedGovvieCurve (
  256.             strCode,
  257.             dtSpot,
  258.             adtEffective,
  259.             adtMaturity,
  260.             adblCoupon,
  261.             adblYield,
  262.             "Yield",
  263.             LatentMarketStateBuilder.SHAPE_PRESERVING,
  264.             0.0001,
  265.             false
  266.         );

  267.         BondComponent[] aComp = TreasuryBuilder.FromCode (
  268.             strCode,
  269.             adtEffective,
  270.             adtMaturity,
  271.             adblCoupon
  272.         );

  273.         ValuationParams valParams = ValuationParams.Spot (dtSpot.julian());

  274.         CurveSurfaceQuoteContainer csqc = new CurveSurfaceQuoteContainer();

  275.         csqc.setGovvieState (mapGovvieCurve.get ("BASE"));

  276.         System.out.println();

  277.         System.out.println ("\t|-------------------------------------------||");

  278.         System.out.println ("\t|       TREASURY INPUT vs CALIB YIELD       ||");

  279.         System.out.println ("\t|-------------------------------------------||");

  280.         for (int i = 0; i < aComp.length; ++i)
  281.             System.out.println ("\t| " + aComp[i].name() + " | " +
  282.                 FormatUtil.FormatDouble (adblYield[i], 1, 3, 100.) + "% | " +
  283.                 FormatUtil.FormatDouble (aComp[i].yieldFromPrice (
  284.                     valParams,
  285.                     null,
  286.                     null,
  287.                     aComp[i].maturityDate().julian(),
  288.                     1.,
  289.                     aComp[i].priceFromYield (
  290.                         valParams,
  291.                         null,
  292.                         null,
  293.                         mapGovvieCurve.get ("BASE").yield (aComp[i].maturityDate().julian())
  294.                     )
  295.                 ), 1, 3, 100.) + "% ||"
  296.             );

  297.         System.out.println ("\t|-------------------------------------------||");

  298.         return mapGovvieCurve;
  299.     }

  300.     private static final void AccumulateBondMarketQuote (
  301.         final CurveSurfaceQuoteContainer csqc,
  302.         final String[] astrOnTheRunCode,
  303.         final double[] adblYield)
  304.         throws Exception
  305.     {
  306.         for (int i = 0; i < astrOnTheRunCode.length; ++i) {
  307.             ProductMultiMeasure pmmq = new ProductMultiMeasure();

  308.             pmmq.addQuote (
  309.                 "Yield",
  310.                 new MultiSided (
  311.                     "mid",
  312.                     adblYield[i]
  313.                 ),
  314.                 true
  315.             );

  316.             csqc.setProductQuote (
  317.                 astrOnTheRunCode[i],
  318.                 pmmq
  319.             );
  320.         }
  321.     }

  322.     private static final Bond Corporate (
  323.         final String strName,
  324.         final JulianDate dtEffective,
  325.         final JulianDate dtMaturity,
  326.         final double dblCoupon,
  327.         final int iFreq,
  328.         final String strDayCount)
  329.         throws Exception
  330.     {
  331.         return BondBuilder.CreateSimpleFixed (
  332.             strName + FormatUtil.FormatDouble (dblCoupon, 1, 4, 100.) + " " + dtMaturity,
  333.             "USD",
  334.             "",
  335.             dblCoupon,
  336.             iFreq,
  337.             strDayCount,
  338.             dtEffective,
  339.             dtMaturity,
  340.             null,
  341.             null
  342.         );
  343.     }

  344.     private static final double[] RVMeasures (
  345.         final Bond[] aBond,
  346.         final JulianDate dtValue,
  347.         final CurveSurfaceQuoteContainer csqc,
  348.         final double[] adblCleanPrice)
  349.         throws Exception
  350.     {
  351.         JulianDate dtSettle = dtValue.addBusDays (
  352.             0,
  353.             aBond[0].currency()
  354.         );

  355.         ValuationParams valParams = new ValuationParams (
  356.             dtValue,
  357.             dtSettle,
  358.             aBond[0].currency()
  359.         );

  360.         System.out.println();

  361.         System.out.println ("\t|--------------------------------||");

  362.         System.out.println ("\t| Trade Date       : " + dtValue + " ||");

  363.         System.out.println ("\t| Cash Settle Date : " + dtSettle + " ||");

  364.         System.out.println ("\t|--------------------------------||");

  365.         System.out.println();

  366.         String strCurveMetrics = "";
  367.         String strSecularMetrics = "";
  368.         double[] adblOAS = new double[aBond.length];

  369.         for (int i = 0; i < aBond.length; ++i) {
  370.             System.out.println ("Doing " + aBond[i].name());

  371.             WorkoutInfo wi = aBond[i].exerciseYieldFromPrice (
  372.                 valParams,
  373.                 csqc,
  374.                 null,
  375.                 adblCleanPrice[i]
  376.             );

  377.             BondRVMeasures rvm = aBond[i].standardMeasures (
  378.                 valParams,
  379.                 null,
  380.                 csqc,
  381.                 null,
  382.                 wi,
  383.                 adblCleanPrice[i]
  384.             );

  385.             strSecularMetrics += "\t| " +
  386.                 aBond[i].name() + " | " +
  387.                 aBond[i].effectiveDate() + " | " +
  388.                 aBond[i].maturityDate() + " |  " +
  389.                 aBond[i].firstCouponDate() + "  |" +
  390.                 FormatUtil.FormatDouble (adblCleanPrice[i], 3, 3, 100.) + " |" +
  391.                 FormatUtil.FormatDouble (aBond[i].accrued (dtSettle.julian(), csqc), 1, 5, 100.) + " |" +
  392.                 FormatUtil.FormatDouble (wi.yield(), 1, 2, 100.) + "% | " +
  393.                 FormatUtil.FormatDouble (rvm.macaulayDuration(), 2, 2, 1.) + "  | " +
  394.                 FormatUtil.FormatDouble (rvm.modifiedDuration(), 2, 2, 10000.) + "  |  " +
  395.                 FormatUtil.FormatDouble (rvm.yield01(), 2, 2, 10000.) + "  |" +
  396.                 FormatUtil.FormatDouble (rvm.yield01(), 4, 0, 1000000.) + " |" +
  397.                 FormatUtil.FormatDouble (rvm.convexity(), 1, 2, 1000000.) + " |" +
  398.                 FormatUtil.FormatDouble (aBond[i].weightedAverageLife (valParams, csqc), 2, 2, 1.) + " |   " +
  399.                 FormatUtil.FormatDouble (rvm.bondBasis(), 3, 0, 10000.) + "     ||" + "\n";

  400.             adblOAS[i] = rvm.oas();

  401.             double dblCleanPriceOASUp = aBond[i].priceFromOAS (
  402.                 valParams,
  403.                 csqc,
  404.                 null,
  405.                 adblOAS[i] + 0.0001
  406.             );

  407.             double dblCleanPriceOASDown = aBond[i].priceFromOAS (
  408.                 valParams,
  409.                 csqc,
  410.                 null,
  411.                 adblOAS[i] - 0.0001
  412.             );

  413.             strCurveMetrics += "\t| " +
  414.                 aBond[i].name() + " |" +
  415.                 FormatUtil.FormatDouble (adblCleanPrice[i], 3, 3, 100.) + " |" +
  416.                 FormatUtil.FormatDouble (wi.yield(), 1, 2, 100.) + "% |   " +
  417.                 FormatUtil.FormatDouble (rvm.zSpread(), 3, 0, 10000.) + "   |" +
  418.                 FormatUtil.FormatDouble (adblOAS[i], 3, 0, 10000.) + " | " +
  419.                 FormatUtil.FormatDouble (0.5 * (dblCleanPriceOASDown - dblCleanPriceOASUp) / adblCleanPrice[i], 2, 2, 10000.) + "  |  " +
  420.                 FormatUtil.FormatDouble ((dblCleanPriceOASDown + dblCleanPriceOASUp - 2. * adblCleanPrice[i]) / adblCleanPrice[i], 2, 2, 1000000.) + "   |" +
  421.                 FormatUtil.FormatDouble (rvm.asw(), 3, 0, 10000.) + " |  " +
  422.                 FormatUtil.FormatDouble (rvm.gSpread(), 3, 0, 10000.) + "    |   " +
  423.                 FormatUtil.FormatDouble (rvm.iSpread(), 3, 0, 10000.) + "   |    " +
  424.                 FormatUtil.FormatDouble (rvm.tsySpread(), 3, 0, 10000.) + "    |  " +
  425.                 Helper.BaseTsyBmk (
  426.                     dtValue.julian(),
  427.                     aBond[i].maturityDate().julian()
  428.                 ) + "  ||" + "\n";
  429.         }

  430.         System.out.println ("\t|----------------------------------------------------------------------------------------------------------------------------------------------------------------------||");

  431.         System.out.println ("\t|             BOND           |  EFFECTIVE  |   MATURITY  |  FIRST COUPON |  PRICE  | ACCRUED | YIELD | MAC DUR | MOD DUR | YIELD 01 | DV01 | CONV |  WAL  | BOND BASIS ||");

  432.         System.out.println ("\t|----------------------------------------------------------------------------------------------------------------------------------------------------------------------||");

  433.         System.out.print (strSecularMetrics);

  434.         System.out.println ("\t|----------------------------------------------------------------------------------------------------------------------------------------------------------------------||");

  435.         System.out.println ("\t|----------------------------------------------------------------------------------------------------------------------------------------||");

  436.         System.out.println ("\t|             BOND           |  PRICE  | YIELD | Z SPREAD | OAS | OAS DUR |  OAS CONV | ASW | G SPREAD | I SPREAD | TSY SPREAD | TSY BMK ||");

  437.         System.out.println ("\t|----------------------------------------------------------------------------------------------------------------------------------------||");

  438.         System.out.print (strCurveMetrics);

  439.         System.out.println ("\t|----------------------------------------------------------------------------------------------------------------------------------------||");

  440.         return adblOAS;
  441.     }

  442.     public static final void main (
  443.         final String[] astrArgs)
  444.         throws Exception
  445.     {
  446.         EnvManager.InitEnv ("");

  447.         JulianDate dtSpot = DateUtil.CreateFromYMD (
  448.             2017,
  449.             DateUtil.MARCH,
  450.             13
  451.         );

  452.         String strCurrency = "USD";
  453.         String strTreasuryCode = "UST";

  454.         MergedDiscountForwardCurve dcFunding = FundingCurve (
  455.             dtSpot,
  456.             strCurrency
  457.         );

  458.         double[] adblTreasuryCoupon = new double[] {
  459.             0.0100,
  460.             0.0100,
  461.             0.0125,
  462.             0.0150,
  463.             0.0200,
  464.             0.0225,
  465.             0.0250,
  466.             0.0300
  467.         };

  468.         double[] adblTreasuryYield = new double[] {
  469.             0.0104, //  1Y
  470.             0.0137, //  2Y
  471.             0.0167, //  3Y
  472.             0.0213, //  5Y
  473.             0.0243, //  7Y
  474.             0.0260, // 10Y
  475.             0.0294, // 20Y
  476.             0.0319  // 30Y
  477.         };

  478.         Map<String, GovvieCurve> mapGovvieCurve = GovvieCurve (
  479.             dtSpot,
  480.             strTreasuryCode,
  481.             adblTreasuryCoupon,
  482.             adblTreasuryYield
  483.         );

  484.         CurveSurfaceQuoteContainer csqc = MarketParamsBuilder.Create (
  485.             dcFunding,
  486.             null,
  487.             null,
  488.             null,
  489.             null,
  490.             null,
  491.             null
  492.         );

  493.         csqc.setGovvieState (mapGovvieCurve.get ("BASE"));

  494.         AccumulateBondMarketQuote (
  495.             csqc,
  496.             new String[] {
  497.                 "01YON",
  498.                 "02YON",
  499.                 "03YON",
  500.                 "05YON",
  501.                 "07YON",
  502.                 "10YON",
  503.                 "20YON",
  504.                 "30YON"
  505.             },
  506.             adblTreasuryYield
  507.         );

  508.         Bond[] aCorporateBond = new Bond[] {
  509.             Corporate ("AGENCY ", DateUtil.CreateFromYMD (2014,  4,  3), DateUtil.CreateFromYMD (2019,  4, 30), 0.06375, 4, "30/360 NON-EOM"),
  510.         };

  511.         double[] adblCleanPrice = new double[] {
  512.             1.0036800,  // (2019,  4, 30)
  513.         };

  514.         double[] adblOAS = RVMeasures (
  515.             aCorporateBond,
  516.             dtSpot,
  517.             csqc,
  518.             adblCleanPrice
  519.         );

  520.         ValuationParams valParams = new ValuationParams (
  521.             dtSpot,
  522.             dtSpot.addBusDays (
  523.                 3,
  524.                 dcFunding.currency()
  525.             ),
  526.             dcFunding.currency()
  527.         );

  528.         System.out.println();

  529.         System.out.println ("\t|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------||");

  530.         System.out.print ("\t|             BOND          ");

  531.         for (Map.Entry<String, GovvieCurve> meGovvieCurve : mapGovvieCurve.entrySet()) {
  532.             if ("BASE".equalsIgnoreCase (meGovvieCurve.getKey()) || "BUMP".equalsIgnoreCase (meGovvieCurve.getKey()))
  533.                 continue;

  534.             System.out.print (" | " + meGovvieCurve.getKey());
  535.         }

  536.         System.out.println (" ||");

  537.         System.out.println ("\t|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------||");

  538.         for (int i = 0; i < adblOAS.length; ++i) {
  539.             System.out.print ("\t| " + aCorporateBond[i].name());

  540.             for (Map.Entry<String, GovvieCurve> meGovvieCurve : mapGovvieCurve.entrySet()) {
  541.                 if ("BASE".equalsIgnoreCase (meGovvieCurve.getKey()) || "BUMP".equalsIgnoreCase (meGovvieCurve.getKey()))
  542.                     continue;

  543.                 csqc.setGovvieState (meGovvieCurve.getValue());

  544.                 System.out.print (" |      " +
  545.                     FormatUtil.FormatDouble (
  546.                         (adblCleanPrice[i] - aCorporateBond[i].priceFromOAS (
  547.                             valParams,
  548.                             csqc,
  549.                             null,
  550.                             adblOAS[i]
  551.                         )) / adblCleanPrice[i],
  552.                     2, 2, 10000.) + "     "
  553.                 );
  554.             }

  555.             System.out.println (" ||");
  556.         }

  557.         System.out.println ("\t|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------||");

  558.         System.out.println();
  559.     }
  560. }