A lightweight and reliable HWID-based device fingerprint generator for MetaTrader 5, designed to help developers protect paid indicators, EAs, and scripts.
This tool collects stable terminal and account identifiers, combines them into a normalized machine signature, and produces a SHA-256 license code without using any external DLLs.
Ideal for sellers who need per-user licensing, hardware locking, and simple offline verification inside their MQL5 products.
- Generates a unique device fingerprint from stable MT5 properties
- Produces a SHA-256 hash for licensing (no external dependencies)
- Works fully inside MetaTrader 5 (pure MQL5 implementation)
- Zero DLL imports, fully compatible with MetaTrader Market rules
- Easy integration with commercial indicators and EAs
- Clean, readable, well-structured code
- Includes raw machine ID + final hashed license code
- Suitable for offline licensing workflows
This tool is commonly used for:
- Selling MT5 indicators that must run only on specific accounts or machines
- Verifying customers before delivering the main product
- Reinforcing anti-piracy measures in commercial EAs
- Binding licenses to client hardware or trading account
- Allowing manual approval of each client via hashed code
- The user installs the fingerprint indicator.
- The indicator collects a set of non-changing identifiers:
- Account login
- Broker server
- Terminal company
- Terminal paths
- Common data path
- The concatenated string is hashed using MT5's built-in
CryptEncodewith CRYPT_HASH_SHA256. - The user sends the hash to the seller.
- The seller embeds this hash inside the final product (indicator/EA).
- The main indicator checks the customer’s hardware hash at runtime and stops execution if not authorized.
When the indicator runs, it displays something like:
Your License Code: 3A9F1E3C77D50D0E25F0A53BD4E21D7DF917B8F9EC57E3E82890F2C542A19F5C
This code can then be stored inside your licensed product.
- Clone the repository:
git clone https://github.com/BaseMax/mt5-device-fingerprint-tool
- Copy
mt5-device-fingerprint-tool.mq5(or the provided file) into:
MQL5/Indicators/
- Compile the file in MetaEditor.
- Attach the indicator to any chart inside MetaTrader 5.
The core functions include:
-
GetMachineID()
Collects stable system/account identifiers. -
SHA256_hex_from_string()
Generates a SHA-256 hex hash using MT5's built-in cryptography. -
CharArrayToHex()
Utility to convert raw bytes to an uppercase hex string.
The generated hash is cryptographically strong and machine-specific.
Inside your commercial product, implement a check similar to:
string AllowedHash = "PUT_CUSTOMER_HASH_HERE";
if (DeviceHash != AllowedHash)
{
Alert("License error – unauthorized machine.");
return INIT_FAILED;
}You may also close the chart or stop execution depending on your protection strategy.
- Add optional obfuscation for machine ID
- Add SHA-1 and MD5 fallback options
- Add server-based online activation mode
- Provide a full licensing framework (client + server)
- Add ready-to-use LicensedIndicator.mq5 template
Contributions, feature requests, and pull requests are welcome. If you implement new fingerprint parameters or stronger protection layers, feel free to submit them.
Copyright (c) 2025
MIT License
See the LICENSE file for details.
Seyyed Ali Mohammadiyeh (Max Base)
GitHub: https://github.com/BaseMax
If you find this project useful, consider starring the repository to support development.