Click here to Login

How to Import Metastock data into QuantShare

Updated on 2016-10-21

If you have a Metastock database or if your data provider delivers data in Metastock format, then you can either:

- Use the "Download -> External Database" tool to allow QuantShare to read data directly from your Metastock database
- Or import data from your Metastock database into the QuantShare database

Although the first solution is easier to set up and maintain, the second one offer two big advantages:

1/ Ability to use certain features of QuantShare such as the automated update of watchlists on new data and the ability for the Alert tool to trigger events on new data. The reason is that since QuantShare will use an external database, it will no know about any changes in the data.

2/ Big speed improvement compared to reading data from the Metastock database. This is important particularly when you are optimizing a trading system and backtesting thousands of trading systems.

For the first solution, please follow instructions here:
If you decide to go with the second solution, here is what you need to do:

- Select "Download" then "Download Manager"
- Click on "Add" at the top to create a new download item
- Click on "Add Url" at the top/right corner
- Under "Content Type", select "METASTOCK"
- Click on "Settings" button under "Settings" column
- Click on "Create a URL-Script" button

Here, we will implement the code that would allow the downloader to get all Metastock sub-directories databases and parse them automatically.

In the text editor, type the following script:

string path = @"C:\path_to_metastock_folder\";
string[] dir = System.IO.Directory.GetDirectories(path, "*.*", System.IO.SearchOption.AllDirectories);
for(int i=0;i < dir.Length;i++)
if(System.IO.Directory.GetFiles(dir[i], "EMASTER").Length > 0)
Functions.AddURL(dir[i], "");

// Make sure you update the first line with the path to the Metastock main folder
// The script will automatically look for all sub directories and parse the ones that contain the "EMASTER" file

- Click on "OK" then "OK" again to close the "Download Settings" form.
- Click on the "Parser" button under "Parser" column

A list of all Metastock databases will be listed there. Select one then select a symbol to parse.

Parser Settings

- Click on the "Add Column" as many times as need to create the following structure:

Quotes -> Symbol
Quotes -> Date
Quotes -> Open
Quotes -> High
Quotes -> Low
Quotes -> Close
Quotes -> Volume

Select semicolon as separator and MDY as "Date Type".
Make sure you also check "Automatically add new symbols" if you want to add unknown symbols to your QuantShare database.

Now, set the appropriate time-frame (Example: Daily or 1-min) then click on "Next". Make sure everything is correct then click on "Next" then "Finish".

Please note that a download item should be created to parse only one specific time frame.
If you have a daily database and a 1-min database, then you need to create a different download item for each one.

2 comments (Log in)

QuantShare Blog
Search Posts

Recent Posts

Create Graphs using the Grid Tool
Posted 1328 days ago

Profile Graphs
Posted 1433 days ago

Previous Posts

Introduction to the Grid Tool
Posted 2891 days ago

Trading the Strategy Equity Curve
Posted 3028 days ago

More Posts


Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2024
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.