#include "cdate.h"
#include "dateconv.h"
#include "busday.h"
#include "dateadj.h"
Defines | |
#define | JPMCDS_BAD_DCC -2L |
#define | JPMCDS_ACT_365 1L |
#define | JPMCDS_ACT_365F 2L |
#define | JPMCDS_ACT_360 3L |
#define | JPMCDS_B30_360 4L |
#define | JPMCDS_B30E_360 5L |
#define | JPMCDS_ACT_ACT JPMCDS_ACT_365 |
#define | JPMCDS_EFFECTIVE_RATE 8L |
#define | JPMCDS_DCC_LAST JPMCDS_EFFECTIVE_RATE |
Functions | |
int | JpmcdsDtFwdAny (TDate startDate, TDateInterval *interval, TDate *sumDate) |
Moves forward by the specified interval. | |
int | JpmcdsDayCountFraction (TDate beginDate, TDate endDate, long method, double *yearFrac) |
Calculates Day Count Fractions. | |
int | JpmcdsDaysDiff (TDate beginDate, TDate endDate, long method, long *numDays) |
Calculates difference between two dates. | |
int | JpmcdsIsLeap (TDate date, long *isLeap) |
Test if date falls in a leap year. | |
int | JpmcdsYear (TDate, int *) |
Given a date in TDate, retrieve year as a four digit year. | |
int | JpmcdsDaysLeftThisYear (TDate, int, long *) |
Calculates the number of days left in a year. | |
int | JpmcdsYearStart (TDate, TDate *) |
Given a date in TDate, retrieve beginning of the year in TDate format. | |
int | JpmcdsDateFwdThenAdjust (TDate date, TDateInterval *interval, long badDayMethod, char *holidayFile, TDate *advAdjustedDate) |
Moves forward by the specified TDateInterval, and then adjust to find a good day. |
#define JPMCDS_ACT_360 3L |
Actual/360
#define JPMCDS_ACT_365 1L |
Actual/365
#define JPMCDS_ACT_365F 2L |
Actual/365 Fixed
#define JPMCDS_B30_360 4L |
30/360
#define JPMCDS_B30E_360 5L |
30E/360
#define JPMCDS_BAD_DCC -2L |
Dummmy Day Count Conv for Brazilian bods
#define JPMCDS_EFFECTIVE_RATE 8L |
Effective rate - YF always 1
int JpmcdsDateFwdThenAdjust | ( | TDate | date, | |
TDateInterval * | interval, | |||
long | badDayMethod, | |||
char * | holidayFile, | |||
TDate * | advAdjustedDate | |||
) |
Moves forward by the specified TDateInterval, and then adjust to find a good day.
Basically a call to JpmcdsDtFwdAny followed by a call to JpmcdsBusinessDay.
date | (I) Start date | |
interval | (I) Interval to advance by | |
badDayMethod | (I) JPMCDS_BAD_DAY_XYZ | |
holidayFile | (I) Holiday file to use | |
advAdjustedDate | (O) Advanced adjusted date |
Calculates Day Count Fractions.
Calculates Day Count Fractions for following methods: 30/360, 30E/360, ACT/365, ACT/365F, ACT/360, etc.
Calculates difference between two dates.
Methods currently covered:
This function calculates the numerator for day count fraction
beginDate | (I) | |
endDate | (I) | |
method | (I) Specifies day count method: |
JPMCDS_B30E_360 - 30E/360 AIBD RULE 220
JPMCDS_ACT_365 - ACT/365 or ACT/ACT
JPMCDS_ACT_365F - ACT/365 Fixed
JPMCDS_ACT_360 - ACT/360
numDays | (O) Number days between two dates |
int JpmcdsIsLeap | ( | TDate | date, | |
long * | isLeap | |||
) |
Test if date falls in a leap year.
date | (I) | |
isLeap | (O) 0 - if not a leap year |
Given a date in TDate, retrieve beginning of the year in TDate format.