Pick the sales channel first
The channel decides whether a licensing service is even allowed.
| Channel | Who takes payment | Licensing | Can Clavem be used? |
|---|---|---|---|
| MQL5 Market | MetaQuotes | The Market’s own activations | No: third-party license control is banned in Market products |
| Your own site | You, through Stripe | Yours | Yes, for expert advisors and scripts |
| TradingView invite-only scripts | You, outside TradingView | TradingView’s invite list | Not for access control; see below |
| A standalone bot or desktop app | You, through Stripe | Yours | Yes, as for any desktop app |
On the MQL5 Market, MetaQuotes’ help says the minimum price is 30 USD and “the Market service commission of 20% is charged on purchases”, and the seller sets the number of available activations when listing. The Market’s rules also say the seller “shall not integrate and apply any third-party sales, accounting, license control and update management systems (including the ones using WebRequest features) in Products”. So a Market product cannot call Clavem. If the Market’s reach and handling is worth 20% and you accept its activation system, use it, and treat this page as the guide to the other channels.
MetaTrader: the technical limits
For products you sell yourself, an expert advisor can check a key with WebRequest. Three conditions, from the MQL5 reference:
- The server address must be added to the allowed URLs in the “Expert Advisors” tab of the terminal options. Tell buyers to add
https://clavem.ioin your install guide, with a screenshot, or every check fails silently. WebRequestis synchronous. It is not available from indicators, because indicators share one thread per symbol, and returns error 4014 if you try. It works from expert advisors and scripts.- That means an indicator cannot call the License API directly. Options: ship the indicator with an expert advisor companion that does the check and passes the result; or sell indicators on a different basis, such as a signed license file verified inside the indicator. This page could not confirm built-in Ed25519 verification in MQL5, so that route may need your own implementation.
Bind to the account, not the computer
Traders think in accounts: a live account and a demo, at a broker, with a login number. A computer is incidental, because the bot moves between a laptop and a VPS. Use the account as the unit:
instance_name: a readable label, such asLive 1234567 @ BrokerName. It can be up to 120 characters.fingerprint: a SHA-256 hash of the broker server name and the account number, up to 200 characters. Activating again with the same fingerprint returns the same seat, so moving the bot to a new VPS, which has the same account, costs nothing.- Device limit: the number of accounts you allow, usually 1 live plus 1 or 2 demo, or more for a prop trader with several. Decide whether demo accounts count against the limit; if they do, a buyer who tests on a demo account first uses a seat early.
A new VPS with the same account reuses the seat. A new account takes another. When a trader closes an account, they remove the old one on the device page.
Never close a trade because of a license error
An advisor that manages open positions is not a desktop app. A failed check at the wrong moment can leave a position unmanaged. Define what the product does when a check cannot be completed or fails:
| Situation | Suggested behavior |
|---|---|
| Valid token, or a fresh answer | Trade normally |
Cannot reach Clavem, token within refresh_by |
Trade normally |
Past refresh_by, no connection |
Keep managing open positions; stop opening new ones after a grace period |
valid: false, expired or disabled |
Stop opening new positions and say why; keep managing and closing open ones |
Stopping new entries is a defensible restriction. Abandoning open trades is a liability for you and a loss for the buyer. Check on a timer, not on every tick. The License API allows 60 requests a minute per key.
TradingView
TradingView hosts Pine Script and controls access to invite-only scripts itself. Its Vendor Requirements say that if you offer access to invite-only scripts you are a vendor, and that paid access applies to public invite-only scripts, with transactions between users and vendors. They also say “do not sell access to private scripts”. The documented way for a Pine script to send data out is an alert with a webhook; checking for this page turned up no official way for a script to call an arbitrary server.
So a Clavem key cannot grant or remove TradingView access. You could use Stripe and Clavem to take payment and keep records, and manage the invite list on TradingView by hand. Read TradingView’s rules before you build a business around that.
Compliance
Rules on selling trading signals, automated strategies and tools differ by country, and some activities are regulated. This is general information, not legal or financial advice. Ask a professional before you sell, and do not promise returns.
Recommended setup
| Setting | Suggested value | Why |
|---|---|---|
| License type | Monthly or annual subscription, or one-time per strategy version | Strategies need maintenance and updates |
| Device limit | 1 live plus 1 or 2 demo accounts | The account is the unit |
| Trial | A demo-account-only build, or 7 days | No money at risk while evaluating |
| Updates | Releases endpoint, files labelled mt4 and mt5 |
Buyers download the right build |
Doing this with Clavem
Create a product, connect Stripe, map the price. A buyer gets a key and an order page with the .ex5 or .ex4 file. The expert advisor activates once per account and validates on a timer. The C++ guide shows the call structure that MQL5 resembles, and the offline page explains the token for a build that verifies it locally.
Guides to follow
Questions
Can I use my own license server in a product sold on the MQL5 Market?
No. The Market rules say the seller shall not integrate and apply any third-party sales, accounting, license control and update management systems in products, including ones using WebRequest. The Market has its own activation system, with the number of activations set when you list the product.
Can an MQL5 indicator call the License API?
Not through WebRequest. The MQL5 reference says WebRequest is not available from indicators and returns error 4014; it works from expert advisors and scripts, and the user must add the server address to the allowed URL list in the terminal options.