• Skip to primary navigation
  • Skip to main content
  • Skip to footer
barmenteros FX logo

MetaTrader Programming Services | Programmers for MT4, MQL4, MT5, MQL5, Expert Advisor EA, Forex robots, Algo Trading | barmenteros FX

No matter if you need an MT4 programmer, EA programmer, Forex programmer, or MQL programmer. We are the best qualified team to develop your forex trading strategy. Highly skilled in MT4 programming, Expert Advisor EA programming, Forex programming, and MQL4 programming.

  • Home
  • Blog
  • Services
    • MT4 Programmers
    • MT5 Programmers
    • EA programming
    • Forex Programming
    • MQL4 Programming
    • MQL5 Programming
    • MetaTrader 4/5 License Management
    • EA Debugging and Code Review
  • Products
    • My Account
    • LicenseShield – MT4/MT5 License Protection
    • Latest Offers
    • MT4 Indicators
    • MT5 Indicators
  • Request Quote
  • Show Search
Hide Search
Home/Blog/MQL4 decompiling from EX4 to MQ4
Padlock labelled EX4 with a key labelled MQ4 inserted into the keyhole, illustrating the MQL4 decompiling relationship between compiled and source formats

MQL4 decompiling from EX4 to MQ4

MQL4 is a powerful programming language used for creating custom indicators, expert advisors, and scripts in the MetaTrader 4 platform. While the executable files are all that’s necessary to use an EA or indicator, traders may want to access the original source code in MQ4 format for various reasons. That’s where decompiling comes in. In this article, we’ll explore the process of decompiling an EX4 file to MQ4 format, when to use decompiling, and some tips for using decompiling tools responsibly and ethically.

Important Notice

This article is for informative purposes only and does not endorse the decompilation of files or offer decompilation services. Decompilation can violate MetaQuotes Software Corp’s intellectual property and copyright laws. We advise readers to refrain from contacting us for any decompilation services or related requests.

Table of Contents

Toggle
  • What is Decompiling?
  • MQL4 and EX4/MQ4 Formats
  • When to Use Decompiling
  • Using a Decompiler Tool
  • Additional Tips
  • What About MQL5 and EX5 Files?
  • Can You Protect Your Own MQL Code from Decompiling?
  • Final Thoughts

What is Decompiling?

Decompiling is the process of converting a compiled binary file, like an EX4 file, back into its original source code. The resulting code may not be perfect, but it can still be useful for gaining insights into how a particular indicator or expert advisor works.

MQL4 and EX4/MQ4 Formats

MQL4 is a programming language used for creating custom indicators, expert advisors, and scripts in the MetaTrader 4 platform. MQL4 code is compiled into EX4 format, which is the machine-readable format that is executed by the MetaTrader 4 platform. There are two file formats in MetaTrader 4: ‘.ex4’ for the executable files and ‘.mq4’ for the source code. The MT4 platform only uses the executable files, so only these files are necessary to use an EA, an indicator, or any other MT4 program. The source code is only used by a programmer to make corrections, adjustments, modifications, or improvements in the MT4 program.

Flow diagram showing MQ4 source code compiled to EX4 executable, with a partial decompile arrow returning to a recovered MQ4 file, indicating the decompilation output is incomplete

When to Use Decompiling

Traders may want to decompile an EX4 file into MQ4 format for various reasons, such as modifying the code or understanding how a particular expert advisor or indicator works. Common reasons include:

  • Modifying, correcting, or improving an MT4 program where the original developer is unavailable
  • Recovering lost source code when only the compiled EX4 exists
  • Learning MQL4 programming by studying how existing EAs are structured
  • Converting an MT4 program to MT5 when starting from scratch is impractical

Using a Decompiler Tool

To decompile an EX4 file to MQ4 format, traders need to use a decompiler tool. There are several decompiling tools available online, but it’s important to choose a reliable and trustworthy one to ensure the safety of your computer and the quality of the resulting code, and to be realistic about output quality — in our experience working with hundreds of MT4 EAs, decompiled MQ4 code typically requires significant cleanup before it’s workable, and complex logic (nested switches, global variable state machines) often decompiles poorly. However, it’s important to note that decompiling can violate MetaQuotes Software Corp‘s copyrighted works and intellectual property, so it’s important to use decompiling tools for legal and ethical purposes only.

Additional Tips

