Main Content


Convert financial time series objects (fints) to timetable object



TT = fts2timetable(FTS) converts a M-by-N fints object to a M-by-N MATLAB® timetable object (TT). The date and time information in the fints object becomes the TT time vector, while the remaining variables in the fints object become variables in TT. The fints description property (DESC) is mapped to TT.Properties.Description. The fints frequency indicator property (FREQ) is unused and removed from the output TT. For more information, see Convert Financial Time Series Objects fints to Timetables.


collapse all

Load the financial data.

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>.

Convert a fints object to a timetable object.

TMW = fts2timetable(TMW_fts); 
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.

Visualize the financial data.

ma1 = movavg(TMW,'exponential',14);
ma2 = movavg(TMW,'exponential',26);
selctRange = 70:120;
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

Input Arguments

collapse all

Financial time series object, specified by using a M-by-N fints object.

Data Types: object

Output Arguments

collapse all

Timetable, returned as a M-by-N object.

Introduced in R2018a