Main Content

本页面提供的是上一版软件的文档。当前版本中已删除对应的英文页面。

fts2timetable

将金融时间序列对象 (fints) 转换为时间表对象

说明

示例

TT = fts2timetable(FTS)M × N fints 对象转换为 M × N MATLAB® timetable 对象 (TT)。fints 对象中的日期时间信息变为 TT 时间向量,而 fints 对象中的其余变量变为 TT 中的变量。fints 描述属性 (DESC) 将映射到 TT.Properties.Descriptionfints 频率指示符属性 (FREQ) 未使用并从输出 TT 中移除。有关详细信息,请参阅 将金融时间序列对象 fints 转换为时间表

示例

全部折叠

加载金融数据。

load SimulatedStockValues
Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see <a href="matlab:web(fullfile(docroot, 'finance/convert-from-fints-to-timetables.html'))">Convert Financial Time Series Objects (fints) to Timetables</a>.

fints 对象转换为 timetable 对象。

TMW = fts2timetable(TMW_fts); 
TMW.Properties
ans = 
  TimetableProperties with properties:

             Description: 'Simulated stock OHLCV data.'
                UserData: []
          DimensionNames: {'Time'  'Variables'}
           VariableNames: {'Open'  'High'  'Low'  'Close'  'Volume'}
    VariableDescriptions: {}
           VariableUnits: {}
      VariableContinuity: []
                RowTimes: [1000×1 datetime]
               StartTime: 31-Aug-2012
              SampleRate: NaN
                TimeStep: NaN
        CustomProperties: No custom properties are set.
      Use addprop and rmprop to modify CustomProperties.

可视化金融数据。

ma1 = movavg(TMW,'exponential',14);
ma2 = movavg(TMW,'exponential',26);
selctRange = 70:120;
figure;
plot(ma1.Time(selctRange), ma1.Close(selctRange), ...
     ma2.Time(selctRange), ma2.Close(selctRange));
ax = gca;
hold on

% Plot on a target axis
candle(ax, TMW(selctRange,:));
legend(ax, '14-day MA', '26-day MA', 'Price')
ylabel(ax, 'Price')
xlabel(ax, 'Date')
title(ax, 'TMW Simulated Stock Prices')
hold off

输入参数

全部折叠

金融时间序列对象,使用 M × N fints 对象指定。

数据类型: object

输出参数

全部折叠

时间表,以 M × N 对象形式返回。

版本历史记录

在 R2018a 中推出