Blog Details

thumb
03 Sep 2026

Decompiling Custom MT4 Indicators: How to Recover EX4 Source Code for Indicators

Decompiling Custom MT4 Indicators: How to Recover EX4 Source Code for Indicators

Custom indicators are an important part of the MetaTrader 4 ecosystem. Traders and developers use them to calculate market data, display signals, generate alerts, draw chart objects, and support automated trading systems.

But what happens when you have a custom indicator in EX4 format and no longer have the original MQ4 source code?

This is where EX4 decompilation and source-code recovery may become relevant.

A professional EX4 to MQ4 decompiler service can analyze a compiled MT4 indicator and, where technically possible, attempt to recover or reconstruct usable MQL4 source code.

This guide explains how custom MT4 indicator source-code recovery works, what affects the process, what you should expect from recovered code, and how to choose a professional EX4 decompiler service.

What Is a Custom MT4 Indicator?

A custom MT4 indicator is a program developed in MQL4 to perform technical analysis or display information on a MetaTrader 4 chart.

MetaQuotes describes custom indicators as independently programmed analytical tools that can implement custom algorithms and display market information. Unlike Expert Advisors, custom indicators are intended for analysis rather than automatically executing trades.

Custom indicators can be used for:

  • Buy and sell signals
  • Trend identification
  • Momentum analysis
  • Support and resistance
  • Price calculations
  • Alerts
  • Chart visualization
  • Custom indicator buffers
  • Multi-timeframe analysis
  • Data used by other MQL4 programs

What Is an EX4 Indicator File?

An MT4 custom indicator is normally created as an MQ4 source file and then compiled.

The development process looks like this:

MQ4 Source Code → MetaEditor → Compilation → EX4 Indicator

MetaTrader documentation explains that after a custom indicator is successfully compiled, an executable .EX4 file is created and placed in the appropriate indicators directory.

For example:

MyIndicator.mq4

becomes:

MyIndicator.ex4

The MQ4 file is the source code, while the EX4 file is the compiled application.

What Is EX4 Indicator Decompilation?

EX4 indicator decompilation refers to the technical analysis of a compiled EX4 custom indicator with the goal of recovering or reconstructing usable MQL4 source code.

The objective is not simply to change:

indicator.ex4

into:

indicator.mq4

Instead, the compiled program must be analyzed and, where possible, reconstructed into source-code form.

This can involve:

  • EX4 file analysis
  • Program structure analysis
  • Logic recovery
  • Source reconstruction
  • Code organization
  • Compilation
  • Debugging
  • Functional testing

The exact process depends on the individual EX4 file.

Why Would Someone Need to Recover an MT4 Indicator?

There are several legitimate reasons.

1. The Original MQ4 Was Lost

You may have an indicator that still works perfectly but lost the original source code.

The EX4 file may be the only remaining copy.

2. The Original Developer Is Unavailable

Perhaps the developer who created the indicator is no longer available to provide updates.

If you are authorized to work with the software, recovering source code may provide a starting point for future maintenance.

3. You Need to Modify the Indicator

You may want to change:

  • Signal calculations
  • Indicator settings
  • Alerts
  • Colors
  • Display elements
  • Buffer calculations
  • Timeframe logic
  • Input parameters

Without MQ4 source code, these modifications are much more difficult.

4. You Need to Maintain an Old Indicator

An older indicator may need technical maintenance or adaptation to your development environment.

5. You Need to Understand the Indicator’s Logic

You may want to investigate how an indicator calculates signals or displays information.

Source-code recovery may provide a useful starting point for legitimate analysis and further development.

EX4 vs MQ4 for Custom Indicators

Understanding the difference is essential.

Feature

MQ4

EX4

Format

Source code

Compiled program

Editable

Yes

No

Used for development

Yes

No

Used by MT4

After compilation

Yes

Contains source text

Yes

Compiled representation

Can be recompiled

Yes

Not as source

MQL4 documentation describes MQ4 as source code and EX4 as the executable result of compilation.

Can You Rename an EX4 Indicator to MQ4?

No.

Renaming:

CustomIndicator.ex4

to:

CustomIndicator.mq4

