Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Hi,
MetaStock XV can read 3 Local Data formats:
*MSLocal (New MetaStock format created via MetaStock XV DownLoader)
*Legacy MetaStock (MSFL format created via The DownLoader 11)
*CSV
The CSV / Text format that MetaStock 13, 14, and 15 read are formatted as follows. Once the data is formatted correctly, you can link the files to MetaStock 15 by double clicking on Local Data Lists within the Power Console and browsing for your data...
A compatible .CSV or .TXT file must start with a header. The header declares the fields and the order they will occur on each row in the file. The fields can be listed in any order desired but must include at least the date and closing price.
The following is an example of a header:
<DATE>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
The remaining lines in the local data file contain the actual data. A maximum of 65,550 lines of data is supported.
The field names in the header row are not case sensitive. They can be enclosed in quotes, angle brackets, square brackets or left open. Therefore the date field, for example, could be listed in any of the following ways:
DATE, “DATE”, <DATE>, [DATE], “Date”, date, <DaTe>
The date and time fields must contain a date and time respectively, in a proper format, or MetaStock will be unable to properly read the data. All other fields can contain any numerical value.
Field Definitions
[date]. The date of the data contained on the line of the file. Each line of the file must have a date and the dates must be in ascending order (i.e., the most recent date is listed on the last line of the file). The date field has three valid names. Any of the following can be used in the header row:
DATE
DTYYYYMMDD
DTYYMMDD
The DATE field name is the most flexible with respect to the date formats supported (shown below).
2008-01-21
Sat, 21 Jan 2008
21 Jan 2008
12/21/2008
20080121
080121
Important: if the Date field name is DTYYYYMMDD or DTYYMMDD then any time field MUST be named HHMMSS.
[time]. The time of the data contained on the line of the file. This field should only be used if the file contains intraday price data. The following field names are supported for the time field name:
TIME
HHMMSS
Time values should be entered using a 24 hour clock (e.g., 3:30 PM = 15:30).
The TIME field name supports the following formats:
18:45
07:10:27
Important: The HHMMSS field name must be used if the date field was named DTYYYYMMDD or DTYYMMDD
The first hour digit may be omitted for hours 0 - 9. Thus fields formatted this way could use either of the following for the time 9:45 AM:
094500
94500
[open]. The opening price of the instrument.
[high]. The high price of the instrument.
[low]. The low price of the instrument.
[close]. The closing (last) price of the instrument.
[vol]. The volume of the instrument.
[open interest]. The open interest of the instrument. This field name could also be written as [o/i].
Note: The fields other than Date and Time could be used to store any numerical data. However, if the data does not meet the following criteria, the standard prices styles will display in an unexpected manner, if at all
the High must be equal to or greater than the Open, Low, and Close.
the Low must be equal to or less than the Open, High, and Close.
the Open and Close must be between the High and Low
Indicators applied to the chart expect Open, High, Low, and Close prices in the above relationship and run the calculations accordingly. It the data does not meet this criteria, the indicators will produce unexpected, and possibly unusable,results.
Examples of Local Data Files:
Example 1:
<DATE>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
20070103,38.6800,39.0600,38.0500,38.7000,124412
20070104,38.5900,39.1400,38.2600,38.9000,63286
20070105,38.7200,38.7900,37.6000,38.3700,66238
20070108,38.2200,38.3100,37.1700,37.5000,67846
20070109,37.6000,38.0600,37.3400,37.7800,57030
Example 2:
This shows how the time must be formatted in conjunction with the DTYYYYMMDD date field name
<DTYYYYMMDD>,<HHMMSS>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
20111013,100000,9.8600,9.8800,9.8500,9.8580,98230
20111013,100500,9.8570,9.8800,9.8500,9.8790,231170
20111013,101000,9.8800,9.8900,9.8700,9.8800,297725
20111013,101500,9.8800,9.8800,9.8400,9.8600,165220
20111013,102000,9.8650,9.8700,9.8500,9.8600,112426
Example 3:
The following is the minimum number of fields needed for a data file
Date,Close
7/24/2008,125.51
7/25/2008,125.48
7/28/2008,123.64
7/29/2008,126.28
7/30/2008,128.53
Example 4:
<DTYYYYMMDD>,<OPEN>,<HIGH>,<TIME>,<LOW>,<VOL>,<CLOSE>
20111013,9.8600,9.8800,100000,9.8500,242543,9.8580
20111013,9.8570,9.8800,100500,9.8500,231170,9.8790
20111013,9.8800,9.8900,101000,9.8700,297725,9.8790
*Note that the typical order is changed in this example (i.e.; time appears after open and high). The data does not have to be in a specific order as long as the data matches the order in the header row.
|