QuantLib: Thirty360 Class Reference

A free/open-source library for quantitative finance Reference manual - version 1.6

- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | List of all members
Thirty360 Class Reference
Date and time calculations » Day counters

30/360 day count convention More...

`#include <ql/time/daycounters/thirty360.hpp>`

Inheritance diagram for Thirty360:
[legend]

## Public Types
enum | Convention { USA, BondBasis, European, EurobondBasis, Italian }

## Public Member Functions
| Thirty360 (Convention c=Thirty360::BondBasis)
Public Member Functions inherited from DayCounter
| DayCounter ()
bool | empty () const
| Returns whether or not the day counter is initialized.
std::string | name () const
| Returns the name of the day counter. More...
BigInteger | dayCount (const Date &, const Date &) const
| Returns the number of days between two dates.
Time | yearFraction (const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
| Returns the period between two dates as a fraction of year.

## Additional Inherited Members
Protected Member Functions inherited from DayCounter
| DayCounter (const boost::shared_ptr< Impl > &impl)
Protected Attributes inherited from DayCounter
boost::shared_ptr< Impl > | impl_
Related Functions inherited from DayCounter
bool | operator== (const DayCounter &, const DayCounter &)
bool | operator!= (const DayCounter &, const DayCounter &)
std::ostream & | operator<< (std::ostream &, const DayCounter &)

## Detailed Description

30/360 day count convention

The 30/360 day count can be calculated according to US, European, or Italian conventions.

US (NASD) convention: if the starting date is the 31st of a month, it becomes equal to the 30th of the same month. If the ending date is the 31st of a month and the starting date is earlier than the 30th of a month, the ending date becomes equal to the 1st of the next month, otherwise the ending date becomes equal to the 30th of the same month. Also known as "30/360", "360/360", or "Bond Basis"

European convention: starting dates or ending dates that occur on the 31st of a month become equal to the 30th of the same month. Also known as "30E/360", or "Eurobond Basis"

Italian convention: starting dates or ending dates that occur on February and are grater than 27 become equal to 30 for computational sake.

Examples:
  BermudanSwaption.cpp, Bonds.cpp, ConvertibleBonds.cpp, Repo.cpp, and swapvaluation.cpp.