Detailed instructions for use are in the User's Guide.
[. . . ] Financial ToolboxTM 3 User's Guide
How to Contact The MathWorks
Web Newsgroup www. mathworks. com/contact_TS. html Technical Support
www. mathworks. com comp. soft-sys. matlab suggest@mathworks. com bugs@mathworks. com doc@mathworks. com service@mathworks. com info@mathworks. com
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. Financial ToolboxTM User's Guide © COPYRIGHT 19952010 The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. [. . . ] (Future implementation)
IssueDate FirstCouponDate
LastCouponDate
StartDate
Required arguments must be a number of bonds (NUMBONDS)-by-1 or
1-by-NUMBONDS conforming vectors or scalars. Optional arguments must
14-198
cpnpersz
be either NUMBONDS-by-1 or 1-by-NUMBONDS conforming vectors, scalars, or empty matrices.
Description
NumDaysPeriod = cpnpersz(Settle, Maturity, Period, Basis, EndMonthRule, IssueDate, FirstCouponDate, LastCouponDate, StartDate) returns the number of days in the coupon period containing
the settlement date. For zero coupon bonds coupon dates are computed as if the bonds have a semiannual coupon structure.
Examples
NumDaysPeriod = cpnpersz('14 Sep 2000', '30 Jun 2001', 2, 0, 0) NumDaysPeriod = 183 NumDaysPeriod = cpnpersz('14 Sep 2000', '30 Jun 2001', 2, 0, 1) NumDaysPeriod = 184
Maturity = ['30 Apr 2001'; '31 May 2001'; '30 Jun 2001']; NumDaysPeriod = cpnpersz('14 Sep 2000', Maturity) NumDaysPeriod = 184 183 184
See Also
accrfrac, cfamounts, cfdates, cpncount, cpndaten, cpndatenq, cpndatep, cpndatepq, cpndaysn, cpndaysp
14-199
createholidays
Purpose Syntax
Create trading calendars
createholidays(Filename, Codefile, InfoFile, TargetDir, IncludeWkds, Wprompt, NoGUI)
Arguments
Filename Codefile InfoFile TargetDir IncludeWkds
The data file name. Values are: · 0 Do not include weekends in the holiday list. Option to prompt for the file location for each holiday. m file that is created. Run createholidays function without displaying the Trading Calendars graphical user interface. · 1 Do not display the GUI.
Wprompt
NoGUI
14-200
createholidays
Description
createholidays(Filename, Codefile, InfoFile, TargetDir, IncludeWkds, Wprompt, NoGUI) programatically generates the market-specific holidays. m files without displaying the interface.
createholidays('FinancialCalendar\My_datafile. csv', . . . 'FinancialCalendar\My_infofile. csv', 'c:\work', 1, 1, 1)
Examples
will create holidays*. m files from My_datafile. csv in the directory c:\work. Weekends will be included in the holidays list based on the input flag INCLUDEWDKS = 1. Note To use createholidays, you must obtain data, codes, and info files from http://www. FinancialCalendar. com trading calendars.
See Also
holidays
14-201
cumsum
Purpose Syntax Description
Cumulative sum
newfts = cumsum(oldfts)
newfts = cumsum(oldfts) calculates the cumulative sum of each
individual time series data series in the financial time series object
oldfts and returns the result in another financial time series object newfts. newfts contains the same data series names as oldfts.
Examples
Compute the cumulative sum for Disney stock and plot the results:
load disney. mat cs_dis = cumsum(fillts(dis)); plot(cs_dis) title('Cumulative Sum for Disney')
14-202
cumsum
See Also
cumsum in the MATLAB documentation
14-203
cur2frac
Purpose Syntax Description Examples
Decimal currency values to fractional values
Fraction = cur2frac(Decimal, Denominator)
Fraction = cur2frac(Decimal, Denominator) converts decimal currency values to fractional values. Fraction = cur2frac(12. 125, 8)
returns Fraction = 12. 1, a string.
See Also
cur2str, frac2cur
14-204
cur2str
Purpose Syntax Description
Bank-formatted text
String = cur2str(Value, Digits)
String = cur2str(Value, Digits) returns the given value in bank format. String = cur2str(-8264, 2)
Examples
returns String = ($8264. 00)
See Also
cur2frac, frac2cur
14-205
date2time
Purpose Syntax
Time and frequency from dates
[TFactors, F] = date2time(Settle, Maturity, Compounding, Basis, EndMonthRule)
Arguments
Settle Maturity Compounding
Settlement date. Scalar value representing the rate at which the input zero rates were compounded when annualized. This argument determines the formula for the discount factors: · Compounding = 1, 2, 3, 4, 6, 12 · Disc = (1 + Z/F)^(-T), where F is the compounding frequency, Z is the zero rate, and T is the time in periodic units, for example, T = F is one year. · Compounding = 365 · Disc = (1 + Z/F)^(-T), where F is the number of days in the basis year and T is a number of days elapsed computed by basis. · Compounding = -1 · Disc = exp(-T*Z), where T is time in years.
14-206
date2time
Basis
(Optional) Day-count basis of the instrument. · 0 = actual/actual (default) · 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 (ISMA) · 9 = actual/360 (ISMA) · 10 = actual/365 (ISMA) · 11 = 30/360E (ISMA) · 12 = actual/365 (ISDA) · 13 = BUS/252 (Optional) End-of-month rule. This rule applies only when Maturity is an end-of-month date for a month having 30 or fewer days. 0 = ignore rule, meaning that a bond's coupon payment date is always the same numerical day of the month. 1 = set rule on (default), meaning that a bond's coupon payment date is always the last actual day of the month.
EndMonthRule
14-207
date2time
Description
[TFactors, F] = date2time(Settle, Maturity, Compounding, Basis, EndMonthRule) computes time factors appropriate to
compounded rate quotes between the settlement and maturity dates.
TFactors is a vector of time factors. date2time is the inverse of time2date.
See Also
cftimes, disc2rate, rate2disc, time2date
14-208
dateaxis
Purpose Syntax Arguments
Convert serial-date axis labels to calendar-date axis labels
dateaxis(Aksis, DateForm, StartDate)
Aksis DateForm
(Optional) Determines which axis tick labels--x, y, or z--to replace. [. . . ] spot rate The current interest rate appropriate for discounting a cash flow of some given maturity. spread For options, a combination of call or put options on the same stock with differing exercise prices or maturity dates. standard deviation A measure of the variation in a distribution, equal to the square root of the arithmetic mean of the squares of the deviations from the arithmetic mean; the square root of the variance.
Glossary-11
Glossary
stochastic Involving or containing a random variable or variables; involving chance or probability. It involves simultaneously purchasing put and call options with the same exercise price and expiration date, and it is most profitable when the price of the underlying security is very volatile. [. . . ]