MultiCurveFRAStandardAnalysis.java

  1. package org.drip.sample.fra;

  2. import java.util.*;

  3. import org.drip.analytics.date.*;
  4. import org.drip.function.r1tor1.FlatUnivariate;
  5. import org.drip.market.otc.*;
  6. import org.drip.param.creator.*;
  7. import org.drip.param.market.CurveSurfaceQuoteContainer;
  8. import org.drip.param.valuation.*;
  9. import org.drip.product.creator.*;
  10. import org.drip.product.definition.*;
  11. import org.drip.product.fra.FRAStandardComponent;
  12. import org.drip.product.rates.*;
  13. import org.drip.service.env.EnvManager;
  14. import org.drip.spline.basis.PolynomialFunctionSetParams;
  15. import org.drip.spline.stretch.MultiSegmentSequenceBuilder;
  16. import org.drip.state.creator.*;
  17. import org.drip.state.discount.*;
  18. import org.drip.state.forward.ForwardCurve;
  19. import org.drip.state.identifier.*;

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

  23. /*!
  24.  * Copyright (C) 2019 Lakshmi Krishnamurthy
  25.  * Copyright (C) 2018 Lakshmi Krishnamurthy
  26.  * Copyright (C) 2017 Lakshmi Krishnamurthy
  27.  * Copyright (C) 2016 Lakshmi Krishnamurthy
  28.  * Copyright (C) 2015 Lakshmi Krishnamurthy
  29.  * Copyright (C) 2014 Lakshmi Krishnamurthy
  30.  *
  31.  *  This file is part of DROP, an open-source library targeting risk, transaction costs, exposure, margin
  32.  *      calculations, valuation adjustment, and portfolio construction within and across fixed income,
  33.  *      credit, commodity, equity, FX, and structured products.
  34.  *  
  35.  *      https://lakshmidrip.github.io/DROP/
  36.  *  
  37.  *  DROP is composed of three modules:
  38.  *  
  39.  *  - DROP Analytics Core - https://lakshmidrip.github.io/DROP-Analytics-Core/
  40.  *  - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
  41.  *  - DROP Numerical Core - https://lakshmidrip.github.io/DROP-Numerical-Core/
  42.  *
  43.  *  DROP Analytics Core implements libraries for the following:
  44.  *  - Fixed Income Analytics
  45.  *  - Asset Backed Analytics
  46.  *  - XVA Analytics
  47.  *  - Exposure and Margin Analytics
  48.  *
  49.  *  DROP Portfolio Core implements libraries for the following:
  50.  *  - Asset Allocation Analytics
  51.  *  - Transaction Cost Analytics
  52.  *
  53.  *  DROP Numerical Core implements libraries for the following:
  54.  *  - Statistical Learning
  55.  *  - Numerical Optimizer
  56.  *  - Spline Builder
  57.  *  - Algorithm Support
  58.  *
  59.  *  Documentation for DROP is Spread Over:
  60.  *
  61.  *  - Main                     => https://lakshmidrip.github.io/DROP/
  62.  *  - Wiki                     => https://github.com/lakshmiDRIP/DROP/wiki
  63.  *  - GitHub                   => https://github.com/lakshmiDRIP/DROP
  64.  *  - Repo Layout Taxonomy     => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
  65.  *  - Javadoc                  => https://lakshmidrip.github.io/DROP/Javadoc/index.html
  66.  *  - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
  67.  *  - Release Versions         => https://lakshmidrip.github.io/DROP/version.html
  68.  *  - Community Credits        => https://lakshmidrip.github.io/DROP/credits.html
  69.  *  - Issues Catalog           => https://github.com/lakshmiDRIP/DROP/issues
  70.  *  - JUnit                    => https://lakshmidrip.github.io/DROP/junit/index.html
  71.  *  - Jacoco                   => https://lakshmidrip.github.io/DROP/jacoco/index.html
  72.  *
  73.  *  Licensed under the Apache License, Version 2.0 (the "License");
  74.  *      you may not use this file except in compliance with the License.
  75.  *  
  76.  *  You may obtain a copy of the License at
  77.  *      http://www.apache.org/licenses/LICENSE-2.0
  78.  *  
  79.  *  Unless required by applicable law or agreed to in writing, software
  80.  *      distributed under the License is distributed on an "AS IS" BASIS,
  81.  *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  82.  *  
  83.  *  See the License for the specific language governing permissions and
  84.  *      limitations under the License.
  85.  */

  86. /**
  87.  * <i>MultiCurveFRAStandardAnalysis</i> contains an Analysis of the Correlation and the Volatility Impact on
  88.  * the Standard FRA.
  89.  *  
  90.  * <br><br>
  91.  *  <ul>
  92.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/AnalyticsCore.md">Analytics Core Module</a></li>
  93.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics Library</a></li>
  94.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/README.md">Sample</a></li>
  95.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/fra/README.md">FRA Analytics</a></li>
  96.  *  </ul>
  97.  * <br><br>
  98.  *
  99.  * @author Lakshmi Krishnamurthy
  100.  */

  101. public class MultiCurveFRAStandardAnalysis {

  102.     private static final FixFloatComponent OTCFixFloat (
  103.         final JulianDate dtSpot,
  104.         final String strCurrency,
  105.         final String strMaturityTenor,
  106.         final double dblCoupon)
  107.     {
  108.         FixedFloatSwapConvention ffConv = IBORFixedFloatContainer.ConventionFromJurisdiction (
  109.             strCurrency,
  110.             "ALL",
  111.             strMaturityTenor,
  112.             "MAIN"
  113.         );

  114.         return ffConv.createFixFloatComponent (
  115.             dtSpot,
  116.             strMaturityTenor,
  117.             dblCoupon,
  118.             0.,
  119.             1.
  120.         );
  121.     }

  122.     private static final FloatFloatComponent OTCFloatFloat (
  123.         final JulianDate dtSpot,
  124.         final String strCurrency,
  125.         final String strDerivedTenor,
  126.         final String strMaturityTenor,
  127.         final double dblBasis)
  128.     {
  129.         FloatFloatSwapConvention ffConv = IBORFloatFloatContainer.ConventionFromJurisdiction (strCurrency);

  130.         return ffConv.createFloatFloatComponent (
  131.             dtSpot,
  132.             strDerivedTenor,
  133.             strMaturityTenor,
  134.             dblBasis,
  135.             1.
  136.         );
  137.     }

  138.     /*
  139.      * Construct the Array of Deposit Instruments from the given set of parameters
  140.      *
  141.      *      USE WITH CARE: This sample ignores errors and does not handle exceptions.
  142.      */

  143.     private static final CalibratableComponent[] DepositInstrumentsFromMaturityDays (
  144.         final JulianDate dtEffective,
  145.         final int[] aiDay,
  146.         final int iNumFuture,
  147.         final String strCurrency)
  148.         throws Exception
  149.     {
  150.         CalibratableComponent[] aCalibComp = new CalibratableComponent[aiDay.length + iNumFuture];

  151.         for (int i = 0; i < aiDay.length; ++i)
  152.             aCalibComp[i] = SingleStreamComponentBuilder.Deposit (
  153.                 dtEffective,
  154.                 dtEffective.addBusDays (
  155.                     aiDay[i],
  156.                     strCurrency
  157.                 ),
  158.                 ForwardLabel.Create (
  159.                     strCurrency,
  160.                     "3M"
  161.                 )
  162.             );

  163.         CalibratableComponent[] aEDF = SingleStreamComponentBuilder.ForwardRateFuturesPack (
  164.             dtEffective,
  165.             iNumFuture,
  166.             strCurrency
  167.         );

  168.         for (int i = aiDay.length; i < aiDay.length + iNumFuture; ++i)
  169.             aCalibComp[i] = aEDF[i - aiDay.length];

  170.         return aCalibComp;
  171.     }

  172.     /*
  173.      * Construct the Array of Swap Instruments from the given set of parameters
  174.      *
  175.      *      USE WITH CARE: This sample ignores errors and does not handle exceptions.
  176.      */

  177.     private static final FixFloatComponent[] SwapInstrumentsFromMaturityTenor (
  178.         final JulianDate dtSpot,
  179.         final String strCurrency,
  180.         final String[] astrMaturityTenor,
  181.         final double[] adblCoupon)
  182.         throws Exception
  183.     {
  184.         FixFloatComponent[] aIRS = new FixFloatComponent[astrMaturityTenor.length];

  185.         for (int i = 0; i < astrMaturityTenor.length; ++i)
  186.             aIRS[i] = OTCFixFloat (
  187.                 dtSpot,
  188.                 strCurrency,
  189.                 astrMaturityTenor[i],
  190.                 adblCoupon[i]
  191.             );

  192.         return aIRS;
  193.     }

  194.     /*
  195.      * Construct the discount curve using the following steps:
  196.      *  - Construct the array of cash instruments and their quotes.
  197.      *  - Construct the array of swap instruments and their quotes.
  198.      *  - Construct a shape preserving and smoothing KLK Hyperbolic Spline from the cash/swap instruments.
  199.      *
  200.      *      USE WITH CARE: This sample ignores errors and does not handle exceptions.
  201.      */

  202.     private static final MergedDiscountForwardCurve MakeDC (
  203.         final JulianDate dtSpot,
  204.         final String strCurrency)
  205.         throws Exception
  206.     {
  207.         /*
  208.          * Construct the array of Deposit instruments and their quotes.
  209.          */

  210.         CalibratableComponent[] aDepositComp = DepositInstrumentsFromMaturityDays (
  211.             dtSpot,
  212.             new int[] {
  213.                 1, 2, 3, 7, 14, 21, 30, 60
  214.             },
  215.             0,
  216.             strCurrency
  217.         );

  218.         double[] adblDepositQuote = new double[] {
  219.             0.01200, 0.01200, 0.01200, 0.01450, 0.01550, 0.01600, 0.01660, 0.01850
  220.         };

  221.         String[] astrDepositManifestMeasure = new String[] {
  222.             "ForwardRate",
  223.             "ForwardRate",
  224.             "ForwardRate",
  225.             "ForwardRate",
  226.             "ForwardRate",
  227.             "ForwardRate",
  228.             "ForwardRate",
  229.             "ForwardRate"
  230.         };

  231.         /*
  232.          * Construct the array of Swap instruments and their quotes.
  233.          */

  234.         double[] adblSwapQuote = new double[] {
  235.             0.02604,    //  4Y
  236.             0.02808,    //  5Y
  237.             0.02983,    //  6Y
  238.             0.03136,    //  7Y
  239.             0.03268,    //  8Y
  240.             0.03383,    //  9Y
  241.             0.03488,    // 10Y
  242.             0.03583,    // 11Y
  243.             0.03668,    // 12Y
  244.             0.03833,    // 15Y
  245.             0.03854,    // 20Y
  246.             0.03672,    // 25Y
  247.             0.03510,    // 30Y
  248.             0.03266,    // 40Y
  249.             0.03145     // 50Y
  250.         };

  251.         String[] astrSwapManifestMeasure = new String[] {
  252.             "SwapRate",    //  4Y
  253.             "SwapRate",    //  5Y
  254.             "SwapRate",    //  6Y
  255.             "SwapRate",    //  7Y
  256.             "SwapRate",    //  8Y
  257.             "SwapRate",    //  9Y
  258.             "SwapRate",    // 10Y
  259.             "SwapRate",    // 11Y
  260.             "SwapRate",    // 12Y
  261.             "SwapRate",    // 15Y
  262.             "SwapRate",    // 20Y
  263.             "SwapRate",    // 25Y
  264.             "SwapRate",    // 30Y
  265.             "SwapRate",    // 40Y
  266.             "SwapRate"     // 50Y
  267.         };

  268.         CalibratableComponent[] aSwapComp = SwapInstrumentsFromMaturityTenor (
  269.             dtSpot,
  270.             strCurrency,
  271.             new java.lang.String[] {
  272.                 "4Y", "5Y", "6Y", "7Y", "8Y", "9Y", "10Y", "11Y", "12Y", "15Y", "20Y", "25Y", "30Y", "40Y", "50Y"
  273.             },
  274.             adblSwapQuote
  275.         );

  276.         /*
  277.          * Construct a shape preserving and smoothing KLK Hyperbolic Spline from the cash/swap instruments.
  278.          */

  279.         return ScenarioDiscountCurveBuilder.CubicKLKHyperbolicDFRateShapePreserver (
  280.             "KLK_HYPERBOLIC_SHAPE_TEMPLATE",
  281.             new ValuationParams (
  282.                 dtSpot,
  283.                 dtSpot,
  284.                 strCurrency
  285.             ),
  286.             aDepositComp,
  287.             adblDepositQuote,
  288.             astrDepositManifestMeasure,
  289.             aSwapComp,
  290.             adblSwapQuote,
  291.             astrSwapManifestMeasure,
  292.             false
  293.         );
  294.     }

  295.     /*
  296.      * Construct an array of float-float swaps from the corresponding reference (6M) and the derived legs.
  297.      *
  298.      *      USE WITH CARE: This sample ignores errors and does not handle exceptions.
  299.      */

  300.     private static final FloatFloatComponent[] MakexM6MBasisSwap (
  301.         final JulianDate dtSpot,
  302.         final String strCurrency,
  303.         final String[] astrMaturityTenor,
  304.         final int iTenorInMonths)
  305.         throws Exception
  306.     {
  307.         FloatFloatComponent[] aFFC = new FloatFloatComponent[astrMaturityTenor.length];

  308.         for (int i = 0; i < astrMaturityTenor.length; ++i)
  309.             aFFC[i] = OTCFloatFloat (
  310.                 dtSpot,
  311.                 strCurrency,
  312.                 iTenorInMonths + "M",
  313.                 astrMaturityTenor[i],
  314.                 0.
  315.             );

  316.         return aFFC;
  317.     }

  318.     private static final ForwardCurve MakeFC (
  319.         final JulianDate dtSpot,
  320.         final String strCurrency,
  321.         final MergedDiscountForwardCurve dc,
  322.         final int iTenorInMonths,
  323.         final String[] astrxM6MFwdTenor,
  324.         final double[] adblxM6MBasisSwapQuote)
  325.         throws Exception
  326.     {
  327.         /*
  328.          * Construct the 6M-xM float-float basis swap.
  329.          */

  330.         FloatFloatComponent[] aFFC = MakexM6MBasisSwap (
  331.             dtSpot,
  332.             strCurrency,
  333.             astrxM6MFwdTenor,
  334.             iTenorInMonths
  335.         );

  336.         String strBasisTenor = iTenorInMonths + "M";

  337.         ValuationParams valParams = new ValuationParams (
  338.             dtSpot,
  339.             dtSpot,
  340.             strCurrency
  341.         );

  342.         /*
  343.          * Calculate the starting forward rate off of the discount curve.
  344.          */

  345.         double dblStartingFwd = dc.forward (
  346.             dtSpot.julian(),
  347.             dtSpot.addTenor (strBasisTenor).julian()
  348.         );

  349.         /*
  350.          * Set the discount curve based component market parameters.
  351.          */

  352.         CurveSurfaceQuoteContainer mktParams = MarketParamsBuilder.Create (
  353.             dc,
  354.             null,
  355.             null,
  356.             null,
  357.             null,
  358.             null,
  359.             null
  360.         );

  361.         /*
  362.          * Construct the shape preserving forward curve off of Quartic Polynomial Basis Spline.
  363.          */

  364.         return ScenarioForwardCurveBuilder.ShapePreservingForwardCurve (
  365.             "QUARTIC_FWD" + strBasisTenor,
  366.             ForwardLabel.Create (
  367.                 strCurrency,
  368.                 strBasisTenor
  369.             ),
  370.             valParams,
  371.             null,
  372.             mktParams,
  373.             null,
  374.             MultiSegmentSequenceBuilder.BASIS_SPLINE_POLYNOMIAL,
  375.             new PolynomialFunctionSetParams (5),
  376.             aFFC,
  377.             "DerivedParBasisSpread",
  378.             adblxM6MBasisSwapQuote,
  379.             dblStartingFwd
  380.         );
  381.     }

  382.     private static final Map<String, ForwardCurve> MakeFC (
  383.         final JulianDate dt,
  384.         final String strCurrency,
  385.         final MergedDiscountForwardCurve dc)
  386.         throws Exception
  387.     {
  388.         Map<String, ForwardCurve> mapFC = new HashMap<String, ForwardCurve>();

  389.         /*
  390.          * Build and run the sampling for the 1M-6M Tenor Basis Swap from its instruments and quotes.
  391.          */

  392.         ForwardCurve fc1M = MakeFC (
  393.             dt,
  394.             strCurrency,
  395.             dc,
  396.             1,
  397.             new String[] {
  398.                 "1Y", "2Y", "3Y", "4Y", "5Y", "6Y", "7Y", "8Y", "9Y", "10Y", "11Y", "12Y", "15Y", "20Y", "25Y", "30Y"
  399.             },
  400.             new double[] {
  401.                 0.00551,    //  1Y
  402.                 0.00387,    //  2Y
  403.                 0.00298,    //  3Y
  404.                 0.00247,    //  4Y
  405.                 0.00211,    //  5Y
  406.                 0.00185,    //  6Y
  407.                 0.00165,    //  7Y
  408.                 0.00150,    //  8Y
  409.                 0.00137,    //  9Y
  410.                 0.00127,    // 10Y
  411.                 0.00119,    // 11Y
  412.                 0.00112,    // 12Y
  413.                 0.00096,    // 15Y
  414.                 0.00079,    // 20Y
  415.                 0.00069,    // 25Y
  416.                 0.00062     // 30Y
  417.                 }
  418.             );

  419.         mapFC.put (
  420.             "1M",
  421.             fc1M
  422.         );

  423.         /*
  424.          * Build and run the sampling for the 3M-6M Tenor Basis Swap from its instruments and quotes.
  425.          */

  426.         ForwardCurve fc3M = MakeFC (
  427.             dt,
  428.             strCurrency,
  429.             dc,
  430.             3,
  431.             new String[] {
  432.                 "1Y", "2Y", "3Y", "4Y", "5Y", "6Y", "7Y", "8Y", "9Y", "10Y", "11Y", "12Y", "15Y", "20Y", "25Y", "30Y"
  433.             },
  434.             new double[] {
  435.                 0.00186,    //  1Y
  436.                 0.00127,    //  2Y
  437.                 0.00097,    //  3Y
  438.                 0.00080,    //  4Y
  439.                 0.00067,    //  5Y
  440.                 0.00058,    //  6Y
  441.                 0.00051,    //  7Y
  442.                 0.00046,    //  8Y
  443.                 0.00042,    //  9Y
  444.                 0.00038,    // 10Y
  445.                 0.00035,    // 11Y
  446.                 0.00033,    // 12Y
  447.                 0.00028,    // 15Y
  448.                 0.00022,    // 20Y
  449.                 0.00020,    // 25Y
  450.                 0.00018     // 30Y
  451.                 }
  452.             );

  453.         mapFC.put (
  454.             "3M",
  455.             fc3M
  456.         );

  457.         /*
  458.          * Build and run the sampling for the 12M-6M Tenor Basis Swap from its instruments and quotes.
  459.          */

  460.         ForwardCurve fc12M = MakeFC (
  461.             dt,
  462.             strCurrency,
  463.             dc,
  464.             12,
  465.             new String[] {
  466.                 "1Y", "2Y", "3Y", "4Y", "5Y", "6Y", "7Y", "8Y", "9Y", "10Y", "11Y", "12Y", "15Y", "20Y", "25Y", "30Y",
  467.                 "35Y", "40Y" // Extrapolated
  468.             },
  469.             new double[] {
  470.                 -0.00212,    //  1Y
  471.                 -0.00152,    //  2Y
  472.                 -0.00117,    //  3Y
  473.                 -0.00097,    //  4Y
  474.                 -0.00082,    //  5Y
  475.                 -0.00072,    //  6Y
  476.                 -0.00063,    //  7Y
  477.                 -0.00057,    //  8Y
  478.                 -0.00051,    //  9Y
  479.                 -0.00047,    // 10Y
  480.                 -0.00044,    // 11Y
  481.                 -0.00041,    // 12Y
  482.                 -0.00035,    // 15Y
  483.                 -0.00028,    // 20Y
  484.                 -0.00025,    // 25Y
  485.                 -0.00022,    // 30Y
  486.                 -0.00022,    // 35Y Extrapolated
  487.                 -0.00022,    // 40Y Extrapolated
  488.                 }
  489.             );

  490.         mapFC.put (
  491.             "12M",
  492.             fc12M
  493.         );

  494.         return mapFC;
  495.     }

  496.     private static final void RunWithVolCorrelation (
  497.         final FRAStandardComponent fra,
  498.         final ValuationParams valParams,
  499.         final CurveSurfaceQuoteContainer mktParams,
  500.         final ForwardLabel fri,
  501.         final double dblForwardVol,
  502.         final double dblFundingVol,
  503.         final double dblForwardFundingCorr)
  504.         throws Exception
  505.     {
  506.         FundingLabel fundingLabel = FundingLabel.Standard (fri.currency());

  507.         mktParams.setForwardVolatility (
  508.             ScenarioDeterministicVolatilityBuilder.FlatForward (
  509.                 valParams.valueDate(),
  510.                 VolatilityLabel.Standard (fri),
  511.                 fri.currency(),
  512.                 dblForwardVol
  513.             )
  514.         );

  515.         mktParams.setFundingVolatility (
  516.             ScenarioDeterministicVolatilityBuilder.FlatForward (
  517.                 valParams.valueDate(),
  518.                 VolatilityLabel.Standard (fundingLabel),
  519.                 fri.currency(),
  520.                 dblFundingVol
  521.             )
  522.         );

  523.         mktParams.setForwardFundingCorrelation (
  524.             fri,
  525.             fundingLabel,
  526.             new FlatUnivariate (dblForwardFundingCorr)
  527.         );

  528.         Map<String, Double> mapFRAOutput = fra.value (
  529.             valParams,
  530.             null,
  531.             mktParams,
  532.             null
  533.         );

  534.         System.out.println ("\t[" +
  535.             org.drip.numerical.common.FormatUtil.FormatDouble (dblForwardVol, 2, 0, 100.) + "%," +
  536.             org.drip.numerical.common.FormatUtil.FormatDouble (dblFundingVol, 2, 0, 100.) + "%," +
  537.             org.drip.numerical.common.FormatUtil.FormatDouble (dblForwardFundingCorr, 2, 0, 100.) + "%] =" +
  538.             org.drip.numerical.common.FormatUtil.FormatDouble (mapFRAOutput.get ("ParForward"), 1, 4, 100.) + "% |" +
  539.             org.drip.numerical.common.FormatUtil.FormatDouble (mapFRAOutput.get ("QuantoAdjustedParForward"), 1, 4, 100.) + "% |" +
  540.             org.drip.numerical.common.FormatUtil.FormatDouble (mapFRAOutput.get ("MultiplicativeQuantoAdjustment"), 1, 4, 1.) + " | " +
  541.             org.drip.numerical.common.FormatUtil.FormatDouble (mapFRAOutput.get ("AdditiveQuantoAdjustment"), 1, 1, 10000.));
  542.     }

  543.     public static final void main (
  544.         final String[] astrArgs)
  545.         throws Exception
  546.     {
  547.         /*
  548.          * Initialize the Credit Analytics Library
  549.          */

  550.         EnvManager.InitEnv ("");

  551.         String strTenor = "3M";
  552.         String strCurrency = "CHF";

  553.         JulianDate dtToday = DateUtil.Today().addTenor ("0D");

  554.         /*
  555.          * Construct the Discount Curve using its instruments and quotes
  556.          */

  557.         MergedDiscountForwardCurve dc = MakeDC (
  558.             dtToday,
  559.             strCurrency
  560.         );

  561.         Map<String, ForwardCurve> mapFC = MakeFC (
  562.             dtToday,
  563.             strCurrency,
  564.             dc
  565.         );

  566.         ForwardLabel fri = ForwardLabel.Create (
  567.             strCurrency,
  568.             strTenor
  569.         );

  570.         FRAStandardComponent fra = SingleStreamComponentBuilder.FRAStandard (
  571.             dtToday.addTenor (strTenor),
  572.             fri,
  573.             0.006
  574.         );

  575.         CurveSurfaceQuoteContainer mktParams = MarketParamsBuilder.Create (
  576.             dc,
  577.             mapFC.get (strTenor),
  578.             null,
  579.             null,
  580.             null,
  581.             null,
  582.             null,
  583.             null
  584.         );

  585.         ValuationParams valParams = new ValuationParams (
  586.             dtToday,
  587.             dtToday,
  588.             strCurrency
  589.         );

  590.         double[] adblSigmaFwd = new double[] {
  591.             0.1, 0.2, 0.3, 0.4, 0.5
  592.         };
  593.         double[] adblSigmaFwd2DomX = new double[] {
  594.             0.10, 0.15, 0.20, 0.25, 0.30
  595.         };
  596.         double[] adblCorrFwdFwd2DomX = new double[] {
  597.             -0.99, -0.50, 0.00, 0.50, 0.99
  598.         };

  599.         System.out.println ("\tPrinting the FRA Output in Order (Left -> Right):");

  600.         System.out.println ("\t\tParForward (%)");

  601.         System.out.println ("\t\tQuantoAdjustedParForward (%)");

  602.         System.out.println ("\t\tMultiplicativeQuantoAdjustment (absolute)");

  603.         System.out.println ("\t\tAdditiveQuantoAdjustment (bp)");

  604.         System.out.println ("\t-------------------------------------------------------------");

  605.         System.out.println ("\t-------------------------------------------------------------");

  606.         for (double dblSigmaFwd : adblSigmaFwd) {
  607.             for (double dblSigmaFwd2DomX : adblSigmaFwd2DomX) {
  608.                 for (double dblCorrFwdFwd2DomX : adblCorrFwdFwd2DomX)
  609.                     RunWithVolCorrelation (
  610.                         fra,
  611.                         valParams,
  612.                         mktParams,
  613.                         fri,
  614.                         dblSigmaFwd,
  615.                         dblSigmaFwd2DomX,
  616.                         dblCorrFwdFwd2DomX
  617.                     );
  618.             }
  619.         }

  620.         EnvManager.TerminateEnv();
  621.     }
  622. }