> For the complete documentation index, see [llms.txt](https://help.hydravision.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.hydravision.ai/ea-configuration/getting-started/licensing-and-authentication.md).

# Licensing & Authentication

Security and flexible entitlements are key cornerstones of Hydra Cloud

Hydra Vision checks your licence with the Hydra Vision licensing service when you attach it to a chart, and then once a day while it runs. This page explains what happens at each step, what you will see on your chart, and — most importantly — what happens to your open trades if something goes wrong with your licence.

> **The one thing to know:** Hydra Vision will never abandon an open grid because of a licence problem. If your subscription lapses or the licensing server can't be reached while you have positions open, the EA keeps managing those positions to completion. It simply stops opening *new* grids until the problem is resolved.

### Private API Keys

Your **Private Key** is the only licence setting you enter. You'll find it under **Quick Start → Private Key** in the EA inputs. Generate it from your Hydra Vision dashboard and paste it in.

* One Private Key covers every MT5 account registered to your licence, up to your plan's account limit.
* Both demo and real accounts count towards that limit.
* If you regenerate your Private Key in the dashboard, the old one stops working immediately. Update every chart.

You don't need to enter anything else — the EA reads your MT5 account number and the EA version itself.

Before any MT5 accounts or services can be used, the Key should be generated and stored in a safe location for future use. If you lose the Key, it can be rolled. Rolling it every now and again is good security practice.

<figure><img src="https://2125914855-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZIaLMOKKxe4F4BdXrYzO%2Fuploads%2FMpw1cSPXd55taoYx8DgD%2FAPI%20Token%20Generate.png?alt=media&amp;token=ce34f66d-016c-4b57-a724-23bc9d58e3cb" alt=""><figcaption></figcaption></figure>

### What happens when you attach the EA

1. **The EA restores any saved grid state first.** If you're restarting with positions open, Hydra Vision knows about them before it checks the licence. This ordering matters for the "what if my licence has lapsed" scenarios below.
2. **It authenticates.** The EA sends a signed request to the licensing service and receives back your entitlement: licence name, licence type, expiry date, and the feature set your plan unlocks.
3. **It journals the result.** Open the **Experts** tab in MT5's Toolbox and you'll see a block like:

   ```
   Licence Validation
   Authenticating with Hydra Licensing API...
   ✓ Licence authenticated successfully
   Licensee: <your name>
   Licence: Fusion (Tier 2)
   Type: subscription
   Expiry: 2026.12.01 00:00
   ```
4. **It starts the daily heartbeat timer** (see below).

Changing the chart timeframe or editing the EA inputs does **not** trigger a new licence check — the session stays authenticated. Only removing and re-attaching the EA, or restarting MT5, does.

Charts on the same account share one licence check, so you won't see a separate request from every chart.

### The daily heartbeat

While the EA runs it re-authenticates once every **24 hours**. This is how the EA finds out about a renewal, a cancellation, a payment problem or an expiry without you having to restart it.

The heartbeat is quiet when everything is fine. It only speaks up when something changes:

| Situation              | What you'll see                                                                          | Effect on trading                                               |
| ---------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| Heartbeat succeeds     | Nothing (unless a status changed)                                                        | None                                                            |
| Payment past due       | One alert per session: *"Payment past due — update payment method via your dashboard"*   | **None.** Trading continues while Stripe retries payment.       |
| Cancellation scheduled | One alert per session: *"Subscription ending on — renew via your dashboard to continue"* | **None** until the end date.                                    |
| Subscription expired   | Alert + journal block: *"GRACEFUL STOP MODE INITIATED"*                                  | Enters **graceful stop mode** (below)                           |
| Server unreachable     | One alert telling you the licensing server can't be contacted                            | Open grids are never abandoned because of a connection problem. |

### Graceful stop mode

Graceful stop mode is what Hydra Vision does instead of shutting down when your entitlement to trade has ended but you have positions open.

**While in graceful stop mode the EA:**

* Keeps managing every open position exactly as before — PCL closes, trailing, stop-loss logic all continue.
* Opens **no new grids** on that chart, and adds no injected positions to open grids (**Inject on Grid Close** and **New Position on PCL Close** are paused).
* Writes a status line to the Experts journal each time a grid closes: *"Graceful stop mode: N positions remaining"*.
* **Re-checks your licence every hour** instead of every 24 hours.

**Graceful stop mode ends in one of two ways:**

1. **You fix the underlying problem** (renew your subscription; the server comes back online). The next hourly check succeeds, you see *"GRACEFUL STOP MODE CLEARED — normal trading has resumed"*, and the EA carries on as normal. No restart needed.
2. **All positions close naturally.** The EA shows *"All open positions have closed. Hydra Vision is now shutting down."* and removes itself from the chart. Fix the problem and re-attach.

{% hint style="success" %}
**Graceful stop mode survives a restart.** If your VPS reboots or you restart MT5 while in graceful stop, the EA remembers it was winding down, restores that state before it re-authenticates, and picks up where it left off. If the restart happens *after* you've renewed, the startup check clears the stop immediately.
{% endhint %}

#### Which situations trigger graceful stop?

| Trigger                                                              | When detected        | Recoverable?                                               |
| -------------------------------------------------------------------- | -------------------- | ---------------------------------------------------------- |
| Subscription expiry date passed                                      | Attach, or heartbeat | Yes — renew and the next check clears it                   |
| Subscription cancelled (server rejects the licence)                  | Attach, or heartbeat | Yes — reactivate and the next check clears it              |
| Trial expired                                                        | Attach, or heartbeat | Yes — upgrade to a paid plan                               |
| Licensing server unreachable **at attach** with positions open       | Attach only          | Yes — clears automatically when the server responds        |
| Your PC clock is badly out of sync **at attach** with positions open | Attach only          | Yes — fix the clock; clears on the next check              |
| Maximum risk threshold breached                                      | During trading       | **No** — restart the EA once you've reviewed the situation |

"Recoverable" means the EA will clear the stop on its own and resume opening grids once a licence check succeeds. Non-recoverable stops stay in place until you remove and re-attach the EA — a risk breach should never be silently undone by a licence renewal.

### When the EA *will* remove itself

There are still situations where Hydra Vision refuses to run and removes itself from the chart. These are all things only you can fix, and none of them can occur while you have a grid open unless you changed something:

<table data-search="false"><thead><tr><th>Message</th><th>Cause</th><th>Fix</th></tr></thead><tbody><tr><td><em>No Private Key has been entered</em></td><td>The Private Key input is blank</td><td>Paste your Private Key from the dashboard</td></tr><tr><td><em>Your licence token is not recognised</em></td><td>Wrong or regenerated Private Key</td><td>Copy the current key from your dashboard</td></tr><tr><td><em>This MT5 account is not on your Hydra Vision licence</em></td><td>Account not registered, or plan's account limit reached</td><td>Add the account in your dashboard, remove an unused one, or upgrade</td></tr><tr><td><em>Your Hydra Vision trial covers demo accounts and backtesting</em></td><td>A Trial licence was attached to a live (real-money) account. A trial runs on demo accounts and in the Strategy Tester, but does not trade real accounts</td><td>Use a demo account, or upgrade to a Subscription to trade live. To backtest with this account, turn on <strong>Generate a Backtest Token for this account</strong> (see <em>Strategy Tester</em> below)</td></tr><tr><td><em>Hydra requires an MT Hedging account to run</em></td><td>The MT5 account uses netting. A grid is many separate positions on one symbol, and a netting account merges them into one</td><td>Use an MT5 account with hedging (ask your broker if unsure)</td></tr><tr><td><em>Licence verification failed due to a security check error</em></td><td>The EA could not be verified</td><td>Re-download the EA from your dashboard</td></tr><tr><td><em>You are currently using a non-production version</em></td><td>This EA build has been retired</td><td>Download the latest version</td></tr><tr><td>Licensing server unreachable, <strong>no positions open</strong></td><td>Network/firewall problem and nothing to protect</td><td>See troubleshooting below, then re-attach</td></tr></tbody></table>

If the server is unreachable and you *do* have positions open, the EA enters graceful stop mode instead of removing itself (see above).

### Strategy Tester

The Strategy Tester has no internet access, so it can't authenticate online. Instead it uses a **Backtest Token** — a signed copy of your entitlement that you generate from a live chart.

**To generate a token:**

1. Attach Hydra Vision to any live chart on the account you'll backtest with.
2. Set **Quick Start → Generate a Backtest Token for this account** to `true`.
3. The EA authenticates, saves the token, shows a confirmation, and removes itself.
4. Set the input back to `false`.

The Strategy Tester finds the token automatically whenever you test on that account. You don't paste anything.

The token carries your entitlement as it was when generated. If you upgrade your plan, generate a new token.

When the Strategy Tester asks for a new token, regenerate it the same way.

### Troubleshooting FAQ

**The EA says "Could not connect to the Hydra Vision licence server" the moment I attach it.** Almost always one of three things:

1. **WebRequest isn't allowed.** In MT5 go to *Tools → Options → Expert Advisors*, tick *Allow WebRequest for listed URL*, and add `https://hydravision.ai`. Restart the EA.
2. **A firewall or antivirus is blocking MT5.** Allow `terminal64.exe` outbound HTTPS.
3. **Our service is temporarily down.** Check your dashboard for status and try again in a few minutes.

If you had positions open when this happened, the EA is in graceful stop mode managing them and will recover on its own once the connection works — you don't need to do anything to the trades.

**I renewed my subscription but the EA is still in graceful stop mode.** It re-checks every hour while in graceful stop. Wait for the next check, or remove and re-attach the EA to force an immediate one. Either way you'll see *"GRACEFUL STOP MODE CLEARED"* in the Experts journal.

**My VPS rebooted overnight and my subscription had expired. What happened to my grid?** Nothing bad. On restart the EA restores your grid state first, then authenticates, sees the expiry, and enters graceful stop mode *with full knowledge of your open positions*. They continue to be managed. Renew, and the next hourly check resumes normal trading.

**The EA says my payment is past due but it's still trading. Is that right?** Yes. Past due means Stripe is retrying your card. Trading continues throughout. Update your payment method in the dashboard to clear the alert. If the retries ultimately fail, the subscription is cancelled and the EA enters graceful stop mode at the next heartbeat.

**I'm getting "Your computer's clock appears to be out of sync".** On Windows: *Settings → Time & Language → Date & Time → Set time automatically* should be ON, then *Sync now*. On a VPS, ask your provider to enable NTP. If you had positions open, the EA has entered graceful stop mode and will recover automatically once the clock is right.

**I got "A duplicate authentication request was detected".** Wait a few seconds and re-attach. If it keeps happening, restart MT5. It is almost always a one-off after a very fast re-attach.

**Does changing timeframe or editing inputs re-authenticate?** No. The session stays authenticated. Only removing/re-attaching the EA or restarting MT5 does.

**Does every chart send its own licence request?** No. Charts on the same account share one licence check.

**Can I run Hydra Vision on a demo account?** Yes, but the demo account counts towards your plan's account limit like a real one. A Trial licence runs on demo accounts and in the Strategy Tester; trading a live account needs a Subscription.

**Why did the EA remove itself immediately after showing "Token Generated"?** That's the Backtest Token flow working correctly. Set *Generate a Backtest Token* back to `false` and re-attach for live trading.

**Where do I see what the licence check found?** MT5 Toolbox → **Experts** tab. Every authentication, heartbeat status change, graceful stop entry and exit is journaled there with a timestamp.

**I've entered graceful stop mode for a risk breach. My licence is fine. Why won't it resume?** By design. A risk stop is never cleared by a licence check — it needs a human to look at what happened. Review the trades, then remove and re-attach the EA.