does not recover the source.

The extension is only part of the file name. It does not transform compiled program data into editable MQL4 source.

If the original MQ4 source exists, it should be used. If it has been lost, source-code recovery is a separate technical process.

How Does Custom Indicator Source-Code Recovery Work?

The exact methodology can vary, but a professional recovery project can be viewed as several stages.

Step 1: Examine the EX4 File

The first step is to assess the indicator.

Important characteristics can include:

  • File integrity
  • Program structure
  • Compiler characteristics
  • MT4 build considerations
  • Protection
  • Dependencies
  • External resources

Step 2: Analyze the Indicator

The technical structure of the compiled application is examined to identify information that may be useful for reconstruction.

Step 3: Recover or Reconstruct Source

Where technically possible, the available program information is reconstructed into MQL4 source-code form.

Step 4: Organize the Code

Recovered code may require organization and cleanup before it becomes convenient for further development.

Step 5: Compile the MQ4

The recovered source should be compiled in MetaEditor.

MetaEditor is the development environment used to create, edit and compile MQL4 programs.

Step 6: Test the Indicator

The recovered indicator should then be compared against the original EX4.

Testing can include:

  • Signal output
  • Indicator values
  • Alerts
  • Chart objects
  • Visual output
  • Different timeframes
  • Different symbols

Why Indicator Decompilation Can Be Difficult

Not every custom indicator is equally easy to analyze.

Several factors can influence the recovery process.

Compiler and MT4 Build

MetaTrader 4 has undergone significant changes over its lifetime.

The Build 600 transition substantially revised MQL4 and introduced changes to the compiler, language and file structure. It also introduced stronger protection for EX4 applications distributed through the Market.

This means the technical characteristics of an older EX4 can differ from those of a newer compiled application.

Indicator Complexity

A simple moving-average-based indicator may be much less complicated than an indicator containing:

  • Multiple calculations
  • Numerous buffers
  • Complex mathematical formulas
  • Multi-timeframe logic
  • External indicators
  • Custom libraries
  • Dynamic chart objects
  • Alerts
  • External dependencies

Protection

Some commercial MT4 applications use protection mechanisms designed to make their internal implementation more difficult to inspect.

Protection can increase the difficulty of source-code recovery.

External Dependencies

An indicator may rely on other files or functionality.

MQL4 supports external DLL imports and custom libraries, and indicators can also be used as components by other MQL4 applications.

If an indicator depends on missing files, recovering the main EX4 alone may not reproduce the entire original development environment.

Recovering Indicator Inputs

One important part of indicator recovery is understanding its input parameters.

For example, an indicator might have settings such as:

  • Period
  • Applied price
  • Signal sensitivity
  • Alert settings
  • Calculation mode
  • Timeframe
  • Display options

The original input configuration can be useful when testing recovered source code.

However, the exact original source structure and naming should not be assumed simply from the visible MT4 settings.

Recovering Indicator Buffers

Custom indicators often use indicator buffers to store values that are displayed or accessed by other MQL4 programs.

MQL4 provides functionality for working with custom indicator buffers, and other programs can access custom indicator values through functions such as iCustom().

This makes buffer behavior an important part of indicator testing.

A recovered indicator should ideally be checked to determine whether its:

  • Buffer values
  • Signal timing
  • Line output
  • Arrow signals
  • Historical calculations

match the original indicator’s behavior.

Recovering Alerts and Chart Objects

Some custom indicators do more than draw lines.

They may create:

  • Buy arrows
  • Sell arrows
  • Text labels
  • Trend lines
  • Boxes
  • Notifications
  • Sound alerts
  • Popup alerts

When recovering an indicator, these features should also be tested.

An indicator that produces the correct numerical values but does not reproduce its alerts or visual components may still require additional development.

Can an EX4 Indicator Be Recovered Exactly?

You should be careful with the word exactly.

Source-code recovery does not necessarily mean reproducing the original developer’s project line-for-line.

Recovered source may differ in:

  • Variable names
  • Comments
  • Formatting
  • Function organization
  • Include files
  • Project structure
  • Development documentation

