JurisdictionIBORIndexDefinition.java

  1. package org.drip.sample.forward;

  2. import org.drip.analytics.support.CompositePeriodBuilder;
  3. import org.drip.market.definition.*;
  4. import org.drip.service.env.EnvManager;

  5. /*
  6.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  7.  */

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

  71. /**
  72.  * <i>JurisdictionIBORIndexDefinition</i> demonstrates the functionality to retrieve the IBOR settings for
  73.  * the various Jurisdictions.
  74.  *  
  75.  * <br><br>
  76.  *  <ul>
  77.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/AnalyticsCore.md">Analytics Core Module</a></li>
  78.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics Library</a></li>
  79.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/README.md">Sample</a></li>
  80.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/forward/README.md">Forward Rate Curve Construction</a></li>
  81.  *  </ul>
  82.  * <br><br>
  83.  *
  84.  * @author Lakshmi Krishnamurthy
  85.  */

  86. public class JurisdictionIBORIndexDefinition {
  87.     private static final String AccrualType (
  88.         final int iAccrualCompounding)
  89.     {
  90.         return CompositePeriodBuilder.ACCRUAL_COMPOUNDING_RULE_ARITHMETIC == iAccrualCompounding ? "ARITHMETIC" : " GEOMETRIC";
  91.     }

  92.     private static final void DisplayNameOvernightSetting (
  93.         final String strName)
  94.     {
  95.         IBORIndex index = IBORIndexContainer.IndexFromName (strName);

  96.         String strLongestMaturity = index.longestMaturity();

  97.         String strShortestMaturity = index.shortestMaturity();

  98.         System.out.println ("\t[" +
  99.             index.currency() + "] => " +
  100.             index.dayCount() + " | " +
  101.             index.spotLag() + " | " +
  102.             AccrualType (index.accrualCompoundingRule()) + " | " +
  103.             (strShortestMaturity.isEmpty() ? "  " : strShortestMaturity) + " | " +
  104.             (strLongestMaturity.isEmpty() ? "   " : strLongestMaturity) + " | " +
  105.             index.name()
  106.         );
  107.     }

  108.     public static final void main (
  109.         String[] args)
  110.     {
  111.         EnvManager.InitEnv ("");

  112.         System.out.println ("\n\t---------------\n\t---------------\n");

  113.         DisplayNameOvernightSetting ("CHF-LIBOR");

  114.         DisplayNameOvernightSetting ("EUR-EURIBOR");

  115.         DisplayNameOvernightSetting ("EUR-LIBOR");

  116.         DisplayNameOvernightSetting ("GBP-LIBOR");

  117.         DisplayNameOvernightSetting ("JPY-LIBOR");

  118.         DisplayNameOvernightSetting ("USD-LIBOR");

  119.         System.out.println ("\n\t---------------\n\t---------------\n");

  120.         DisplayNameOvernightSetting ("AUD-LIBOR");

  121.         DisplayNameOvernightSetting ("CAD-LIBOR");

  122.         DisplayNameOvernightSetting ("CZK-LIBOR");

  123.         DisplayNameOvernightSetting ("DKK-LIBOR");

  124.         DisplayNameOvernightSetting ("HKD-LIBOR");

  125.         DisplayNameOvernightSetting ("HUF-LIBOR");

  126.         DisplayNameOvernightSetting ("IDR-LIBOR");

  127.         DisplayNameOvernightSetting ("INR-LIBOR");

  128.         DisplayNameOvernightSetting ("NOK-LIBOR");

  129.         DisplayNameOvernightSetting ("NZD-LIBOR");

  130.         DisplayNameOvernightSetting ("PLN-LIBOR");

  131.         DisplayNameOvernightSetting ("RMB-LIBOR");

  132.         DisplayNameOvernightSetting ("SGD-LIBOR");

  133.         DisplayNameOvernightSetting ("SEK-LIBOR");

  134.         DisplayNameOvernightSetting ("SKK-LIBOR");

  135.         DisplayNameOvernightSetting ("ZAR-LIBOR");

  136.         EnvManager.TerminateEnv();
  137.     }
  138. }