cfinanci.h File Reference

#include "cgeneral.h"
#include "cdate.h"

Defines

#define JPMCDS_CONTINUOUS_BASIS   5000
 Means continuous compounding.
#define JPMCDS_DISCOUNT_RATE   512
 Discount RATE (not factor) K's b-Day.
#define JPMCDS_SIMPLE_BASIS   0
 Means simple interest.
#define JPMCDS_ANNUAL_BASIS   1
 Annual compounding.
#define JPMCDS_DISCOUNT_FACTOR   -2
 Rate is stored as a discount factor.

Functions

int JpmcdsRateToDiscount (double rate, TDate startDate, TDate endDate, long rateDayCountConv, long rateType, double *discount)
 Convert from a given rate to a discount factor.
int JpmcdsDiscountToRate (double discount, TDate startDate, TDate endDate, long rateDayCountConv, long rateType, double *rate)
 Convert from a given discount factor to a rate.
int JpmcdsDiscountToRateYearFrac (double discount, double yearFraction, double basis, double *rate)
 Convert from a discount factor to a rate using a year fraction.
int JpmcdsRateToDiscountYearFrac (double rate, double yearFraction, double basis, double *discount)
 Convert from a rate to a discount factor using a year fraction.
int JpmcdsRateValid (char *routine, double rate, TDate startDate, TDate endDate, long rateDayCountConv, double rateBasis)
 Checks whether a rate is valid between two dates.
int JpmcdsRateValidYearFrac (char *routine, double rate, double yearFraction, double basis)
 Checks whether a rate is valid between two dates.

Detailed Description


Function Documentation

int JpmcdsDiscountToRate ( double  discount,
TDate  startDate,
TDate  endDate,
long  rateDayCountConv,
long  rateType,
double *  rate 
)

Convert from a given discount factor to a rate.

Parameters:
discount (I) Discount factor
startDate (I) Start date
endDate (I) End date
rateDayCountConv (I) See JpmcdsDayCountFraction
rateType (I) Type of rate
rate (O) Output rate

int JpmcdsDiscountToRateYearFrac ( double  discount,
double  yearFraction,
double  basis,
double *  rate 
)

Convert from a discount factor to a rate using a year fraction.

Calculate an interest rate from a discount factor, given the daycount and basis.

Parameters:
discount (I) Discount factor
yearFraction (I) See JpmcdsDayCountFraction
basis (I) Basis for the rate
rate (O) Output rate

int JpmcdsRateToDiscount ( double  rate,
TDate  startDate,
TDate  endDate,
long  rateDayCountConv,
long  rateType,
double *  discount 
)

Convert from a given rate to a discount factor.

Parameters:
rate (I) Rate
startDate (I) Start date
endDate (I) End date
rateDayCountConv (I) See JpmcdsDayCountFraction
rateType (I) Type of rate
discount (O) Output discount factor

int JpmcdsRateToDiscountYearFrac ( double  rate,
double  yearFraction,
double  basis,
double *  discount 
)

Convert from a rate to a discount factor using a year fraction.

Calculate discount factor from an interest rate, given the daycount and basis.

Parameters:
rate (I) Rate
yearFraction (I) See JpmcdsDayCountFraction
basis (I) Basis for the rate
discount (O) Output discount rate

int JpmcdsRateValid ( char *  routine,
double  rate,
TDate  startDate,
TDate  endDate,
long  rateDayCountConv,
double  rateBasis 
)

Checks whether a rate is valid between two dates.

Parameters:
routine (I) Routine name to print
rate (I) Rate to validate
startDate (I) Starting date
endDate (I) Ending date
rateDayCountConv (I) Day count convention
rateBasis (I) Compounding basis

int JpmcdsRateValidYearFrac ( char *  routine,
double  rate,
double  yearFraction,
double  basis 
)

Checks whether a rate is valid between two dates.

Parameters:
routine (I) Routine name to print
rate (I) Rate to validate
yearFraction (I) Fraction of year
basis (I) Compounding basis


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.