DIS
Updated 2024-02-22 20:58:26.193000
Syntax
SELECT [westclintech].[wct].[DIS](
<@DSM, float,>
,<@RV, float,>
,<@P, float,>
,<@D, float,>)
Description
Use the scalar function DIS to calculate the price or discount rate for a discount security. The formula for price is:
\mathrm{P=RV-DR\times{RV}\times\frac{DSM}{B}}
Where:
{"columns":[{"field":"column 1"},{"field":"column 2"},{"field":"column 3"}],"rows":[{"column 1":"B","column 2":"=","column 3":"Number of days in the year"},{"column 1":"DR","column 2":"=","column 3":"Discount Rate"},{"column 1":"DSM","column 2":"=","column 3":"Number of days from settlement date to maturity date"},{"column 1":"P","column 2":"=","column 3":"Price per 100 par value"},{"column 1":"RV","column 2":"=","column 3":"Redemption Value"}]}
The formula for discount rate is:
\mathrm{DR=\frac{RV-P}{RV}\times{\frac{B}{DSM}}
Where:
{"columns":[{"field":"column 1"},{"field":"column 2"},{"field":"column 3"}],"rows":[{"column 1":"B","column 2":"=","column 3":"Number of days in the year"},{"column 1":"DR","column 2":"=","column 3":"Discount Rate"},{"column 1":"DSM","column 2":"=","column 3":"Number of days from settlement date to maturity date"},{"column 1":"P","column 2":"=","column 3":"Price per 100 par value"},{"column 1":"RV","column 2":"=","column 3":"Redemption Value"}]}
The DIS function allows you to pass values for B, DSM, RV and either DR or P and returns the other.
Arguments
@D
the discount rate on the security. @D is an expression of type float or of a type that can be implicitly converted to float.
@P
the price of the security. @P is an expression of type float or of a type that can be implicitly converted to float. ### @RV the redemption value. @RV is an expression of type float or of a type that can be implicitly converted to float.
@DSM
the time in years from settlement to maturity. @DSM is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
If @DSM is NULL then @DSM = 0.
If @RV is NULL then @RV = 100.
If @D is NULL and @P is NULL then NULL is returned.
If @D is not NULL then the function calculates the price from the inputs otherwise the function calculates the discount rate.
Examples
In this example we calculate the discount rate for a security with a price of 99.72 and redemption value of 100. There are 69 days from settlement to maturity and 365 days in the year.
SELECT wct.DIS( 69 / 365E+00, --@DSM
100.00, --@RV
99.72, --@P
NULL --@D
) as [Discount Rate];
This produce the following result.
{"columns":[{"field":"Discount Rate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Discount Rate":"0.0148115942028987"}]}
In this example we calculate the price for a security with a discount rate of 1.9%. There are 131 days from settlement to maturity and 360 days in the year.
SELECT wct.DIS( 131 / 360E+00, --@DSM
10000.00, --@RV
NULL, --@P
0.019 --@D
) as [Price];
This produces the following result.
{"columns":[{"field":"Price","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Price":"9930.86111111111"}]}
In this example we calculate the price for a security with a discount rate of 5.5%. There are 190 days from settlement to maturity and 364 days in the year.
SELECT wct.DIS( 190 / 364E+00, --@DSM
1000000.00, --@RV
NULL, --@P
0.055 --@D
) as [Price];
This produces the following result.
{"columns":[{"field":"Price","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Price":"971291.208791209"}]}
See Also
DISC - Discount rate of a discount security
DISFACTORS - Factors for the price calculation of a discount security
IAM - Price and/or yield of a security paying interest at maturity
PRICEDISC - Price of a discount security
RPI - Calculate the price and/or yield of a bond with regular periodic coupons