Class BondSupport
Collection of bond support functionality. https://www.youtube.com/watch?v=cuzRSLc9Cy0
Inheritance
Inherited Members
Namespace: TuringTrader.SimulatorV2.Support
Assembly: TuringTrader.Simulator.dll
Syntax
public static class BondSupport
Methods
| Improve this Doc View SourceBondValuation(double, double, double, double)
Calculate bond price, continuously compounded.
Declaration
public static double BondValuation(double faceValue, double coupon, double yield, double numYears)
Parameters
Type | Name | Description |
---|---|---|
double | faceValue | bond's face (par) value |
double | coupon | annual coupon |
double | yield | annual yield |
double | numYears | years until maturity |
Returns
Type | Description |
---|---|
double | bond price |
BondValuation(double, double, double, int)
Calculate bond price, periodical payments.
Declaration
public static double BondValuation(double faceValue, double couponPerPeriod, double yieldPerPeriod, int numPeriods)
Parameters
Type | Name | Description |
---|---|---|
double | faceValue | bond's face (par) value |
double | couponPerPeriod | coupon payment per period |
double | yieldPerPeriod | yield per period |
int | numPeriods | of periods until maturity |
Returns
Type | Description |
---|---|
double | bond price |
ConvertRatePeriodicy(double, int, int)
Converte rate from one periodicity to another.
Declaration
public static double ConvertRatePeriodicy(double ratePerPeriod, int numPeriodsPerYear, int newNumPeriodsPerYear)
Parameters
Type | Name | Description |
---|---|---|
double | ratePerPeriod | current rate per period |
int | numPeriodsPerYear | current periods per year |
int | newNumPeriodsPerYear | new periods per year |
Returns
Type | Description |
---|---|
double | new rate per period |
ConvertRateToContinuous(double, int)
Convert periodically compounded rate to its continuously compounded equivalent with yieldPerPeriod = yieldPerYear / numPaymentsPerYear.
Declaration
public static double ConvertRateToContinuous(double ratePerPeriod, int numPeriodsPerYear)
Parameters
Type | Name | Description |
---|---|---|
double | ratePerPeriod | periodically compounded yield per period |
int | numPeriodsPerYear | of payments per year |
Returns
Type | Description |
---|---|
double | continuously compounded annual yield |
ConvertRateToPeriodical(double, int)
Convert continuously compounded yield to its periodically compounded equivalent with yieldPerPeriod = yieldPerYear / numPaymentsPerYear.
Declaration
public static double ConvertRateToPeriodical(double rateContinuous, int numPeriodsPerYear)
Parameters
Type | Name | Description |
---|---|---|
double | rateContinuous | continuously compounded annual yield |
int | numPeriodsPerYear | of payments per year |
Returns
Type | Description |
---|---|
double | periodically compounded yield per period |
FutureValue(double, double, double)
Calculate future value of present payment, continuously compounded.
Declaration
public static double FutureValue(double presentValue, double compoundPerYear, double numYears)
Parameters
Type | Name | Description |
---|---|---|
double | presentValue | present value |
double | compoundPerYear | annual compound rate |
double | numYears | years until future date |
Returns
Type | Description |
---|---|
double |
FutureValue(double, double, int)
Calculate future value of present payment, periodical compounding.
Declaration
public static double FutureValue(double presentValue, double compoundPerPeriod, int numPeriods)
Parameters
Type | Name | Description |
---|---|---|
double | presentValue | present value |
double | compoundPerPeriod | compound rate per period |
int | numPeriods | of periods until future date |
Returns
Type | Description |
---|---|
double |
PresentValue(double, double, double)
Calculate present value of future payment, continuously compounded.
Declaration
public static double PresentValue(double futureValue, double discountPerYear, double numYears)
Parameters
Type | Name | Description |
---|---|---|
double | futureValue | future cash flow |
double | discountPerYear | annual discount rate |
double | numYears | years until payment |
Returns
Type | Description |
---|---|
double | present value of future cash flow |
PresentValue(double, double, int)
Calculate present value of future payment, periodical compounding.
Declaration
public static double PresentValue(double futureValue, double discountPerPeriod, int numPeriods)
Parameters
Type | Name | Description |
---|---|---|
double | futureValue | future cash flow |
double | discountPerPeriod | discount rate per period |
int | numPeriods | of periods until payment |
Returns
Type | Description |
---|---|
double | present value of future cash flow |