Metastock Data Format

0 views
Skip to first unread message

Laila Berri

unread,
Jul 25, 2024, 12:29:45 AM7/25/24
to plantocbuca

What's the proper call to import Metastock data via OLE? Right now I'm doing this but nothing happens, no data is imported and nothing new appears in import.log even though I have $DEBUG 1 in metastock.format

In the example above data was downloaded from MetaStock/Equis/Reuters DataLink service ( ) for 10 years worth of quotes and some 3900 symbols. Besides XMASTER there is MASTER and EMASTER but I believe they have 255 symbol limits. It does work manually when I go to Amibroker - Import MetaStock data - point to XMASTER file, and leave all of the 3900 tickers checked.

metastock data format


Download File ⚹⚹⚹ https://urllie.com/2zMEAc



@PanoS
I am not looking to start a new external Metastock database as my models in afl make use of symbols from different data sources besides Metastock.
Just like my original message says, I am looking to use automation to impot Metastock data into a local database, which you do not seem to be addressing.

It does NOT require any import. If you have other data from non-MS databases, you can import them to the database that uses MS plugin if those symbols are marked "use only local database for this symbol" (Symbol Information window). Such symbols are excluded from plugin access.
Recommended reading
_workspace.html

Thank you, I did not realize that the OLE Import function did not support binary/Metastock inputs, based on
Would it be feasible to add that support as a future feature enhancement? The advantages I see with automatically imported Metastock data into local Amibroker db vs using Metastock plugin are:

These instructions outline the steps you need to take to convert ASCII data (the data you download) into a format that MetaStock can read. MetaStock data format is also used by other charting products such as OmniTrader and therefore these instructions are also applicable to customers using those products.

Download your data from EODData and store it all in a folder on your computer.We would recommend that you create a new folder called C:\EODData\ and that you create sub folders for each exchange you want to download.For example, create a folder C:\EODData\NASDAQ\ for your NASDAQ data.Using the Download section of our website you can select the exchange and the date you would like to download:

Quotes are delayed at least 15 minutes. All information provided "as is" for informational purposes only, not intended for trading purposes or advice.
EODData will not be liable for any informational errors, incompleteness, or delays, or for any actions taken in reliance on information contained herein.
By accessing the EODData site, you agree not to redistribute the information found therein in any form without EODData's consent.

I download EOD data in ASCII format, and use Downloader to convert them into Metastock Database every day. Now I have a better source of data which provides fine-grained trading records, and I want to use them to generate intraday historical data every night, for better analytical-purpose. My question is related to the ASCII format of intraday data. As far as I know, intraday data can be imported in the following format:

Take the period length of 15min as an example, the question is, what if during a period, there is no deal at all? If I skip this 15min period in the ASCII file, metastock would complain about "invalid period". If I fill this 15min period with =0, what should be the different price field? -- a different price could make indicators such as Stochastic (which depends on the price) behave differently. Is there a way to let Metastock know that, there is no trades during a period, and it should just skip this period...

The EMASTER file is essential because it holds the references to Fn.DAT. So at the beginning we open EMASTER file and read what quotations are available and in which DAT files they are held. The following data describes each symbol:

After reading the description we open the appropriate DAT file and read the quotations. Each row contain at least the date, open price, highest prices, lowest price and close price. Optionally there data contains volume and open positions data. The problem is that each data entry is a float number. To make is worse it is in Microsoft Binary floating point format :), while most of the programming languages use IEEE floating point format.

As I said every data entry is a floating point number which represents different data types. Converting it to integer is straightforward. But converting it to a data or time is more tricky. The following functions show how to extract date and time from floating point numbers:

Many financial software packages use their own format to save files such as reports and spreadsheets. However, they also can handle common information files for processing. A common type of file for data processing is the Comma Separate Value (CSV) file, which represents a text file with simple comma-delimited information. If your company uses MetaStock software, you can use MetaStock symbol libraries to import CSV files into MetaStock format.

