You spent months building your Expert Advisor. You tested it, refined it, and finally started selling it. Then one day you find your EA running on a forum for free, shared by a customer who decided everyone else should get it at no cost.
This happens to almost every EA developer without license protection. Every shared copy is a recurring customer you will never have. This guide covers exactly how to stop it.
MetaTrader 4 compiles Expert Advisors into .ex4 files. While compiled, they are not tied to any account or machine. Once a customer has your file, they can share it with anyone and it runs on any platform.
The built-in MT4 protection options are weak. You can hardcode account numbers in your MQL4 code, but this is trivially bypassed by a decompiler. What you need is a server-side license check where the EA calls a remote API on every startup and your server decides whether to allow it.
A customer cannot copy your .ex4 file and share it. The EA refuses to run on any account without an active license. You can add licenses when customers pay and revoke them instantly if they chargeback.
Because the check happens on your server, you can revoke access at any time even after the customer has your file. No decompiler can bypass a server-side check.
Sign up at mtlicense.com. You get an API key and dashboard access immediately with no credit card required.
Click New Product, name your EA, and copy the Product ID that is generated.
Download LicenseManager4.mqh and place it in your MetaEditor includes folder. Add these two lines:
Compile your EA. The license check is now live.
When a customer pays, add their account number in your dashboard. They run your EA immediately. To revoke, one click and they are done.
Yes, the EA needs to reach the MTLicense API on startup. Most traders on VPS or live accounts have permanent internet so this is rarely an issue.
No. The check only happens in OnInit() once when the EA starts. The API call completes in under 200ms and has zero effect on trading performance.
MTLicense starts at $19/month. If your EA sells for $50/month and even one pirated copy becomes a paying customer, you have covered your cost many times over.
Setup takes under 10 minutes. Free to start, no credit card required.
Protect My EA — Start Free →