prdisc
Price of discounted security
Description
Examples
Calculate the Price of a Security Whose Yield is Quoted as a Bank Discount Rate
This example shows how to return the price of a security whose yield is quoted as a bank discount rate (for example, U. S. Treasury bills).
Settle = '10/14/2000'; Maturity = '03/17/2001'; Face = 100; Discount = 0.087; Basis = 2; Price = prdisc(Settle, Maturity, Face, Discount, Basis)
Price = 96.2783
Calculate the Price of a Security Whose Yield is Quoted as a Bank Discount Rate Using datetime Inputs
This example shows how to use datetime
inputs to return the price of a security whose yield is quoted as a bank discount rate (for example, U. S. Treasury bills).
Settle = datetime(2000,10,14); Maturity = datetime(2001,3,17); Face = 100; Discount = 0.087; Basis = 2; Price = prdisc(Settle,Maturity,Face, Discount, Basis)
Price = 96.2783
Input Arguments
Settle
— Settlement date
datetime scalar | string scalar | date character vector
Settlement date, specified as a scalar datetime, string, or date character vector.
Settle must be earlier than Maturity
.
To support existing code, prdisc
also
accepts serial date numbers as inputs, but they are not recommended.
Data Types: datetime
| string
| char
Maturity
— Maturity date
datetime scalar | string scalar | date character vector
Maturity date, specified as a scalar datetime, string, or date character vector.
To support existing code, prdisc
also
accepts serial date numbers as inputs, but they are not recommended.
Data Types: datetime
| string
| char
Face
— Redemption (par, face) value
numeric
Redemption (par, face) value, specified as a numeric value.
Data Types: double
Discount
— Bank discount rate of the security
decimal fraction
Bank discount rate of the security, specified as a decimal fraction value.
Data Types: double
Basis
— Day-count basis of instrument
0
(default) | numeric values: 0
,1
, 2
, 3
, 4
, 6
, 7
, 8
,
9
, 10
, 11
,
12
, 13
(Optional) Day-count basis of the instrument, specified as a numeric value. Allowed values are:
0 = actual/actual
1 = 30/360 (SIA)
2 = actual/360
3 = actual/365
4 = 30/360 (PSA)
5 = 30/360 (ISDA)
6 = 30/360 (European)
7 = actual/365 (Japanese)
8 = actual/actual (ICMA)
9 = actual/360 (ICMA)
10 = actual/365 (ICMA)
11 = 30/360E (ICMA)
12 = actual/365 (ISDA)
13 = BUS/252
For more information, see Basis.
Data Types: double
Output Arguments
Price
— Price of discounted security
numeric
Price of discounted security, returned as a numeric value.
References
[1] Mayle. “Standard Securities Calculation Methods.” Volumes I-II, 3rd edition. Formula 2.
Version History
Introduced before R2006aR2022b: Serial date numbers not recommended
Although prdisc
supports serial date numbers,
datetime
values are recommended instead. The
datetime
data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime
values, use the datetime
function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y = 2021
There are no plans to remove support for serial date number inputs.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)