====== Data Import ====== EA Studio provides an easy way to upload your own history data for backtesting. It is very important to create and test your strategies on data from the broker you will use later for trading. The different brokers have different data providers and time zones. If you use different data it is very likely that the tests in EA Studio and MetaTrader will not match. {{youtube>3wDK_738NxM?medium }} ===== Data export scripts ===== In the Data Import page we provide two Data Export Scripts (MQL). One for MetaTrader 4 and one for MetaTrader 5. {{:eas-guide:export-scripts-1.png?nolink&600|}} Here is how to install a data import script in MetaTrader: - Download the script for your version of MetaTrader - Go to **File > Open Data Folder** - From the list open the **MQL4** folder - Open the **Scripts** folder - Put the downloaded file in the current (**Scripts**) folder - Go back to MetaTrader - Go to the **Navigator** box (if it is not open open it from **View > Navigator**) - Right click in the **Navigator** box and use **Refresh** from the menu. - The script will appear in the list. - The below steps are **only needed for MT5** since it does not compile new scripts automatically. - In the **Navigator** box right-click on the script name and choose **Modify** - A code editor will open. From the buttons in the top menu click **Compile** - Close the code editor window. The end result should look like this: {{:eas-guide:data-export-script.png?nolink |Data export script}} ===== Export Files from MetaTrader ===== - Open a chart - Disable auto-scrolling on new tick (See **Disabling auto-scroll on new tick** below) - Use **Ctrl** + **-** to zoom out the chart so more bars can be loaded at once - Press and hold down the **Home** key on your keyboard as long as new bars appear to the left (this and the previous one allow you to load all bars your broker would send to your MetaTrader) - Drag and drop the Script to the chart. When the Script Properties window opens, select the Input Tab (see below) and change any of the variables you wish to. If everything works as it should, you will see messages on the chart similar to **Working script** (see below) **Disabling auto-scroll on new tick** {{:eas-guide:disable-chart-scrolling.png?nolink|Disabling auto-scroll on new tick}} **Working script** {{:eas-guide:data-export-meta-trader-chart.png?nolink|Exported files}} **Input Tab** {{:eas-guide:eastudio-data-import-4.png?nolink&400|}} ===== Import Files to EA Studio ===== The Script will save all data files to the MetaTrader MQL*/Files folder. To import the files to EA Studio - Go to **File > Open Data Folder** - From the list open the **MQL4** folder - Open the **Files** folder. You should see multiple JSON files in it. Select all files and drag and drop them to the Drop Zone in the Data window in EA Studio {{:eas-guide:drag-and-drop-data-files.png?nolink|}} The program will show the list of the loaded files. You can return in the Editor page and to select your data server and symbols. If you are signed in, the application will store the files in the cloud. ~~DISQUS~~