数据预处理
金融市场的日期和货币数据
在运行分析之前,数据的表示形式和质量至关重要。通常需要将金融数据的格式转换为标准格式。此工具箱提供了一组工具来整理和转换金融数据以进行分析。
函数
日期时间分量格式
日期转换
工作日
busdate | 下一个或上一个工作日 |
busdays | Business days for given period |
datemnth | Date of day in future or past month |
datewrkdy | Date of future or past workday |
days252bus | 日期之间的工作日天数 |
days360 | 基于一年 360 天的日期之间的天数 |
days360e | Days between dates based on 360-day year (European) |
days360isda | Days between dates based on 360-day year (International Swap Dealer Association (ISDA) compliant) |
days360psa | 基于一年 360 天的日期之间的天数(符合公共证券协会 (PSA) 的标准) |
days365 | 基于一年 365 天的日期之间的天数 |
daysact | 日期之间的实际天数 |
daysadd | Date away from starting date for any day-count basis |
daysdif | 计算日期之间的天数,适用任何计日基数 |
fbusdate | First business date of month |
isbusday | 为工作日日期返回 true |
lbusdate | Last business date of month |
thirdwednesday | Find third Wednesday of month |
wrkdydif | Number of working days between dates |
yearfrac | 计算日期之间的天数占全年的比例 |
交易日历
createholidays | Create trading calendars |
holidays | 节假日和非交易日 |
nyseclosures | New York Stock Exchange closures from 1885 to 2070 |
addBusinessCalendar | Add business calendar awareness to timetables (自 R2020b 起) |
息票债券日期
accrfrac | 应计天数占付息周期的比例 |
cpncount | Coupon payments remaining until maturity |
cpndaten | Next coupon date for fixed-income security |
cpndatenq | Next quasi-coupon date for fixed-income security |
cpndatepq | Previous quasi-coupon date for fixed-income security |
cpndatep | Previous coupon date for fixed-income security |
cpndaysn | Number of days to next coupon date |
cpndaysp | Number of days since previous coupon date |
cpnpersz | Number of days in coupon period |
货币和价格转换
cur2frac | 小数货币值转换为零钱值 |
cur2str | 银行格式文本 |
dec2thirtytwo | Decimal to thirty-second quotation |
frac2cur | 将零钱货币值转换为小数值 |
thirtytwo2dec | Thirty-second quotation to decimal |
主题
- 处理和转换日期
处理和转换日期字符向量和日期序列值、节假日和现金流日期。
- Trading Calendars User Interface
Using the Trading Calendars user interface to manage holidays.
- UICalendar User Interface
Using
uicalendar
to manage dates.
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)