datelist.h File Reference

#include "cgeneral.h"
#include "bastypes.h"
#include "dtlist.h"

Functions

TDateListJpmcdsNewDateList (TDate startDate, TDate maturityDate, TDateInterval *interval, TBoolean stubAtEnd)
 Makes an array of dates from startDate, MaturityDate, & interval.
TDateListJpmcdsNewDateListExtended (TDate startDate, TDate maturityDate, TDateInterval *interval, TBoolean stubAtEnd)
 Makes an array of dates using startDate, MaturityDate, & interval.
TDateListJpmcdsNewDateListExtendedRoll (TDate startDate, TDate maturityDate, TDate rollDate, TDateInterval *interval, TBoolean stubAtEnd)
 Makes an array of dates using startDate, MaturityDate, rollDate & interval.
TDateListJpmcdsNewDateListFromTCurve (TCurve *curve)
 Allocates a new TDateList and copies supplied dates into it from supplied TCurve.
TDateListJpmcdsNewPayDates (TDate startDate, TDate matDate, TDateInterval *payInterval, TBoolean stubAtEnd)
 Allocates a new TDateList by calling JpmcdsNewDateList, and then removing the startDate.
TDateListJpmcdsNewDateListBusDayAdj (TDateList *dateList, long badDayConv, char *holidayFile)
 Creates a new business-day adjusted dateList from an UN-adjusted datelist, using the supplied busisness day adjustment convention.
int JpmcdsDateListBusDayAdj (TDateList *dateList, long badDayConv, char *holidayFile)
 Adjusts a datelist (in-place) according to the supplied business day adjustment convention.

Detailed Description


Function Documentation

int JpmcdsDateListBusDayAdj ( TDateList dateList,
long  badDayConv,
char *  holidayFile 
)

Adjusts a datelist (in-place) according to the supplied business day adjustment convention.

Parameters:
dateList (I/O) Date list to adjust (in-place)
badDayConv (I) See JpmcdsBusinessDay
holidayFile (I) Holiday date file

TDateList* JpmcdsNewDateList ( TDate  startDate,
TDate  maturityDate,
TDateInterval interval,
TBoolean  stubAtEnd 
)

Makes an array of dates from startDate, MaturityDate, & interval.

If (maturityDate-startDate) divided by interval is not an integer, there is a stub. If stubAtEnd is set, the stub is placed at the end; otherwise, it is placed at the beginning. Unlike JpmcdsNewDateListExtended, the startDate and maturityDate are always included, and are the first and last dates respectively. Assuming there is no stub, dates created are of the form: baseDate + idx*Interval, where startIdx <= idx <= Time2Maturity/Interval Returns a new DateList on success, and NULL on failure.

TDateList* JpmcdsNewDateListExtended ( TDate  startDate,
TDate  maturityDate,
TDateInterval interval,
TBoolean  stubAtEnd 
)

Makes an array of dates using startDate, MaturityDate, & interval.

If time2Maturity/interval is not an integer, there is a stub. If stubAtEnd is set, the stub is placed at the end; otherwise, it is placed at the beginning. If there is a stub at the END, the MaturityDate is NOT included in the list; but the NEXT date is. If there is a stub at the BEGINNING, the startDate is NOT included in the list; but the PREVIOUS date is. This is necessary for Actual/Actual stub calculation. Assuming there is no stub, dates created are of the form: baseDate + idx*Interval, where startIdx <= idx <= Time2Maturity/Interval Returns a new DateList on success, and NULL on failure.

TDateList* JpmcdsNewDateListExtendedRoll ( TDate  startDate,
TDate  maturityDate,
TDate  rollDate,
TDateInterval interval,
TBoolean  stubAtEnd 
)

Makes an array of dates using startDate, MaturityDate, rollDate & interval.

If rollDate is non-zero and stubAtEnd is False, then the rollDate is used to generate cash flow dates. First starting from roll-date we see if we can count forward an integral number of intervals to the maturity date. If this is so then we can generate our datelist by counting forward from the rolldate.

Returns a new DateList on success, and NULL on failure.

TDateList* JpmcdsNewDateListFromTCurve ( TCurve curve  ) 

Allocates a new TDateList and copies supplied dates into it from supplied TCurve.

This provides a convenient way to isolate the dates of a TCurve.


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.