The more realistic objective is often to recover usable and maintainable MQL4 source code or reconstruct the indicator’s functionality.

Does Every EX4 Indicator Have the Same Recovery Potential?

No.

Two EX4 indicators can have completely different technical characteristics.

For example:

Indicator A

  • Simple calculations
  • No external dependencies
  • No unusual protection
  • Small codebase

Indicator B

  • Multiple calculation modules
  • External DLL
  • Custom libraries
  • Complex buffer logic
  • Protection mechanisms

These two files may require very different levels of technical work.

This is why a professional EX4 indicator decompiler service should assess the actual file before making strong promises.

Free EX4 Decompiler for Indicators

You may find websites advertising:

“Free EX4 decompiler”

or:

“Free EX4 to MQ4 converter.”

Be careful before using an unknown tool.

Potential problems include:

  • Outdated compatibility
  • Poor recovery quality
  • Incomplete source
  • Compilation errors
  • Security risks
  • Privacy concerns
  • No technical support

If the indicator contains proprietary calculations or commercial trading logic, think carefully before uploading it to an unknown online service.

Online EX4 to MQ4 Converter for Indicators

An online converter may appear convenient:

Upload EX4 → Convert → Download MQ4

But source-code recovery is not necessarily a one-click conversion.

Before submitting a valuable indicator, investigate:

  • Who operates the service?
  • How is the EX4 stored?
  • Is the file deleted afterward?
  • Who has access?
  • Does the service explain its limitations?
  • Is technical support available?
  • Does it actually support custom indicators?

The security of the indicator can be just as important as the recovery result.

Professional EX4 to MQ4 Indicator Recovery

A professional service should ideally use a structured workflow.

File Assessment

The indicator is examined before recovery begins.

Technical Analysis

The provider identifies relevant characteristics and potential complications.

Source-Code Recovery

The service attempts to recover or reconstruct MQL4 source where technically possible.

Compilation

The recovered source is compiled to identify problems.

Functional Testing

The resulting indicator is tested against the original EX4.

Delivery

The agreed source and supporting files are provided.

Support

The provider can address reasonable technical issues discovered after delivery.

What Should You Send to an EX4 Indicator Recovery Service?

To make an assessment easier, provide:

The Original EX4

Send the original file whenever possible.

Indicator Name

Tell the provider what the indicator is called.

MT4 Build

If known, provide the MT4 build where the indicator was originally used.

Additional Files

Include relevant dependencies if you are authorized to provide them.

These could include:

  • DLLs
  • EX4 libraries
  • Other indicators
  • Configuration files
  • Resources

Your Goal

Explain what you want to do with the recovered source.

For example:

“I need the MQ4 source so I can modify the indicator’s alerts.”

This gives the provider useful context.

How to Test a Recovered MT4 Indicator

Testing should be performed before relying on recovered source code.

1. Compare Historical Signals

Load the recovered indicator and compare it against the original EX4.

2. Compare Indicator Values

Check whether calculations produce similar results.

3. Check Alerts

Test popup, sound or other alert functionality if applicable.

4. Check Chart Objects

Verify arrows, lines, labels and other graphical elements.

5. Test Multiple Timeframes

An indicator may behave differently depending on timeframe.

6. Test Different Symbols

Check the indicator across different instruments where appropriate.

7. Check Real-Time Behavior

Historical results alone may not reveal every issue.

How Much Does EX4 Indicator Decompilation Cost?

The price can vary significantly depending on the indicator.

Factors can include:

Factor

Possible impact

Simple indicator

Lower complexity

Large indicator

More analysis

Complex calculations

Additional reconstruction

Protected EX4

Potentially more difficult

External dependencies

Additional work

Damaged file

More investigation

Multiple indicators

Larger project

A provider should ideally assess the file before confirming the final scope and price.

How Long Does EX4 Indicator Recovery Take?

There is no universal processing time.

A simple indicator may require less work than a complex multi-component indicator.

Time can depend on:

  • Program complexity
  • Compiler characteristics
  • Protection
  • Dependencies
  • File condition
  • Required reconstruction
  • Compilation
  • Testing

A realistic assessment is better than an automatic turnaround promise.

