Decompiling a file means to break open the compiled source code to view the contents. The goal of decompiling is to access the original source in order to modify it in some manner.
MQ4 and EX4 differences
When you install an expert advisor, you may have noticed two different types of files listed in the experts or indicators folder. .mq4 files hold the original programming code in the MQL language. Programmers can access this file type in order to make changes to the EA or indicator.
The computer does not save ex4 file information in human readable format. Instead, it compiles the code into a series of zeros and ones, called bits, that the computer reads in real time. If you open an ex4 file in the MetaEditor or in NotePad, all that comes up are wiggly characters and gibberish.
The best analogy is to consider the idea of a game plan. If you know that the opposing team’s defense moves slowly, you might try passing more frequently. You don’t know all of the specifics of how the game will play out. The purpose is to develop a general response to a set of circumstances. That’s the mq4 file.
The ex4 file is the series of decisions made in the game that implement the plan to pass more often. The idea is ready to go, even though the individual plays could not have been known because they were in the future. When the plays develop, the players take the generic game plan and implement it in real time.
Reasons to decompile
Most requests to decompile an ex4 file come from traders that purchased a commercial expert advisor and are not happy with the product. Breaking the compiled ex4 file yields an mq4 file. An expert advisor programmer can then take the MQL contents and make the desired changes.
Many would be decompilers want to make harmless changes to a file. A successful indicator may predict the direction of the market, yet it may not generate alerts when it’s a good time to trade. New trading setup signals might save the user from staring at charts too long. Traders mistakenly assume that they need access to the source code to program an MQL indicator. It’s easier to ask a programmer to use the iCustom function rather than breaking into someone else’s code. It’s a legitimate use of the code without requiring unauthorized access to the code.
Some frustrated traders approach me with expert advisors that lose money hand over fist. They want to modify the file contents in the hopes of salvaging a potentially useful concept from the strategy. I’ve also spoken to forex traders that bought “life time licenses” to expert advisors, only to have the vendor go out of business. They want to decompile the ex4 to remove the licensing restriction on a product they rightfully own but that they can no longer access.
I sympathize with the situations as both are common and ethical responses, in my opinion. I suspect, however, that the legal issues with modifying a commercial EA, are not in favor of the customer.
Then, there are the thieves that like someone else’s work but don’t want to pay for it. I unfortunately get this request all the time. OneStepRemoved.com does not offer decompiling services. Too many of the requests revolve around stealing other people’s work.
If you sell expert advisors or sell custom indicators, the most appropriate approach is to program the MetaTrader file in a DLL. It’s even better to encrypt the DLL.
The MQL language was not written with anything in mind other than trading. Code security and the risk of decompiling were not concerns of the MetaQuotes development team. That lead to a preponderance of MetaTrader programmers from Eastern Europe to develop MQL decompiling software and to release it on the internet. Going back and forth between the ex4 and mq4 formats is very, very easy.
Information loss after decompiling
Decompiling ex4 files does yield an mq4 file. That is not, however, the same thing as the original mq4 file. The decompiled ex4 file strips the variable names and replaces them with new machine names.
Good programming practices require naming variables after their purpose. When a variable maintains the distance of a stealth stop, the MQL programmer might name it stealthStop or stealthStopDistance. The decompiled version renames it to something hideous like i_594 or g_12. The decompiling process completely destroys the logical flow of the original mq4 file.
Now imagine a program with 30-50 variables. The name of every single one of those variables changes. The first overview of the code makes no sense. The variable names do not reflect their functionality in any way.
Function names and inputs, also called externs or external variables, are preserved. They do not make the structure of the code clear on their own. Together, they usually form enough information for the programmer to recreate the variable names.
The process of marking decompiled ex4 code and renaming the ugly variables takes at least 1.5 hours. It can many hours if the code is longer than a few hundred lines or the number of variables is unusually high. The review process is necessary if you intend to make any changes to the mq4 file. There’s no way to go about modifying existing MQL code unless its current functionality is clear.
Changes to the mq4 file are exactly like any other MT4 programming project once the review process ends. The coder must program the changes and debug the file to ensure that it works properly.
Find an ex4 decompiler
You can run a basic search for “mql decompiler”, “ex4 mq4 decompile” or any similar combination. The results pages usually show stiff competition among the vendors. It’s not uncommon to get files decompiled for $8-15 per file.
The file delivery times vary between individual vendors. I’ve heard reports that it can take anywhere from a few hours to a week to receive decompiled files. Assuming that you’re decompiling a file for a legitimate reason, it’s hard to know who to trust. The industry, after all, largely targets customers that are stealing. Asking for a trustworthy decompiling service is akin to asking for a trustworthy thief.
Paul says
Hi There,
Funnily enough I bought Forex Power Tools (heavily discounted after they had spammed me for about a month and finally I thought it was a worthwhile price) – More fool me although their members area has lots of goodies and videos etc.. they do not answer emails or their support desk which actually looks and acts quite professional even telling me it has been sent to them but after 8months of trying to get some simple support due to some errors on my machine and now I know they are only interested in getting your money then leaving you high and dry >:-/
I am posting this cause this is how sick it makes you when you pay for something and get sh*t on.
Unfortunately it makes future purchases all the more unlikely as they all promise the support initially but then down the line – you’re on your own and if you have worked well with the indicator/EA/software it really sucks if it then ‘breaks’ and you can no longer get support….
I think that probably helped push many people to the decompilers….
Anyway – I agree with most of what you said and it is just a sad state of affairs that the honest get punished along with the thieves – I would happily show my purchase receipt and/or log into clickbank to prove it but hey …nevermind…(I’m suffering from ‘up-to-late-itis’ lol
Regards,
Paul
Shaun Overton says
Hey Paul,
Thanks for sharing your experience. I’m sad to report that it’s all too common in this industry.
Kebaya says
I used to wonder what the fuss was about decompiling .. till i became an MQL programmer..
Javier Buitrago says
kebaya estoy tratando de encriptar un EA que modifique tu que ya tienes mas experiencia me podrias orientar o regalarme un link de un tutorial para poder realizarlo. gracias
Bruce says
Please help me educated Ea from new buld mt4 latest version contact me ivankarela@gmail.com
Allen says
I wanna have a .ex4 file decompiled. Could you please do me this favour?
Shaun Overton says
That’s not a service that we offer.
chung khoan says
I wanna have a .ex4 file decompiled. Could you please do me this favour?
Shaun Overton says
That’s not a service that we offer.
jack says
i know you don’t offer services on decompiling expert advisors thats too bad because i got on expert advisor that can turn 5000 dollars into a million in 75 minutes.
Shaun Overton says
Something tells me that’s unlikely.
dongming says
hi can you send to me ? my friedn can crack it my email 118180535@qq.com
Mahmoud says
hi this article is great I have to say .
I have an ex4 indicator but the only thing I need is to add the notification alert on my phone . First I thought I need to decompile the file but now after this article I know that I don’t . I only need programmer to add the icustom . Is there a way I can do it ? I know about this language a little bit. How much would it cost if I should pay for a programmer ?
THANKS !
Shaun Overton says
I sent you an email with more info.
MR CHOOCH says
Hi Mahmoud, this tool is exactly what you need. It adds alerts to any indicator by email, sms, or push and its free!
http://www.fxblue.com/appstore/45/alert-forwarder-mt4
Sean says
Hello,
I appreciate your content. I was actually looking to decompile an ex4 file so that it shows a pop alert.
At the moment, it shows a trade arrow, but no alert so I have to stay glued to the system, I can’t continue to do that, and I can’t load multiple pairs because of that.
So is this something you can do without me having to decompile and mess it all up?
Please not e that the indicator isn’t mine originally, it was shared free.
cheers
Shaun Overton says
Hey Sean,
The easiest workaround is to use iCustom and create an indicator that reads the current values, then sends an alert when you get an arrow.
–Shaun
Sean says
Thanks Shaun.
Please where can I get such a service?
Shaun Overton says
I sent you an email yesterday. Please check your junk mail.
Mecro says
hello, can you decompile ex4 files after version 600 ?
Shaun Overton says
Not that I know of.
Chase says
I have a indicator where the developer tracks the past 10 trend change pip moments. My problem is that he does the tracking from the first bar and I want to get the data on the second bar to peak. Is this possible?
Shaun Overton says
Hi Chase,
I want to get the data on the second bar to peak
Can you explain what this means? Send me an email: info@onestepremoved.com
–Shaun
Ezekiel says
Hello I have an EA that works only on demo account, and but now want it to work on a live account . help me please . Email : ezzybinary@gmail.com
Shaun Overton says
Is it a commercial EA? Do you have the .mq4 source code available?
Daisy says
Hi Shaun,
I have an ex4 EA, (I dont have the mq4) and had been making losses, is it possible
to reverse the trades, and make it into a new EA. What is the cost? Thanks.
Shaun Overton says
You would have to have the open source code for this to be possible.
Richard says
Hi Shaun’
I have the same problem as Sean. Could you send me the same email you sent to him about the iCustom service.
Shaun Overton says
Sent
ron says
may i ask you to give decompiler softwr…i just dwnld but must insert file activation
Shaun Overton says
That’s not a service that I offer.
Sandeep Y says
Hi Shaun.. Is it possible to stop working EA after few months or years due to any technical issue with EA. Need your advice before buying this.
Shaun Overton says
The only reason an EA would stop working is if MetaQuotes introduces code-breaking changes into the MQL4 language. They’ve done that before, so yes, it’s possible.
Shane says
Hi,
I have a simple script that places a horizontal line @ the “close” price of the candle it’s dropped on.
I just want the color of the line changed.
I looked @ the code I can see in meta-editor but don’t see any lines with “red”.
I have the MQL4 source file.
Is some of the code hidden?
How can I change the color?
I”ve done it with other indicators but I could easily see it in the code lines.
Thanks
Shaun Overton says
The line is created using the function ObjectCreate(). If you don’t see an object named ObjectSetInteger(), then you’ll either need to add it or live with the red color.
Umar says
Hello Shaun’
I am facing the same problem as Sean, Could you send me the email you sent to him about the iCustom service
Shaun Overton says
Hi Umar,
Please email the indicator to info@onestepremoved.com and we’ll email you an estimate.
douglas says
Dear Shaun,
This is Douglas and i have purchased a EA from a Chinese but the seller who ask me further money for earase a built in time limitation in the EA that he have never told me before purchase.
So can you help me to recode that EA and remove the time limitation.
Great Thx
Douglas
Nao says
Could you still do decompile ex4 file to mq4 file?
Shaun Overton says
No
Muhammad Ali says
Hello i also was looking for ex4 file decompile because of ea comments i want to remove comments from the ea so the broker can’t find either we are doing manual trading or auto trading can u please help me out for this
Shaun Overton says
The broker will always know whether an order was manual or EA generated. Sorry.
Oscar Herrera Latin says
Hola, buen día… interesante artículo. Podrán darse cuenta que todos los que llegan a esta página es porque les interesa descompilar algún archivo y ese también mi caso.
Les cuento, hace 2 días compre un EA de un aviso de youtube, lo encontré bueno…muy bueno y envié un email (justo el 1 de enero 2018 para ser exacto). Me responden mi correo, me envían capturas de pantalla del comportamiento del EA. Y lo compre…
El EA funciona muy bien, excelente mejor dicho en back testing incluso con spread altísimos… el problema lo tuve cuando lo quise probar en cuenta demo… no funciona. Carga el experto pero no abre ninguna posición. Le cargue los setting (.set) que me envió y nada. He enviado un montón de correos pidiendo que me ayude y nada… es decir ya perdí la esperanza que se comuniquen conmigo. De verdad incluso prefiero que me digan que me vendieron algo solo para back testing y que no funciona ni siquiera en demo…a que no me respondan nada.
Tengo el pago enviado por paypal, tengo todos los correos que le enviado solicitando ayuda y obviamente tengo el EA.
Hay alguna manera que ustedes me ayuden? Este experto debe tener alguna sentencia que hace que no trabaje ni en demo ni en real…solo en back testing (supongo).
Como les digo tengo todo los respaldos de que lo compre y que simplemente al parecer…me engañaron. Que impotencia tengo…. este es otro motivo por los que alguien como yo quiere descompilar el archivo para que por lo menos funcione.
Saludos
Shaun Overton says
You have my sympathies, but there’s nothing that I can do to assist.
Guido Rigotti says
Dear shaun,
I have purchased some interesting indicators which are currently installed on my mt4 and work well in live trading. These indicators are given under monthly license in ex4 format, so the code is hidden. I asked the creato the names of the variables for “iCustom” finction, but they replied that the codes are closed and can not give the names of the variables. I do not know how legal their denial is, especially since the exclusive use in live trading is not specified in the license agreement. Is there any possibility of using the indicators on an ea without knowing the code?
Thanks
Guido
Mukesh says
I have ex4 lock file and I want mql4 same this can you do this
Shaun Overton says
We do not decompile files.