QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Private Member Functions | List of all members
Thirty360 Class Reference

30/360 day count convention More...

#include <thirty360.hpp>

+ Inheritance diagram for Thirty360:
+ Collaboration diagram for Thirty360:

Classes

class  EU_Impl
 
class  ISDA_Impl
 
class  ISMA_Impl
 
class  IT_Impl
 
class  NASD_Impl
 
class  Thirty360_Impl
 
class  US_Impl
 

Public Types

enum  Convention {
  USA , BondBasis , European , EurobondBasis ,
  Italian , German , ISMA , ISDA ,
  NASD
}
 

Public Member Functions

 Thirty360 (Convention c, const Date &terminationDate=Date())
 
- Public Member Functions inherited from DayCounter
 DayCounter ()=default
 
bool empty () const
 Returns whether or not the day counter is initialized. More...
 
std::string name () const
 Returns the name of the day counter. More...
 
Date::serial_type dayCount (const Date &, const Date &) const
 Returns the number of days between two dates. More...
 
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. More...
 

Static Private Member Functions

static ext::shared_ptr< DayCounter::Implimplementation (Convention c, const Date &terminationDate)
 

Additional Inherited Members

- Protected Member Functions inherited from DayCounter
 DayCounter (ext::shared_ptr< Impl > impl)
 
- Protected Attributes inherited from DayCounter
ext::shared_ptr< Implimpl_
 

Detailed Description

30/360 day count convention

The 30/360 day count can be calculated according to a number of conventions.

US convention: if the starting date is the 31st of a month or the last day of February, 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 the 30th or 31th of a month, the ending date becomes equal to the 30th. If the ending date is the last of February and the starting date is also the last of February, the ending date becomes equal to the 30th. Also known as "30/360" or "360/360".

Bond Basis 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 the 30th or 31th of a month, the ending date also becomes equal to the 30th of the month. Also known as "US (ISMA)".

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 greater than 27 become equal to 30 for computational sake.

ISDA convention: starting or ending dates on the 31st of the month become equal to 30; starting dates or ending dates that occur on the last day of February also become equal to 30, except for the termination date. Also known as "30E/360 ISDA", "30/360 ISDA", or "30/360 German".

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.

Examples
BermudanSwaption.cpp, Bonds.cpp, CDS.cpp, ConvertibleBonds.cpp, Gaussian1dModels.cpp, MulticurveBootstrapping.cpp, and Repo.cpp.

Definition at line 76 of file thirty360.hpp.

Member Enumeration Documentation

◆ Convention

enum Convention
Enumerator
USA 
BondBasis 
European 
EurobondBasis 
Italian 
German 
ISMA 
ISDA 
NASD 

Definition at line 78 of file thirty360.hpp.

Constructor & Destructor Documentation

◆ Thirty360()

Thirty360 ( Convention  c,
const Date terminationDate = Date() 
)
explicit

Definition at line 134 of file thirty360.hpp.

Member Function Documentation

◆ implementation()

ext::shared_ptr< DayCounter::Impl > implementation ( Thirty360::Convention  c,
const Date terminationDate 
)
staticprivate

Definition at line 35 of file thirty360.cpp.