How to Choose an EX4 Decompiler for Custom Indicators

Before hiring a provider, ask:

  1. Do you support custom MT4 indicators?
  2. Can you assess my EX4 before starting?
  3. Do you work with older and newer MT4 builds?
  4. Can you handle complex indicators?
  5. Can you analyze external dependencies?
  6. Will the recovered MQ4 be compiled?
  7. Is functional testing included?
  8. How are submitted files protected?
  9. What happens if recovery is unsuccessful?
  10. What exactly will I receive?

These questions can help you compare services more intelligently.

Red Flags to Watch For

Be cautious of providers that:

Guarantee 100% Recovery

Every EX4 is different, so absolute guarantees should be treated carefully.

Claim One-Click Conversion

A compiled EX4 is not simply converted into source code by changing its extension.

Do Not Assess the File

A provider should understand that recovery requirements can vary.

Provide No Security Information

Your indicator may contain valuable intellectual property.

Offer No Testing

A recovered MQ4 should ideally be compiled and checked.

Cannot Explain Their Process

A professional provider should be able to explain the general recovery workflow and limitations.

Legal Considerations

Before recovering source code from an EX4 indicator, make sure you have the necessary rights or authorization.

Source-code recovery can be appropriate when:

  • You own the indicator
  • You created it
  • You lost your original source
  • You commissioned its development
  • You have authorization from the copyright owner

Third-party commercial indicators may be protected by licensing agreements and intellectual-property rights.

Always review the applicable terms before proceeding.

EX4 Indicator Recovery Checklist

Before submitting your indicator:

  • I have the original EX4.
  • I know it is a custom MT4 indicator.
  • I have backed up the original file.
  • I know the MT4 build if available.
  • I have identified any dependencies.
  • I have confirmed my authorization to analyze it.
  • I understand recovery results can vary.
  • I have checked the provider’s security practices.
  • I understand the price and delivery terms.
  • I will test the recovered MQ4 before relying on it.

Frequently Asked Questions

Can an EX4 indicator be converted to MQ4?

An EX4 indicator cannot be converted into MQ4 simply by changing the file extension. Specialized source-code recovery or reconstruction may be possible depending on the individual EX4.

What is an EX4 indicator decompiler?

It is a tool or technical service intended to analyze a compiled MT4 indicator and attempt to recover or reconstruct usable MQL4 source code.

Can I recover the original indicator source code?

Potentially, but results vary. The original source may not be reproduced exactly.

Can custom indicator calculations be recovered?

Depending on the file, parts of the indicator’s logic and calculations may be recoverable or reconstructable.

Can indicator alerts be recovered?

They may be recoverable, but the result depends on the individual program and its implementation.

Can indicator buffers be recovered?

Buffer-related functionality may be analyzed and reconstructed, but it should be tested against the original indicator.

Does the MT4 build matter?

Yes. Changes to MQL4 and the EX4 environment over different MetaTrader 4 generations can affect technical analysis and compatibility.

Will recovered MQ4 compile immediately?

Not necessarily. Recovered source may require cleanup, corrections, missing dependencies or compatibility adjustments before successful compilation.

Should I test recovered indicator source?

Yes. Compare the recovered indicator against the original EX4 using historical and real-time testing before relying on its signals.

Final Thoughts

Decompiling custom MT4 indicators is a specialized source-code recovery task rather than a simple file conversion.

A custom indicator is normally developed as MQL4 source code and compiled into an EX4 executable. MetaTrader’s documentation confirms that custom indicators are compiled into EX4 files for use in the terminal.

If you have an EX4 indicator but no MQ4 source, professional EX4 to MQ4 source-code recovery may provide a practical path toward recovering usable code, depending on the characteristics of the file.

The most important factors are the individual EX4’s compiler characteristics, complexity, protection, dependencies and condition.

Before choosing a service, ask for a file assessment, understand the recovery limitations, verify your authorization to analyze the indicator, and confirm that compilation and testing are part of the process where required.

If you have a custom MT4 indicator in EX4 format and need professional EX4 source-code recovery for indicators, start with an individual technical assessment to determine what can realistically be recovered.