Dates, calendar and holidays

Dates and everything else. More...

Modules

 Calendar and Holidays
 Calendars and holidays for a given currency, stock exchange, etc.
 
 Time Grid
 Time grids and time discretization patterns.
 
 Year Fractions
 Year fraction calculators.
 

Classes

class  julian::Date
 Class implements a date object. More...
 
class  julian::Tenor
 Class implements a tenor object. More...
 

Enumerations

enum  julian::TimeUnit {
  DAY, WEEK, MONTH, QUARTER,
  YEAR, OVERNIGHT, TOMORROWNEXT, SPOTDATE,
  TODAY, SPOTNEXT
}
 
enum  julian::Weekday {
  MON = 2, TUE = 3, WED = 4, THU = 5,
  FRI = 6, SAT = 0, SUN = 1
}
 
enum  julian::Frequency {
  NOFREQ = 0, MONTHLY = 1, QUARTERLY = 3, SEMIANNUALLY = 6,
  ANNUALLY = 12
}
 
enum  julian::NameOfMonth {
  JAN = 1, FEB = 2, MAR = 3, APR = 4,
  MAY = 5, JUN = 6, JUL = 7, AUG = 8,
  SEP = 9, OCT = 10, NOV = 11, DEC = 12
}
 

Functions

template<class Archive >
void julian::serialize (Archive &ar, TimeUnit &g, const unsigned int version)
 interface used by Boost serialization library More...
 
std::ostream & julian::operator<< (std::ostream &os, Frequency &f)
 Overloading << operator for Frequency enumeration. More...
 

Detailed Description

Dates and everything else.

Module contains date, time units and tenor classes. It also contains the calendar class that allows to calculate the tenor according to specific day rolling convention, spot lag value and set of holidays. In this module the year fraction calculators are also gathered.

Enumeration Type Documentation

Frequency enumeration encapsulates the concept of frequency. It is helpful in constructing financial instruments such as bonds or swaps. The numbers represent number of months in every Frequency.

Enumeration contains the name of months. Months have number values that enables those types to be use in date creation:

Date d1(2015,OCT,28);
Date d2(2011,JAN,13);
Date d3(2020,MAR,1);

TimeUnit represent the units of time, such as Day, Week, Month, Quarter and Year. The enumeration contains also pseudo-tenors such as OverNight, TommorowNext, Today, SpotNext and SpotDate. Those names are degenerated tenors and cannot be used in all situations. This is because the properly usage of this tenors requires defining holidays and weekends. They were defined to obtain unified method of constructing financial instruments.

Weekday enumeration contains the names of days of the week. The number value of each day is: Saturday = 0, Sunday = 1, Monday = 2, ... , Friday = 6. The numbers are set in such way because they are the result of calculating date.number mod 7 (1900-JAN-01 was Sunday). If one wants to check if for example 2015-10-28 is Friday he/she can write:

Date d(2015, OCT, 28);
if(d.dateNumber() % 7 == FRI) {
std::cout<<"Friday!";
} else {
std::cout<<"Sorry, but ... no!";
}

Function Documentation

std::ostream& julian::operator<< ( std::ostream &  os,
Frequency f 
)
inline

Overloading << operator for Frequency enumeration.

template<class Archive >
void julian::serialize ( Archive &  ar,
TimeUnit g,
const unsigned int  version 
)

interface used by Boost serialization library