Source code
MQ4 vs EX4 and MQ5 vs EX5: What Are You Buying?
MQ4 and MQ5 are editable source files for the MT4 and MT5 environments respectively. EX4 and EX5 are compiled programs. A SET file stores input settings; it is not the strategy's source code. Check the file list before buying an “EA source code” package.
The file extensions at a glance
| File | Role | Editable strategy? |
|---|---|---|
.mq4 | MQL4 source, normally targeting MT4 | Yes, where that logic is included |
.ex4 | Compiled MT4 program | No source text supplied |
.mq5 | MQL5 source, targeting MT5 | Yes, where that logic is included |
.ex5 | Compiled MT5 program | No source text supplied |
.mqh | Included source or declarations | Depends on its contents |
.set | Saved input values | No; settings only |
MetaQuotes describes compilation as producing an executable from the main source file or project; compiled files can be distributed without that source. See MetaEditor's compilation reference and the application folder structure.
One source file is not always the whole project
Imagine a delivery with Robot.mq5 and Robot.ex5. The source contains an include referring to a missing private library. You have editable text, but you may not have everything needed to build the program. This hypothetical example is why “source included” and “complete editable implementation” should be checked separately.
Ask for an inventory that separates source includes, custom indicators, compiled libraries, DLLs, data files and optional presets. Also ask which dependencies can be inspected and changed. A dependency supplied only as a binary can remain a boundary around part of the logic even when the main file is editable.
Renaming is not conversion
Changing an EX4 extension to EX5 does not port a program. MQL4 and MQL5 have differences in their language and runtime interfaces; MetaQuotes maintains a migration reference. A genuine port needs the relevant source, deliberate adaptation and tests of the resulting behavior.
Similarly, saving a compiled file with an MQ5 extension does not create readable source. When comparing offers, ask the seller what file you can open in MetaEditor and what you can compile yourself. Keep that question separate from any claim about similarity to another product.
Track source, binary and settings together
Give each test a small record: source release, compiled file, build date and settings file. A familiar file name is not a reliable version identifier because it can be reused. After changing the source, give the experiment a distinct name and keep the earlier package.
Do not assume an old SET file remains appropriate after inputs change. Compare input names, units and defaults. An input labelled “distance” could use points, ticks or a price amount; copying the same number between implementations may change its meaning.
A delivery check you can actually perform
- Match the delivered inventory to the product description.
- Open the main source and inspect its dependencies.
- Compile using the documented platform and environment.
- Confirm the new compiled file belongs to that build.
- Load the documented settings and run a small test.
These checks establish what you received and whether you can work with it. They do not establish trading quality or permission to redistribute it. For the commercial questions, use the source-code buying checklist; for the practical build steps, continue to compiling an MQ5 project.
Back to top