The Remove Comments utility lets you quickly and easily clean up your MQL5 and MQL4 code by removing all comments, extra spaces, empty lines, and more with just a few clicks. This tool processes all files in your project’s root directory and subfolders, ensuring your code is ready for compilation, publishing, or sharing.

Table of contents

 Key features
 How to use
 Benefits
 Testing
 For more information
 User guide and Download

Key features

  • Supported file types: .mq5, .mq4, .mqh, .txt
  • Process multiple folders: The utility can clean up all files in the root directory and any folders two levels deep.
  • Cleans:
    • Single-line comments
    • Multiline comments
    • Empty lines
    • Extra spaces
  • Exception: The utility does not remove comments after Input Variable declarations.

By obfuscating your code, removing comments, and using encryption or other security techniques, you can significantly reduce the risk of exposing sensitive logic, algorithms, or proprietary methods.

How to use “Remove Comments”

  1. Copy your project files to:
    • Option 1: Terminal Data Folder (MetaEditor > “File”> “Open Data Folder”> Go to FILES folder).
    • Option 2: Common Data Folder (MetaEditor > “File”> “Open Common Data Folder”> Go to FILES folder).
  2. Attach the utility to MetaTrader 5:
    • Open the Remove Comments utility in the MetaTrader 5 terminal and attach it to any chart.
    • Choose Common Data Folder [Files] or Terminal Data Folder [Files] based on where you placed your files.
  3. Select files to process:
    • Select the files and folders to process from the list.
    • Click “Remove” to clean up your selected files.
Remove comments panel

The utility remove all comments, extra spaces, and unnecessary lines from the selected project files, ensuring your source code remains safe on your local computer. At the same time, you compile, share, or publish new versions of your project.

Benefits

  • Local Security: All source code stays on your local machine and is never shared.
  • Efficiency: Cleaning up all files simultaneously with a single click saves time and effort.
  • Version Control: Regularly use the utility to prepare new versions of your project for customers or publications.
  • Speed: The process is fast, ensuring minimal disruption to your workflow.
Remove comments asks for permission

While no solution is entirely foolproof, taking these precautions will increase the effort and skill required for a hacker to compromise your code, thus protecting your intellectual property and maintaining a competitive edge.

MQL5 comments removed

In short, protecting your work isn’t just about writing secure code — it’s about making it difficult for others to reverse-engineer and exploit your ideas.

Testing of “Remove Comments”

The application does not work in testing mode. All features and functionality are available only when using the utility in real-time.

For more information

  • User Manual: Detailed instructions are available on my blog: Remove Comments – User Manual.
  • MT4 and MT5 Versions: A version for MetaTrader 4 is available here: MT4 Version. Find the same one for MetaTrader 5 here: MT5 Version. Both versions have identical functionality.

With Remove Comments, streamlining your MQL5/MQL4 code for publication or sharing has never been easier!

 User Manual  Download Remove Comments