#include "yearfrac.h"
Data Structures | |
struct | TStubMethod |
Combines all the types of stub information for swaps. More... | |
Defines | |
#define | JPMCDS_BDC_MASK 0x000000FF |
#define | JPMCDS_STUB_POS_MASK 0x0000FF00 |
#define | JPMCDS_STUB_POS_SHIFT 8 |
#define | JPMCDS_STUB_POSN_MASK 1 |
#define | JPMCDS_STUB_POSN_FRONT 0 |
#define | JPMCDS_STUB_POSN_BACK 1 |
#define | JPMCDS_STUB_LENGTH_MASK 2 |
#define | JPMCDS_STUB_LENGTH_SHORT 0 |
#define | JPMCDS_STUB_LENGTH_LONG 2 |
Typedefs | |
typedef long int | TBadDayAndStubPos |
Enumerations | |
enum | TStubPos { JPMCDS_STUB_POS_DEFAULT_AUTO = 0, JPMCDS_STUB_POS_DEFAULT_FRONT = 1, JPMCDS_STUB_POS_DEFAULT_BACK = 2 } |
Used to pass the default stub position. | |
Functions | |
int | JpmcdsStubPayment (TDate prevCouponDate, TDate nextCoupon, TDate stubStart, TDate stubEnd, double rate, long couponDayCountConv, double *stubPayment) |
Computes stub payment. | |
int | JpmcdsStringToStubMethod (char *name, TStubMethod *stubMethod) |
This function converts a string to a stub method. | |
int | JpmcdsIsEndStub (TDate startDate, TDate maturityDate, TDateInterval *ivl, TStubPos stubPos, TBoolean *isEndStub) |
Returns TRUE if a stub should be at the end. | |
int | JpmcdsStubPosMake (long stubPosValue, TStubPos *stubPos) |
Creates a TStubPos from a long. | |
int | JpmcdsBadDayAndStubPosSplit (TBadDayAndStubPos badDayAndStubPos, long *badDayConv, TStubPos *stubPos) |
Extracts TStubPos and bad day convention from TBadDayAndStubPos. |
int JpmcdsBadDayAndStubPosSplit | ( | TBadDayAndStubPos | badDayAndStubPos, | |
long * | badDayConv, | |||
TStubPos * | stubPos | |||
) |
Extracts TStubPos and bad day convention from TBadDayAndStubPos.
badDayAndStubPos | (I) BDC and stub position | |
badDayConv | (O) Bad day convention | |
stubPos | (O) Stub position |
int JpmcdsIsEndStub | ( | TDate | startDate, | |
TDate | maturityDate, | |||
TDateInterval * | ivl, | |||
TStubPos | stubPos, | |||
TBoolean * | isEndStub | |||
) |
Returns TRUE if a stub should be at the end.
The decision is based on the following. 1. First the default stub position is checked. If this is a back stub then return TRUE - if a front stub return FALSE. 2. If the default stub position is auto then the function will return TRUE, unless there is a stub in whach case FALSE is returned.
startDate | (I) Start date | |
maturityDate | (I) Maturity date | |
ivl | (I) Interval | |
stubPos | (I) Stub position | |
isEndStub | (O) TRUE if end stub |
int JpmcdsStringToStubMethod | ( | char * | name, | |
TStubMethod * | stubMethod | |||
) |
This function converts a string to a stub method.
name | (I) Stub method name | |
stubMethod | (O) Stub method returned |
int JpmcdsStubPayment | ( | TDate | prevCouponDate, | |
TDate | nextCoupon, | |||
TDate | stubStart, | |||
TDate | stubEnd, | |||
double | rate, | |||
long | couponDayCountConv, | |||
double * | stubPayment | |||
) |
Computes stub payment.
Minus accrued only set for Bond option with Front Stub.
prevCouponDate | (I) Needed for Actual/Actual | |
nextCoupon | (I) Needed for Actual/Actual | |
stubStart | (I) When stub starts | |
stubEnd | (I) When stub ends | |
rate | (I) Annual rate | |
couponDayCountConv | (I) See JpmcdsDayCountFraction | |
stubPayment | (O) At stub End date |
int JpmcdsStubPosMake | ( | long | stubPosValue, | |
TStubPos * | stubPos | |||
) |
Creates a TStubPos from a long.
stubPosValue | (I) Number representing stub position | |
stubPos | (O) Stub position |