cdate.h File Reference

#include "cgeneral.h"

Data Structures

struct  TDateInterval
 Definition of a date interval. More...
struct  TDateList
 A list of dates. More...
struct  TDateAdjIntvl
 A holiday-adjusted date interval. More...

Defines

#define MAX_DAYS_PER_MONTH   31
#define JPMCDS_MONTHS_PER_YEAR   12
#define JPMCDS_MONTHS_PER_SEMI   6
#define JPMCDS_MONTHS_PER_QUARTER   3
#define JPMCDS_DAYS_PER_WEEK   7
#define JPMCDS_DAYS_PER_YEAR   365
#define JPMCDS_YEARS_PER_DAY   (1./365.)
#define JPMCDS_DAYS_PER_LUNAR_MONTH   28
#define JPMCDS_WEEKS_PER_LUNAR_MONTH   4
#define SET_TDATE_INTERVAL(di, periods, period_type)
#define TDATE_INTERVALS_EQUAL(d1, d2)   ((d1).prd == (d2).prd && (d1).prd_typ == (d2).prd_typ)
#define JPMCDS_DATE_ADJ_TYPE_CALENDAR   0
#define JPMCDS_DATE_ADJ_TYPE_BUSINESS   1
#define JPMCDS_DATE_ADJ_TYPE_WEEKDAY   2
#define JPMCDS_SET_ADJ_INTERVAL_DAYS(adjIntval, days)

Typedefs

typedef long int TDate
 The integer type representing dates.
typedef double TDateTime
 The value of TDate with any fractional part being a fraction of elapsed day.

Detailed Description


Define Documentation

#define JPMCDS_SET_ADJ_INTERVAL_DAYS ( adjIntval,
days   ) 

Value:

adjIntval.interval.prd = days;             \
adjIntval.interval.prd_typ = 'D';          \
adjIntval.isBusDays = JPMCDS_DATE_ADJ_TYPE_CALENDAR;  \
adjIntval.holidayFile = NULL;              \
adjIntval.badDayConv = JPMCDS_BAD_DAY_NONE;

#define SET_TDATE_INTERVAL ( di,
periods,
period_type   ) 

Value:

do {                                                 \
(di).prd = (periods);                                \
(di).prd_typ = (period_type);                        \
(di).flag = 0;                                       \
} while(0)


Distributed by BN Algorithms Ltd -- consulting in quantitative finance, mathematical algorithms and software implementations. CDS Home Page. For enquires contact webs@bnikolic.co.uk.
This documentation is derived from ISDA CDS Standard Model version 1.7. You can get a copy of the original ISDA code at www.bnikolic.co.uk. This is a derivative work under the terms of the ISDA CDS Standard Model Public License. BN Algorithms Ltd licenses this work to you solely for on-screen viewing on your own computer. Making copies and further distribution of this work is prohibited.
This documentation is provided "as-is", without warranty of any kind, either expressed or implied, including, without limitation, warranties that the documentation is free of defects, merchantable, fit for a particular purpose or non-infringing. the entire risk as to the quality of the documentation is with you. Should this documentation prove defective in any respect, you (not the licensor) assume the cost of any necessary correction. This disclaimer of warranty constitutes an essential part of this license.