View Javadoc
1   /*
2    * ObjectLab, http://www.objectlab.co.uk/open is sponsoring the ObjectLab Kit.
3    *
4    * Based in London, we are world leaders in the design and development
5    * of bespoke applications for the securities financing markets.
6    *
7    * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a>
8    *           ___  _     _           _   _          _
9    *          / _ \| |__ (_) ___  ___| |_| |    __ _| |__
10   *         | | | | '_ \| |/ _ \/ __| __| |   / _` | '_ \
11   *         | |_| | |_) | |  __/ (__| |_| |__| (_| | |_) |
12   *          \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
13   *                   |__/
14   *
15   *                     www.ObjectLab.co.uk
16   *
17   * $Id$
18   *
19   * Copyright 2006 the original author or authors.
20   *
21   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
22   * use this file except in compliance with the License. You may obtain a copy of
23   * the License at
24   *
25   * http://www.apache.org/licenses/LICENSE-2.0
26   *
27   * Unless required by applicable law or agreed to in writing, software
28   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
29   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
30   * License for the specific language governing permissions and limitations under
31   * the License.
32   */
33  package net.objectlab.kit.datecalc.common;
34  
35  /**
36   * Defines some standard Day Count bases.
37   *
38   * To read about the most common Day Count Conventions, you can refer to the
39   * <a href="http://www.fincad.com/support/developerfunc/mathref/Daycount.htm">
40   * following document</a> or <a href="https://en.wikipedia.org/wiki/Day_count_convention">here</a>.
41   *
42   * @author Benoit Xhenseval
43   */
44  public enum PeriodCountBasis {
45      /**
46       * 30/360, means that day count fractions are calculated assuming 30 day
47       * months and 360 days in a year. The second date is only adjusted if the
48       * first date is on the 31st of a month.
49       */
50      CONV_30_360,
51  
52      /**
53       * 30E/360, means that day count fractions are calculated assuming 30 day
54       * months and 360 days in a year. In this case, the second date is always
55       * adjusted to the 30th, if it is the 31st.
56       */
57      CONV_360E_ISDA,
58  
59      /**
60       * 30E+/360, means that day count fractions are calculated assuming 30 day
61       * months and 360 days in a year. If the second date is on the 31st, it is
62       * adjusted to the 30th and a second month is incremented by one.
63       */
64      CONV_360E_ISMA,
65  
66      // -----------------------------------------------------------------------
67      //
68      // ObjectLab, world leaders in the design and development of bespoke
69      // applications for the securities financing markets.
70      // www.ObjectLab.co.uk
71      //
72      // -----------------------------------------------------------------------
73  
74      /**
75       * Actual/Actual, means that the numerator is the number of days between the
76       * two dates. The denominator is the actual number of days in the coupon
77       * period multiplied by the coupon frequency. This is mainly relates to
78       * bonds. This normally results in day count factors of 1.0 for annual
79       * coupons, 0.5 for semi annual coupons and 0.25 for quarterly coupons.
80       */
81      ACT_ACT,
82  
83      /**
84       * Actual/360, known in the United States as money market basis, has a day
85       * count fraction equal to the number of days between the payment dates,
86       * divided by 360.
87       */
88      ACT_360,
89  
90      /**
91       * Actual/365(Fixed), known as bond basis in the United States, means that
92       * the day count fraction is equal to the number of days between the last
93       * payment date and the next date divided by 365.
94       */
95      ACT_365
96  }
97  
98  /*
99   * ObjectLab, http://www.objectlab.co.uk/open is sponsoring the ObjectLab Kit.
100  *
101  * Based in London, we are world leaders in the design and development
102  * of bespoke applications for the securities financing markets.
103  *
104  * <a href="http://www.objectlab.co.uk/open">Click here to learn more about us</a>
105  *           ___  _     _           _   _          _
106  *          / _ \| |__ (_) ___  ___| |_| |    __ _| |__
107  *         | | | | '_ \| |/ _ \/ __| __| |   / _` | '_ \
108  *         | |_| | |_) | |  __/ (__| |_| |__| (_| | |_) |
109  *          \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
110  *                   |__/
111  *
112  *                     www.ObjectLab.co.uk
113  */