Financial Time Series    

Transforming a Text File

The function ascii2fts creates a financial time series object from a text (ASCII) data file provided that the data file conforms to a general format.The general format of the text data file is:

Several example text data files are included with the toolbox. These files are in the ftsdata subdirectory within the Financial Time Series Toolbox directory <matlab>/toolbox/ftseries.

The syntax of the function

takes in the data filename (filename), the row number where the text for the description field is (descrow), the row number of the column header information (colheadrow), and the row numbers of contiguous rows to be skipped (skiprows).

For example,

uses disney.dat to create time series object disfts. This example:

Look at the object at this point.

There are 782 data points in this object. Only the first few lines are shown here. Also, this object has two other data series, the CLOSE and VOLUME data series, which are not shown here.

The frequency indicator field, freq, is set to 0 for Unknown frequency. You can manually reset it to the appropriate frequency using structure syntax, disfts.freq = 1 for Daily frequency.


 Using the Constructor Working with Financial Time Series Objects