Are MT4 Custom Indicators Safe? DLL And Virus Fears Explained

Are MT4 Custom Indicators Safe? DLL And Virus Fears Explained
Share on facebook
Share on twitter
Share on linkedin
Share on email
Share on whatsapp

The popularity of MetaTrader 4 (MT4) means that there are literally thousands of sites available to find custom MT4 indicators or expert advisors (EAs). But are these indicators safe? Some of them may require DLL imports, what does that mean and is there a risk?

Are MT4 Indicators Safe?

Yes, MT4 custom indicators are safe to use and pose little or no risk to your PC so long as you take sensible precautions, in the same way as you would with any files you would download onto your computer.

So what are sensible precautions? Well, there are several simple things you can do and look for to minimise your risk. In the case of .DLL files it is useful to understand what they are and why they might be needed in a custom indicator or EA.


Sorry for stating the obvious, but ensure you have antivirus software installed on your computer that also provides active protection whilst browsing the internet. This is a no brainer but had to be said.

I use BitDefender and find it excellent.

File Extensions Matter

The first precaution you should take is to make sure that the file that you download matches your expectations. There are two main MT4 file types:

  • MQ4 files: These are uncompiled files that allow you to see the source code of an indicator or EA
  • EX4 files: These are the compiled files which will execute the indicator or EA of your choice

As such, if your download has a different file extension then be very careful. These file extensions are not executable by themselves and can only be used with the MT4 program.

Beware Of Executable Files (.exe)

The most dangerous option is any executable file (a file that ends with .exe).

Do not run random .exe files on your computer unless you trust the source 100% and you have scanned it with antivirus software.

Having said that, there may be a reason for using an executable file, for example the vendor may be selling or offering a package of indicators with licensing and the use of an installer can be a useful way to ensure everything gets copied into the correct folders.

Quality Matters

So how do you trust the source of your indicators? We are all more tech savvy nowadays than ever before and most people are a lot more cautious on downloading files from the internet due to virus fears.

However, despite knowing better, it is still tempting to download files when there is something you really want to have! So before you download a custom indicator or EA ask yourself:

  • Is this a reputable site?
  • Is it more than just a forum post or a random link?
  • Does the site have a contact page?

You can never be 100% sure but it is worth minimising your by stopping to ask yourself the question, is this a quality site, is it reputable?

What is a DLL file?

A DLL file is a shortcut for programmers. Short for Dynamic Link Library, this is a Windows file that contains a set of standard instructions that other programs can call on. This helps programmers to call on functionality within Windows without having to recode it in their programme.

This can allow for programs to be more efficient or call on functions not available in that programming language. MT4 custom indicators and EAs are programmed in the MQL4 programming language and by using DLL files, programmers can extend the functionality of MQL4.

Can A DLL File Harm My Computer?

By itself DLL file is not harmful to your computer. A DLL file on its own is not executable, it cannot be run without being called (imported) by another executable program.

That does not mean it cannot do any harm as it could be dangerous if the executable program that is calling it is one that is meant to cause your computer harm.

As such, you should focus your attention on the combination of the DLL and the executable that will be used and make sure both are scanned for viruses.

Do Indicators Or EAs Have To Use DLL files, What Are DLLs Used For?

In many cases custom indicators or EAs have no need to use DLL files. The MQL programming language is simple but is suitable for the majority of custom indicators and EAS.

It is after all a language built specifically for MT4 and trading and as such fits most purposes. There are however some legitimate uses for DLLs.

Using DLLs For Speed

In instances where there is a need for mathematically intensive programming then a DLL could be used. MQL as a programming language is very slow in comparison to more powerful languages. If there is an EA that is looking to process a very large number of calculations, this can cause MT4 to freeze.

“Moving those calculations into a DLL passes that responsibility for calculating the numbers to a more powerful language. MetaTrader only likes C/C++ or Delphi, which are referred to as higher level. The MQL programmer can control the physical hardware in order to optimize performance if it’s required. That would usually be overkill. A generic dll program written C will run many, many times faster than the same code in MQL.”


Using DLLs for Licensing And Encryption:

This is likely the most common use you will find for the use of DLL files, especially in custom EAs.

Programmers and vendors need the ability to call on web functionality in order to enable the use of most licensing systems that are in place for EAs and will use a DLL file to help enable this.

Another common reason is related to the protection of the programmer’s intellectual property (their code). If you have spent a lot of time and effort building something, then of course you may want to protect it.

Although EX4 files cannot be decompiled in Metatrader to reveal the code, the basic encryption on them is weak. This means that these files could be cracked more easily than the person who had spend time and effort building it is happy with.

DLL files come into play here as well, allowing the programmer to call on functions of higher level languages to improve the encryption of their file and avoid the code being stolen.

Using DLLs for Trade Copiers

Another good example of DLL use is for copy trading. Copy trading is where you use a single MT4 terminal as a ‘master’ and copy actions (usually trades) from the master terminal to several other terminals.

This can allow trading simultaneously across different accounts with the same or multiple brokers.

How to Enable DLL Imports In MT4?

If you have determined that the indicator or EA is safe, from a reliable source and you understand the reason for it using a DLL file then you should feel confident in enabling it.

MT4 disables the use of DLL files by default for security reasons and also to avoid unnecessary use of resources. In order to make it work you will need to follow these steps.

Steps To Enable DLL Imports In MT4:

  1. Open the Options menu for your indicator or EA
  2. The options/input menu will automatically show when you double click it from the Navigator window or drag it onto a chart
  3. For an Expert Advisor (EA) that is already loaded, access options by clicking F7
Allow DLL Imports for EA
Allow DLL Imports for EA

4. To enable DLL use for an EA go to the ‘Common’ tab and check the box to ‘Allow DLL imports’ in the right hand section

5. For an Indicator that is already loaded, access the options by clicking Ctrl+I and selecting the indicator you want to edit

Allow DLL Imports for Indicator
Allow DLL Imports for Indicator

6. To enable DLL use for a custom indicator go to the ‘Common’ tab and check the box to ‘Allow DLL imports’
7. Click OK to complete

What Happens When You Click Allow DLL Imports In MT4?

Allowing DLL imports is not a global setting in MT4, it is enabled for each custom indicator or EA on a case by case basis by the user.

By checking the box to allow DLL imports, you are enabling that specific indicator or EA the ability to load functions from a DLL separate to MT4 in order to run additional functions.

Related Questions

Can an MT4 download have a virus?

It is very unlikely that MT4 itself will have a virus so long as you have downloaded it from a reliable source such as your broker or from MetaTrader themselves. As with any files you download and run on your computer, you should scan with antivirus software before installation.

Justina Nothard

Justina Nothard

Hi, I’m Justina Nothard, a retail investor trading Stock Index Futures.

I understand how hard it can be for the ordinary trader to learn the basics and find useful tools and practical information.

This is why I decided to create Nothard Trading to help you take control of your trading.

Scroll to Top