Import Metastock data via OLE


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

ab.Import( 0, "C:\\MetaStock Data\\Asia\\Tokyo Stock Exchange\\XMASTER", "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.


Hi @mdwin01

I am curious to know why you don’t open a new database for amibroker for "X" good reasons.

Then you spent your time to think about OLE? Instead to connect MSdatabase with Amibroker Metastock importer window.
I am sure, you or me I am missing something.

i donot have MS but for sure you need to read little bit the links

More Links form Google

Also if you have the data in ascii file like txt, csv … you can read the forum for Import


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.


Has anyone successfully automated Metastock multi-symbol multi-quote imports into a local AmiBroker database, as in:?

ab.Import( 0, "C:\\MetaStock Data\\Asia\\Tokyo Stock Exchange\\XMASTER", "metastock.format" )


Hi Mark

To address a question is to deal with a question, not necessarily to answer it.

Any way i have the filling that we are here to help each other. yes?

As i told you i donot have MS and for that reason i would like to know

  1. how the XMASTER file looks like?.
  2. is the xmaster has the same format as the metastock.format file?

Below line is from metastock.format file
$FORMAT Ticker,Skip,Date_MDY,Open,High,Low,Close,Volume

i think i answer your question as well, as i believe the XMASTER is BINARY file so how you can read it with java?

I am off.
Good luck


@mdwin01 you mixed up a lot of things. So few clarification points:

  1. OLE Import method supports only TEXT (ASCII/CSV format), not binary
  2. Metastock's proprietary BINARY Databases (those with MASTER and Fxx.DAT) files can ONLY be imported using File->Import Metastock Data (ONLY from GUI) or read directly using the plugin
  3. The "metastock.format" specification refers to TEXT format used by Metastock DOWNLOADER (i.e. files with .PRN extension). It has nothing to do with binary database

As @PanoS wrote you you should use THE SIMPLEST method which is the plugin:

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


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:

  1. Metastock told me that they remove discontinued symbols (creating survivorship bias), while already imported symbols would stay behind
  2. New symbols could be automatically identified by using $WATCHLIST in the *.format file ( as opposed to having to go manually through the GUI "File->Database Settings->Configure and click "RETRIEVE" again to get new symbols" and then looking for new symbols)
  3. Analysis/explorations would be faster through a local vs Metastock db (on you seem to say it's 3x faster with Amibroker db)
  4. I could have failover/redundant data sources retrieve quotes if current day quote did not come in through Metastock, if symbol was in Amibroker db. If it's a Metastock db symbol, I'm 100% dependent on Metastock supplying correct quote in a timely matter.

Ruby programming, was: Can OLE access external data?