Metatrader 101: Installing a DLL Library to your Mt4 Installation

Programming, Products & Research for Traders

Metatrader 101: Installing a DLL Library to your Mt4 Installation

This is the one in a series of Metatrader 101 posts, partly so that I can have something to give to clients who are new to Mt4. It will cover the basics so people can get up and running quickly.

 

Some more advanced Metatrader code that you’ll come across will require a DLL (a Windows library file) to be installed as well as the actual .ex4 or .mq4 file. This is actually just as easy as installing any Metatrader code. Here’s how to do it.

 

1. A DLL file will have a .dll name tag to it so you’ll know that it needs to be treated differently from other Metatrader files.

 

2. Unfortunately, the location on your hard drive of your Mt4 software is rather complicated as it’s split up into two locations. The bit where you need to copy your new software to is hidden away deep within the AppData section and you won’t easily find it by exploring the various folders. To help you with this there is a menu option which will open the location for you. From your Mt4 software go to File | Open Data Folder in order to bring up Windows Explorer opened at the correct folder location.

 

The folders within the MQL4 main folder

 

3.  You’ll see an MQL4 folder which you should open to reveal a series of sub-folders (see image above). Unlike for .mq4 or .ex4 files, DLL’s need to go in the Libraries folder so navigate there and drop the file in the folder.

 

4. That’s basically it! Unlike for .mq4 or .ex4 files there’s no need to refresh or restart your Mt4 program explicitly for the DLL though if you’ve installed some code which uses the DLL then you’ll need to refresh or restart for that part. See the instruction on installing new Mt4 code for details on how to install mq4 or .ex4 files.