1. Use the Windows integrator (recommended)

From your product manager, download the Windows integrator and that product's configuration file. Select an editable MQ4/MQ5 EA and your local MetaEditor. The tool creates a separate licensed source copy, compiles it locally, and returns an EX4/EX5. Your source never goes to Lorghic.

Windows integrator

2. Or integrate the module manually

For unusual EA frameworks or custom safety behavior, place the matching module beside your EA source or inside the terminal Include folder.

MT4 moduleMT4 exampleMT5 moduleMT5 example

3. Configure the product identity

#include "LorghicLicense.mqh"

CLorghicLicense License;
License.Configure("your-product-page-name", "1.0.0", LicenseKey);

Use the product page name only—not the full marketplace URL. The version must exactly match the approved MT4 or MT5 upload. Never put a marketplace server secret in an EA.

4. Activate and refresh safely

  1. Call Activate() in OnInit() before opening trades.
  2. Call EnsureValid(true) from a timer every 30–60 minutes, never on every tick.
  3. Allow https://market.lorghic.com under MetaTrader Tools → Options → Expert Advisors → WebRequest.
  4. Keep position-closing and risk-protection logic working during temporary network failures.

5. Understand bindings and grace time

The marketplace can bind each activation slot to a trading account, a private terminal-installation ID, or both. The module creates a privacy-safe installation ID automatically. A successful validation grants up to six hours of bounded grace during a timeout or server error; expiry, revocation, suspension, mismatched bindings and unapproved versions fail closed.