Traders don’t need the source code (mq4 file) to build an MT4 Expert Advisor (EA) based on an indicator. In fact, an MT4 EA only uses the compiled file (ex4 extension). Additionally, a skilled MT4 programmer can develop a new indicator that gets the signals from the original indicator and sends alerts and notifications whenever a signal is triggered, even without the mq4 file.

What About MQL5 and EX5 Files?

With MetaTrader 5 now the dominant platform for new EA development, the equivalent question arises for MQL5: can EX5 files be decompiled back to MQ5 source code?

The short answer: significantly harder than MQL4. EX5 files use a more sophisticated compilation architecture, and MetaQuotes has progressively hardened the format against reverse engineering in recent versions. While experimental decompiler tools exist for EX5, the output quality is considerably worse than for EX4 — in most cases, what emerges is difficult to interpret and requires substantial manual reconstruction.

Side-by-side comparison of EX4 and EX5 decompilation: EX4 has available tools with partial output quality, while EX5 decompilation is limited and produces mostly unusable code

For practical purposes, if you’re working with an MT5 EA and have lost the source code, the realistic options are:

  • Contact the original developer for a re-delivery or migration
  • Commission a rebuild from scratch, starting from the compiled EA’s observed behaviour
  • Use signal-based wrapping — writing a new EA that reads signals from the existing compiled EA rather than modifying its internals

If you’re developing new EAs for MT5, protecting your EX5 source code from the start is more straightforward than trying to recover it after the fact.

Can You Protect Your Own MQL Code from Decompiling?

A significant portion of readers arrive at this page with the opposite concern: not how to decompile others’ code, but how to prevent their own EX4 or EX5 files from being decompiled.

This is a legitimate technical concern. Standard EX4 compilation does not prevent reverse engineering — a motivated party with the right tools can extract meaningful code structure, logic flow, and parameter ranges from a compiled file. For developers who sell or distribute EAs commercially, this represents a real IP exposure.

