Symbol Attributes - 3rd Party Data
In addition to the field order, TradeStation also needs to know the symbol attributes for the symbol that is being plotted. The symbol attributes are stored in a file called attributes.ini. This file can contain default symbol attributes, symbol-specific symbol attributes, and root-specific symbol attributes.
Defining the Symbol Attributes
All attributes specified in the attributes.ini file will only be applicable to data files that reside within the same directory as that particular attributes.ini file. Therefore you can have different attribute.ini files in different directories, each having different settings.
Within the attributes.ini file, there are 3 different methods that may be used to specify the attributes and all must follow the same guidelines. These methods are:
- Symbol-Specific Basis - Used to specify the attributes for a specific symbol. To do this, you would specify the exact symbol in the attribute file.
Data file name: | MSFT.txt |
Symbol field in attribute file: | 'MSFT' |
For the symbol field, the prefix (all characters before the period) or the full file name (including the extension) can be specified.
- Root-Specific Basis - Used to specify the attributes for a group of symbols that belong to the same root by including wild card characters (defined by #) in the attribute file.
Data file names: | SPH04.txt |
SPZ04.txt | |
Symbol field in attribute file: | 'SP###' |
The variable characters can be anywhere in the field. Therefore, the following would be acceptable '###SP'.
- Generic Basis - In order to have an easy way to define the same attributes for all symbols in a directory (when they are the same) without having to create separate records within the attributes.ini fle for each individual data file, you can add a generic attribute definition line to the attributes.ini file. This is done by using 'DEFAULT' as the symbol in the attributes.ini file. This method could also be useful when most of the data files have the same attributes and only a few of the data files have different attributes. Any attributes specified in the attributes.ini file using file-specific (like in #1) or root-specific (like in #2) settings take precedence over attributes that are specified on a generic/default basis.
Data file names: | TEST1.txt |
TEST2.txt | |
TEST3.txt | |
Symbol field in attribute file: | 'TEST3' |
'DEFAULT' |
The default attribute settings (defined by 'DEFAULT' in the symbol field) would be used for Test1 & Test2. Test3 would make use of the attribute settings defined by 'TEST3' in the attributes.ini file.
- User Interface - If no attribute definition exists for a selected data file, either because the absence of the attributes.ini file or because of the absence of a 'DEFAULT' or appropriate symbol-specific or root-specific record within the attributes.ini file, the user will be prompted to retrieve this information.
When finding a symbol in the attributes file, TradeStation first tires to find an exact match first, then checks to see if the file matches a symbol that has a wild card # (return the first match in alphabetical order), then uses the default.
Symbol Attribute File Guidelines
The following rules must be followed for the attributes.ini file:
- Each file must only contain one header line and one or more lines of data.
For example:
'Symbol','Category', 'Price Scale', 'Minimum Movement', 'Daily Limit'
MSFT, Stock, 1/100,1,10000
Header specifics:- A header line must be included in the file to define the order of the values within the file.
- The header must be the first line of the file.
- Each field name can be enclosed within quotation marks, but they are not required.
- Each field must be separated from each other field using a comma.
- These fields can be arranged in any order in the header, but must match the field order of the data/values.
- Acceptable values for each field are:
Field Name | Field Value |
Symbol | Can be one of the following: |
Category | Must be one of the following and is not case sensitive: |
Description | Can be any combination of characters but must be limited to 50 characters. |
Exchange | A list of supported exchanges is defined in Appendix A. |
Date Customize | See table in section called Data File Guidelines, under #5. |
Time Customize | See table in section called Data File Guidelines, under #6. |
Price Scale | Must be one of the following: |
Minimum Movement | Must be a whole number between 1 and 65000, inclusive. |
Daily Limit | Must be a whole number between 1 and 65000, inclusive. |
Big Point Value | Must be a whole number between 1 and 65000, inclusive. |
Margin | Must be a whole number between 1 and 65000, inclusive. |
Session 1 Start Time* | HHMMSS (with no colons) or HHMM (with no colons) and will be assumed to be 24 hour format. |
Session 1 End Time* | HHMMSS (with no colons) or HHMM (with no colons) and will be assumed to be 24 hour format. |
Session 1 Days | Any combination of the following: UMTWRFS (Sunday through Saturday). This should be entered as one string of characters with no spaces. |
Session 2 Start Time* | HHMMSS (with no colons) or HHMM (with no colons) and will be assumed to be 24 hour format. |
Session 2 End Time* | HHMMSS (with no colons) or HHMM (with no colons) and will be assumed to be 24 hour format. |
Session 2 Days | Any combination of the following: UMTWRFS (Sunday through Saturday). This should be entered as one string of characters with no spaces. |
Expiration Date | A date in MM/DD/YYYY format. |
Option Type | Must be one of the following and is not case sensitive: |
Strike Price | Any whole number or decimal up to 4 digits of precision. It should be between 0 and 65000. |
Since session times are converted to # of minutes since midnight, any seconds that are specified will be ignored.
For the default attribute setting, you could omit the description (by using consecutive delimiters) and possibly put the exchange as Undefined so that the values can be used for all files/symbols in that directory.
- Each line of data in the file must be followed by a carriage return. The last line of the file may be followed by a carriage return, but it is not required.
- Each field in the file must be delimited by a comma.
- Each field can be enclosed within quotation marks, but they are not required. They will be useful in the case where a field contains a comma but is not used as a delimiter.
For example, for a symbol description such as "Microsoft, Inc." you would use quotation marks so that the comma is not considered a delimiter. - Dates must be in exchange time and entered using MM/DD/YYYY format.
- All times need to be entered in HHMMSS (with or without colons) or HHMM (with or without colons) and will be assumed to be 24 hour format. In other words, 11:15:04 AM would be entered as 111504 or 11:15:04. 2:20:36 PM would be entered as 142036 or 14:20:36, and 3:30 PM would be entered as 1530 or 15:30.
- The file cannot contain any characters besides letters, numbers, quotation marks, the permitted delimiter (comma), a / in the date, and carriage returns.
- The mandatory fields are defined by the category. If a required field is missing for the specified category, an error message will appear.
- Consecutive delimiters allow fields to be omitted from individual lines of data. In other words, if a header reads: 'Symbol','Category','Exchange','Description','PriceScale', you would have a data line that looks like this: MSFT, Stock, Nasdaq ,, 1/100. This would allow you to omit the entry for the Description. This can be done for any field or for multiple fields.