TSCI.pngImport ASCII Data

7951.png The Open Data... option in the File menu is available when using the Trading Sciences platform in standalone mode. This option is used to import ASCII data in a global sense, making it available to multiple analysis procedures. If no data are imported using this procedure, each of the analysis procedures will offer an import procedure whose data will be active only for the duration of the analysis. This Open Data... option is thus mainly of value when multiple procedures are to be explored using the same data. Invoking this option clears any existing data that may have been imported.

7952.png When global data are present as a result of the Open Data... option, the Close Data... option in the File menu frees all imported data. If you wish for the individual procedures to request data, and you have imported data using the Open Data... option, you will need to use this Close Data... option to clear the existing data.

By default, the various tradescape procedures invoked from external platforms do not generate ASCII files. They use a binary file that is used only for the duration of the analysis and then automatically deleted. If you want ASCII files available for subsequent standalone exploration, as in the instance where you may be working on a computer where the financial platform is not available, or when an Internet connection is not available, you will need to specify an ASCII file name in the procedure when it is called from that platform.


In TradeStation, you can save the native TradeStation ASCII files to disk, one entity at a time, and those files can be imported in a single step using a multiple selection import. Alternatively, you can place all of the entities of interest in a single chart and specify that the data is saved in an ASCII format when the tradescape procedure is called from TradeStation. Please note that you do not necessarily have to save ASCII files from TradeStation using the Save option in the Data Window option. The optional tradescape ASCII file may suffice for your needs.

There may be instances where you need the individual TradeStation ASCII files, however. TradeStation does not allow data with different delays to be placed in the same chart. In order to mix the different data sources in a single tradescape analysis, your data subscriptions may require the use of standalone mode and separate ASCII files.

Also, the first bar in a multiple entity chart, for the purpose of any analysis procedure, is the first common bar across all of the instruments, and this often prevents the inclusion of a entity with a shorter time period of data since it invalidates portions of the data of all other entities. The standalone procedures do not have these limitations when separate TradeStation files are used. The tradescape ASCII files will start with bar 1 of the chart and will thus exclude this data.

ASCII Formats

The standalone Import options are designed to import any ASCII financial data. A handful of formats are automatically recognized and imported, although most will require a file specification. This will be automatically presented when the format is not one of the few that the program automatically detects.

Tradescape module ASCII Data format

This is the ASCII format written when the various tradescape procedures called from external platforms specify an ASCII file for export. It is a CSV (comma separated value) file. It is recognized by the first line of the file which must be one of the following:



This format packs any number of securities into a single file, allows for an adjusted Close that manages the splits and dividends, and allows for a basic intraday time and for receiving up to 15 encoded signals. If you wish more information on this default format, the details are covered extensively in the Signal Encoding topic. Multiple files can be imported in a single step.

General S-D-O-H-L-V-C-AC and S-D-O-H-L-C-V-AC ASCII Data formats

These ASCII formats are written by a number of web apps that offer a fixed format for historical financial data. This is also a CSV (comma separated value) file. It is recognized by the first line of the file which must be one of the following:


  Symbol,Date,Open,High,Low,Close,Volume,Adj Close

This format can contain multiple securities. If you do not have a current data source for a type of instrument you wish to explore, the Download Data in the File menu may be of interest. Multiple files can be imported in a single step.

TradeStation Data Format

This is the ASCII format written by TradeStation from the the Data Window option. It is recognized by the first line of the file being one of the following:





If the TradeStation file is modified and saved back to certain types of CSV files, the strings in the file may see quotes added. For a TradeStation file, the symbol name is taken from the prefix. You must thus save the TradeStation file to a name that identifies the security. Only the first 11 characters of the prefix are used for identification. Multiple files can be imported in a single step.

Specified Format Files

If an ASCII file is unrecognized by one of the above strings, you will be presented with the following dialog:


This specification allows virtually any comma-separated or tab-separated ASCII file to be imported.

Multiple files can be imported in a single step, but all must follow the same structure. You can use this approach to import multiple symbols from any ASCII data source.

Header Rows - you must specify the count of header rows in the data. These rows are ignored in the import procedure.

Symbol Column - this is the column containing the symbol or ticker for the instrument. If this is set to 'None', the symbol will be drawn from the file name. The symbol column must be present in order to process the import of multiple entities.

Date Column and Date Format - all financial data will have a data stamp. You can specify the date in the various common formats as well as the numeric (days since 1900 format) used by Excel and many other apps. If you save the CSV file from Excel, the formatting of the data column will determine the date format to be specified. If the general formatting is used, the date will be this numeric value, and 'Numeric Date' should be used. 'Numeric Date-Time' is the format to use where the date is to the left of the decimal and the the right is the fractional portion of the 24-hr day that has passed.

Time Column and Time Format - many financial data will have a time stamp. You can specify the date in the common formats as well as the numeric 000-2359 format and the floating point format where the portion of the 24 day appears as a value between 0 and 1. This field is option for end-of-day data.

Open, High, Low, Volume, Close Columns - nearly all financial data will have these columns. If you have created your own file in Excel, the Excel column letters are also shown in the dropdown selections. Up to 25 columns are supported.

Adjusted Close Column - this is optional if your data source contains cleaned data accounting the splits and dividends.

Signals Start Column - this is optional if you add your own trading signals to the data import. You must encode the entries in the signal columns with 0 for out of market, 1 for a long position, and -1 for a short position. The Signal Count is the number of columns containing signals. These must be sequential and must not pass beyond column 25.

The ASCII file can contain any number of columns. Those that are not specified are disregarded in the import.


The above example fits with the specifications shown the dialog image. The five signal columns start in column 9 (I) and run from 9-10-11-12-13 (I-M). For illustration, column N contains a numeric date.time with a random time, column O contains that time in numeric form as fraction of a 24 hour day, and column P contains the HHMM integer time used by TradeStation and other financial apps.

The Save option is used to save a format to disk. These are internal ASCII File Specification files with AFS extensions.

The Read option is used to recall a saved format.

The format dialog is always displayed when the format is not recognized. The last used format is recalled across sessions. Simply press OK if nothing is changed.

If your first row strings match one of the automatically recognized formats, you can force this customizable import by changing any one of the column names in the first row and resaving the file.