IMPORTANT NOTE: Metastock importer should be used ONLY if you want to import MS data to native, local AmiBroker database once. If you want AmiBroker to just read Metastock database DIRECTLY without need to import new data over and over please set up your database WITH METASTOCK PLUGIN as described in the Tutorial.

The MASTER/EMASTER file is essential because it holds the references to Fxx.DAT files. Fxx.DAT files store only quotations in either 5 field (date/high/low/close/volume), 6 or 7 field (date/open/high/low/close/volume/openinterest) format. As you see MASTER/EMASTER and Fxx.DAT files are closely connected and you need them all to import the data.

This is a description of the file format called Computrac or MetaStock format. It is intended as background information for software design. The Computrac system appeared early in the IBM PC days, in about 1984 and was written in Microsoft Basic. The company was later sold to Reuters and has lost its separate identity. The Computrac software was licensed to Stratagem Software International (phone 504-885-7353). It currently is named SmartTrader Professional V5.2000. It recently was updated for Year 2000 compatibility.

Many technical analysis systems read Computrac format files, either as their primary format or as an alternative. The only significant compatibility problem is the need to convert the early Microsoft Basic floating point formatted number to the current IEEE floating point format, standard for personal computers.

Each directory holds a group of related security files. The files are named by a number representing the order in which they were created: F1, F2, F3 and so on. Deletions are allowed, so some F# may be skipped. This method overcomes the limit by MS-DOS on file name length and characters. An added file, called MASTER, is located in each directory to associate each file with its matching security name and NASDAQ trading symbol. An application which wished to read a specific data file must lookup the F# by referring to the MASTER file.

Directories may be nested. Thus, the directory STOCKS may contain a sequence of F1, F2 and F3 data files for three securities. In addition it could contain a MS-DOS sub-directory FOREIGN. Within FOREIGN could appear F1, F2 and F3 holding data for three foreign securities.

In the original Computrac system the file MASTER contains an entry for each F# file and an entry for each sub-directory appearing within that directory. Thus a tree structure of nested directories may be formed. In MetaStock and later system this feature of sub-directories is ignored. If the tree structure is desired directory maintenance must be done within Computrac.

A second difference between the original Computrac format and current use is that Computrac allows the user to define the name and scale factors for each field in the data files. The default values are Date, High, Low, Close and Vol. For example, if market statistics are held the user may create such a file and rename the fields to Date, Adv, Dec, Up, Dn, Vol. MetaStock and other common systems do not support this feature. They ignore the F#.dop format file and assume the fields are price, volume and open interest depending on the number of fields present. This is further discussed below in the section Scale Factors.

The Computrac/MetaStock format has three structural levels. The top level is a MASTER file which lists the names, trading symbols and miscellaneous information about securities data files of the directory in which it is located. EMASTER is a similar file (Extended Master file) maintained by MetaStock as an extension to the original Computrac format. There is a limit of 254 security files per directory in the original Computrac form.

The second level is the "Fx.dop" file which gives the data fields and scale factors for each data file. Again, this feature of the original Computrac system is not supported by current software vendors.

The third level is the "Fx.dat" file which contains a time series of prices for each security. Under the Computrac system the data fields may be customize for each security. This feature is not supported by later systems (MetaStock).

The MASTER file in each directory has one record per security. Each record gives the file number "Fx" for the security along with its text name, trading symbol, time base and update information. This file is organized a 53 bytes in a fixed length field format. The fields may be ASCII characters, binary integers or floating point number in an old Microsoft Basic Floating point format (MBF). It is necessary to convert these floating point number into the current IEEE floating point format used in contemporary computers.

The ".dop" file is an ASCII file with variable length text records. It is purpose is to allow the user to customize the data fields for any security and specify input/output precision for each field. This is an outstanding feature of Computrac but is not observed or maintained by other vendors.

4a15465005
Reply all
Reply to author
Forward
0 new messages