Several approaches address this:

  • Code obfuscation: Renaming variables and restructuring logic before compilation. Reduces readability of decompiled output, but adds no encryption.
  • MetaTrader’s built-in protection (#property strict + compilation flags): Limits some decompiler tool compatibility, but is not cryptographic protection.
  • Dedicated licensing and encryption tools: LicenseShield applies hardware-binding and key-based licensing directly to your compiled EA. Even if the EX4 file is extracted, it will not run on unauthorised machines or without a valid licence key.

For developers managing multiple client installations — or selling EAs commercially — our MetaTrader license management service provides the complete distribution and key management infrastructure.

Final Thoughts

Decompiling an EX4 file into MQ4 format can be a useful tool for traders who want to modify or understand the inner workings of a particular expert advisor or indicator. However, traders should use decompiling tools for legal and ethical purposes only, and they should be aware that decompiling may not always produce perfect or readable code. It’s also important to have a good understanding of programming principles to be able to make sense of the decompiled code. By using decompiling tools responsibly and with caution, traders can gain valuable insights into their MT4 programs and improve their trading strategies.

If decompiling concerns you because you’re worried about your own EX4 files being reverse-engineered — the answer is EA protection, not decompiling others. LicenseShield encrypts and licenses your MQL code so only authorised users can run it, without requiring you to share the source. For client projects or commercial EAs, our MetaTrader license management service handles multi-client distribution and key management. Both approaches address the real concern beneath most decompiling questions: keeping your trading tools under your control.

For a deeper look at source code vulnerabilities, read: How to protect your MT4/MT5 EA from piracy.

  • LinkedIn
  • Facebook
  • Telegram
  • Instagram
  • Mail
  • YouTube

Written by:
barmenteros FX
Published on:
November 7, 2017
Last Updated:
April 28, 2026
Thoughts:
20 Comments

Categories: Blog

Reader Interactions

Comments

  1. Bhavesh Dodiya

    December 8, 2024 at 19:53

    I have MT4 indicator ex4 file to mq4 decompiler file with original source code

    Reply
  2. Davon Wagner

    February 22, 2022 at 16:13

    Hi i Need an indicator decompiled, please note the indicator is not mine however there are a couple of errors within the code when alerts come on, it signifies the incorrect divergence, i cant find the mql4 file anywhere online and therefore need your assistance if possible.

    Please let me know if its possible.

    Reply
    • Isaac

      April 23, 2023 at 07:07

      Hi man
      I cam help you with this
      You can contact me at Decompiler_dev on telegram

      Reply
      • Kev

        September 28, 2023 at 12:16

        Hi, I have an ex4 file thats needing decompiled please. Im happy to pay.

        I’ve joined your Telegram channel

        Reply
      • Reza

        June 20, 2024 at 11:47

        Hello
        I need help
        Decompile a file for me if possible
        thank you

        Reply
  3. Sitali Sinamuwi

    December 30, 2020 at 23:26

    Hello, am glad to have found this website I ll appreciate it if you could assist me to decompile an Mt4 executable file, as I was made to pay for a service I never got, if anything having the source code would be of much help.

    Reply
  4. Alexander

    December 29, 2020 at 21:51

    I want to convert the EX4 file to an editable MQ4 file and I don’t have the source code. Guide me on how can I convert without a source file.

    Reply
  5. Tina Baneries

    December 18, 2020 at 15:44

    We can’t forget that Metatrader can decompile even the files compiled from the Cloud Protector because they have the keys. So, in case someone produce something really interesting Metatrader can always know how it was done.
    My opinion is that developers should use their own website to sell worthwhile products and not lodge products with Metatrader. This will also allow the use of .dll and customized protection.

    Reply
    • jegouzo

      June 28, 2021 at 01:27

      are yoy able de decrypt the prodected source code of a mql5 EA ?? to crack it
      [email protected]
      contact me if you are able

      Reply
  6. Katlego Thomas

    August 19, 2020 at 23:30

    Can you make a repainting indicator not to repaint anymore

    Reply
    • Barmenteros FX Staff

      August 19, 2020 at 23:42

      Sorry but that’s not possible. Regards

      Reply
  7. Dunu kenechukwu

    July 26, 2020 at 20:18

    Hi thnks for the idea
    I have a custom indicator I which to build an EA with ,but it’s an Ex4 file
    Pls what do I do?

    Reply
    • Barmenteros FX Staff

      July 26, 2020 at 23:56

      Hi. You can build an EA based on the indicator no matter if it’s only an ex4 file. At least we can do it. You can send us your request using the form here. Best regards

      Reply
  8. samuel

    September 20, 2019 at 21:46

    Hi,
    decompiling to me is of interest because in case we bought a product, as we don’t have the source code, we are not protected against the possibility of the software not to work anymore in the (sometimes near) future. That is very annoying and stress favoring. When we are satisfied by a product we want us to be able to continue using it. Because of MT4 and other evolutions, some programs can cease to work suddenly. In addition, we may want to correct or modify a bought program, and the source code is needed in this case. In any of these uses, the intention is to properly speaking “appropiate” the work done by others. I have never used a decompiling service but if I had a software able to ecomplie ex4 into mq4, I would definitly use it. In order to have the source code if needed one day (be in peace), or to correct programs I have used (creative process).

    Reply
    • Barmenteros FX Staff

      September 21, 2019 at 02:13

      Hi Samuel. Thanks for your interesting comment. Regards

      Reply
      • Massimiliano Papera

        August 12, 2020 at 19:17

        I totally agree

        Reply
    • Israel

      April 29, 2021 at 03:06

      I agree

      Reply
  9. Barmenteros FX Staff

    August 13, 2019 at 12:42

    Please, send us an email to [email protected]

    Reply
    • Israel

      April 29, 2021 at 03:07

      I will,
      Because i have some question and i need some help

      Reply
  10. Resource

    June 15, 2018 at 02:32

    Some EA required that PC and EA shoul be switched on with internet connection during trading hour; If i’m using VPS Do i need to swithced my pc on with internet connection before EA will be taking trade? OR the EA will be taking trade for me even if i’m off line through the help of VPS
    Please, send reply to my e-mail address.
    Thanks

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Explore more

Get a Free Quote Get Inspiration Get Connected

Footer

barmenteros FX

Avenida Principe Salman, 6, 5th
29603 Marbella (Malaga) — Spain

Copyright © 2026

Footer

COMPANY

  • Home
  • About Us
  • Contact
  • Request Quote

SERVICES

  • MT4 Programmers
  • MT5 Programmers
  • EA Programming
  • Forex Programming
  • MQL4 Programming
  • MQL5 Programming
  • MetaTrader 4/5 License Management
  • EA Debugging and Code Review
  • All Services

PRODUCTS

  • My account
  • LicenseShield – MT4/MT5 License Protection
  • Latest Offers
  • MT4 Indicators
  • MT5 Indicators

LEGAL

  • Terms and Conditions
  • Privacy Policy
  • Cookies Policy
  • Risk Disclosure
  • Payments & Refunds Policy
  • Warranty & Support Policy
  • Intellectual Property Notice
  • General Disclaimer