How to Use PMEX AI Desk
What is PMEX AI Desk?
PMEX AI Desk is a trading desk that sits beside your existing MetaTrader 5 account at an SECP-licensed PMEX broker.
Non-custodial guarantee. Your funds stay at your broker. Your MT5 master password stays in your MT5 terminal. PMEX AI Desk never asks for that password, never stores it, and never withdraws or holds your money. The Expert Advisor on your chart is the only program that talks to the broker. The website decides whether a new trade is allowed and can tell the Expert Advisor to stop. It cannot move your balance by itself.
You install a small Expert Advisor called the Cloud Bridge. It sends your account health to the desk and asks permission before each new entry. You choose the rules. You can turn the bridge off by removing the Expert Advisor or by closing the Allow WebRequest permission in MT5.
Account Creation & Dashboard Access
This website account is separate from your broker. The password you create here never logs into MetaTrader.
Register
- Open the site. On a Mac running the app locally, that address is
http://localhost:3000. - Choose Register.
- Enter your name, your email, and a password of at least 8 characters. Use a different password from the one at your broker.
- Submit the form. When it succeeds, you are signed in and the browser opens the dashboard.
If the email is already registered, the form says so. Choose Sign in instead. If PostgreSQL is not running, the form says the database is not reachable. Start the database, then try again.
Sign in and sign out
- Choose Sign in.
- Enter the same email and website password.
- A correct pair opens the dashboard. A wrong pair shows “Invalid email or password.” The message does not say which one was wrong.
- Choose Log out in the dashboard when you are finished on this browser. That clears the session cookie.
Open this manual
Choose How to Use in the dashboard sidebar, or open /how-to-use directly. You can read it before you sign in. The page shows this document. After the manual file is updated, reload the page to see the new text.
What you can do on the dashboard today
Overview shows each trading account, whether MT5 has checked in during the last 30 seconds, and the emergency stop. Accounts is where you add an MT5 login and edit risk rules. Bridge Keys is where you generate the API key and HMAC secret. Risk & AI is the news shield, the gatekeeper, the dry-run simulator, and the decision log.
Quick Start Overview
Complete these four steps in order.
1. Create Account
Create the website account described in Account Creation & Dashboard Access. The password is for PMEX AI Desk only. It is not your broker password. After you sign in, you land on the dashboard. No broker connection exists until you finish the next steps.
2. Generate Bridge API Key
Add the trading account first, then follow Generating and Securing Bridge API Keys below. The key belongs to that one MT5 login. Heartbeats from a different login are not accepted because the key is not issued for them.
3. Attach MQL5 EA in MT5
Follow MetaTrader 5 Setup & Strategy Tester Guide below. Download the four source files from Bridge Keys, compile them, allow the desk URL, paste InpApiKey and InpHmacSecret, and confirm the dashboard shows Bridge: Live.
The bridge must stay on a chart while you want protection. Closing MT5 stops the bridge.
4. Configure Equity Guardian & AI Rules
Open Accounts and save the risk rule for the MT5 login before you rely on the bridge for entries. Then open Risk & AI and save the gatekeeper mode. The fields are described below.
The next signal check uses the saved rules. You do not restart the Expert Advisor for a rule change.
Adding a PMEX Trading Account and Configuring Risk Rules
- Sign in and open Accounts.
- Enter an account label, the broker name (for example Standard Capital), the MT5 login number shown at the top of MetaTrader, Live or Demo, the currency (PKR unless your account is different), and the balance you want the desk to start from.
- Choose Add trading account. A new account starts with rules calibrated for a PKR 50,000 Standard Capital micro account: symbols
GO1OZ-FE27andCRUDE10-JA27, maximum volume1lot,2open positions, a daily loss limit of2,500PKR (also5%), and1.5%risk per trade. News shield and rollover guard are on. Minimum AI confidence starts at68(0.68). - On the same page, edit that account’s rules. Saving replaces the defaults for that account only.
- Max daily loss % is the Equity Guardian. The first heartbeat of each UTC day sets that day’s starting equity. If equity later falls by this percent from that start, the kill switch turns on by itself. The reason stored is
EQUITY_GUARDIAN_DAILY_LOSS_LIMIT. - Daily loss limit (PKR) is the currency cap. On a 50,000 PKR account, 2,500 PKR is the same 5% limit. Clear it only if you want the percent alone.
- Max volume (lots) denies a new entry above that lot size.
- Max risk per trade % denies an entry whose stop would lose more than that percent of equity, once the bridge has sent the symbol’s tick size and tick value.
- Max open positions stops a new entry when that many positions are already open.
- Max spread points denies an entry when the live spread is wider than this number. A spread equal to the limit is still allowed.
- Allowed symbols is a comma-separated list.
GO1OZ-FE27matches that contract. A shorter token such asEURUSDalso matches a name such asEURUSD JA27. - Leave News shield, Rollover guard, and, if you want it, Islamic session only on. Those switches are enforced on the next signal check. The news buffer is in minutes. The Islamic switch blocks new entries from 21:30 to 23:30 UTC (02:30 to 04:30 PKT).
- Max daily loss % is the Equity Guardian. The first heartbeat of each UTC day sets that day’s starting equity. If equity later falls by this percent from that start, the kill switch turns on by itself. The reason stored is
- Choose Save risk rules.
The website still cannot place or close a broker order by itself. The Expert Advisor on your chart is what talks to the broker.
Generating and Securing Bridge API Keys
- Open Bridge Keys.
- Choose the trading account and a label you will recognize, such as MacBook MT5 Terminal.
- Choose Generate key pair.
- Copy the API Key, the HMAC Secret, and the MQL5 input block before you leave the page. The secret is not shown again. A reload clears it.
- Paste those values only into the Expert Advisor inputs on your own MetaTrader. Do not email them or put them in a shared screenshot.
- If a laptop is lost or you think the secret was copied, choose Revoke on that key. Generate a new pair and paste it into MT5. The old key stops working immediately.
The API key starts with pmx_live_. The desk stores only a hash of it. The HMAC secret is stored encrypted so the desk can check X-Signature. Neither value is your MT5 password.
On the one-time reveal, the copy block uses the Expert Advisor input names: InpServerUrl, InpApiKey, and InpHmacSecret.
MetaTrader 5 Setup & Strategy Tester Guide
The Expert Advisor is PMEX_AI_Bridge. It runs in two modes. On a live or demo chart it signs heartbeats, asks the desk before each new strategy entry, and reports fills. In the Strategy Tester it skips every web call and applies the local spread, daily-loss, and reward-to-risk rules on historical prices.
1. Copy the folder into Experts
Signed-in users can download each file from Bridge Keys:
PMEX_AI_Bridge.mq5HmacAuth.mqhBridgeClient.mqhStrategyAndRisk.mqh
Keep all four files inside one folder named PMEX_AI_Bridge. MetaEditor compiles the .mq5 only when the three .mqh files sit beside it.
The reliable way to find the folder on either system is File → Open Data Folder in MetaTrader 5. Open MQL5, then Experts, and paste PMEX_AI_Bridge there.
Typical locations:
- macOS (MetaQuotes data folder):
~/Library/Application Support/MetaQuotes/Terminal/<terminal-id>/MQL5/Experts/ - macOS (Wine build): open the data folder from the terminal. It is usually under
~/Library/Application Support/net.metaquotes.wine.metatrader5/drive_c/users/<name>/AppData/Roaming/MetaQuotes/Terminal/<terminal-id>/MQL5/Experts/ - Windows:
%APPDATA%\MetaQuotes\Terminal\<terminal-id>\MQL5\Experts\
<terminal-id> is a long hexadecimal folder name MetaTrader creates. If several folders exist, use the one File → Open Data Folder opens.
2. Compile
- In MetaTrader, press F4 to open MetaEditor. You can also use Tools → MetaQuotes Language Editor.
- In the Navigator, open
Experts → PMEX_AI_Bridge → PMEX_AI_Bridge.mq5. - Press F7 (Compile).
- The Toolbox must say 0 error(s). Warnings about unused parameters, if any, do not block the compile.
- A successful compile writes
PMEX_AI_Bridge.ex5next to the source. Leave that compiled file on your computer. Do not upload it to the website.
If MetaEditor cannot find Trade.mqh, you are compiling outside the terminal data folder. Move the folder under MQL5/Experts and compile again.
3. Allow the desk URL and turn on Algo Trading
- In MetaTrader choose Tools → Options → Expert Advisors.
- Tick Allow algorithmic trading.
- Tick Allow WebRequest for listed URL.
- Add one line for the desk you are using:
- Local testing:
http://localhost:3000 - Production desk:
https://pmex.multiaitools.com
- Local testing:
- Click OK.
localhostand127.0.0.1are different addresses. Add the one you paste intoInpServerUrl. - On the toolbar, click Algo Trading until the button is active. On older builds the label is AutoTrading.
4. Paste the key and confirm the desk is live
- Open a chart for the PMEX symbol you trade.
- In the Navigator, drag PMEX_AI_Bridge onto that chart.
- On the Common tab, tick Allow Algo Trading.
- On the Inputs tab, paste:
InpServerUrl—http://localhost:3000locally, orhttps://pmex.multiaitools.comin production. No path after the host.InpApiKey— the API key from Bridge Keys.InpHmacSecret— the HMAC secret from the same one-time reveal.
- Leave
InpHeartbeatSecondsat 5 unless you have a reason to change it. LeaveInpEnableAutoTradingon if you want the built-in EMA pullback engine to request entries. Turn it off to run in monitor mode: the EA still syncs equity and reports manual or other-EA fills on this chart, and it does not open strategy orders. - Click OK.
- The top-left chart comment should read Mode: LIVE CLOUD and Bridge Link: CONNECTED. On the website Overview, the same account should show Bridge: Live within about 30 seconds.
- If the comment stays OFFLINE, open the Experts log. Error 4060 or 4014 means the URL is not allowed. Error 5203 means MetaTrader cannot reach the desk. Confirm the desk is running and the URL matches
InpServerUrl.
The EA signs each request as v1:{millisecond timestamp}:POST:{path}:{sha256 of the body}. Your computer clock needs to be within one minute of the desk.
5. Run an offline backtest
- Open the Strategy Tester with Ctrl+R on Windows or Cmd+R on macOS. The menu path is View → Strategy Tester.
- Select Expert PMEX_AI_Bridge, the PMEX symbol, the timeframe, and a date range that your broker history covers.
- Modelling can be Every tick or 1 minute OHLC. The signal itself is evaluated once per closed bar of
InpTimeframe(M15 unless you change it). - In the inputs you can leave the API key and HMAC secret empty. Tester mode does not call the website.
- Press Start.
- The chart comment should read Mode: STRATEGY TESTER and Bridge Link: OFFLINE. The EA still enforces
InpLocalMaxSpreadPoints(default 50),InpLocalMaxDailyLossPct(default 2%), and the ATR stop withInpRiskReward(default 2.0). It sends every order with a broker stop and target, then moves the stop to break-even at 1.0R and trails it after 1.5R whenInpEnableTrailingis on.
A tester run does not update Bridge: Live on the website. That badge is only for a chart attached outside the tester.
Using the Mobile Emergency Kill-Switch
- Open Overview on your phone or computer while you are signed in.
- Find the account card. Emergency stop turns the kill switch on and records the reason “Manual mobile pause”. The next signal check is denied with
KILL_SWITCH_ACTIVE. - Resume trading turns it off, clears the stored reason, and sets the day’s starting equity to the equity on the account. Daily PnL returns to zero. New entries are still checked against spread, symbols, position count, and the daily loss rule, measured from this new start.
- If the Equity Guardian turned the switch on, resume only after you have looked at the account. The next heartbeat does not re-apply the loss that already stopped the day. A new loss from the resumed equity can turn the switch on again.
The button does not close positions inside this website. It tells the bridge, on the next heartbeat, that new risk is not allowed. Closing positions still happens in your MT5 terminal.
Setting up Telegram Trade and Kill-Switch Alerts
Telegram alerts are optional and belong to one trading account. The desk sends a message when a trade opens, when a trade closes, when the Equity Guardian turns the kill switch on, and when you turn that switch on or off yourself. A Telegram outage does not stop MetaTrader from reporting the trade.
- In Telegram, open
@BotFather, choose/newbot, and copy the bot token. The token looks like a number, a colon, and a long string. - Open a chat with that bot and send it any message, such as
hello. - In a browser, open
https://api.telegram.org/bot<your-token>/getUpdatesand copy thechat.idnumber from the reply. That is the chat ID. Close the tab when you have it. Do not share the token URL. - On the desk, open Accounts, find the trading account, and tick Telegram trade and kill-switch alerts.
- Paste the bot token and the chat ID. Choose Save risk rules. The token box then says the token is saved. The desk stores it encrypted and does not show it again. Leave the token box blank on later saves to keep the saved token.
- Choose Send Test Alert. Telegram should show a PMEX AI Desk test message within a few seconds. If it does not, check that you saved first, that the bot received your
hello, and that the chat ID matchesgetUpdates.
Switching MetaTrader 5 from Local Testing to the Live Cloud
Local testing uses http://127.0.0.1:3000 or http://localhost:3000. Those two addresses are different in MetaTrader. The live desk is https://pmex.multiaitools.com.
- In MetaTrader, open Tools → Options → Expert Advisors.
- Under Allow WebRequest for listed URL, add
https://pmex.multiaitools.com. You can leave the local address in the list if you still test on this computer. - Click OK.
- Open the chart, then the EA inputs. Set
InpServerUrltohttps://pmex.multiaitools.comwith no path after the host. - Paste the API key and HMAC secret from the production Bridge Keys page. A key created on
localhostdoes not work on the live desk. - Remove the EA from the chart and attach it again. Tick Allow Algo Trading.
- The chart comment should show Mode: LIVE CLOUD and Bridge Link: CONNECTED. On the live site, Overview should show Bridge: Live within about 30 seconds.
Supported PMEX Instruments Overview
The bridge reports whatever symbol your broker uses on the chart. Rules apply per symbol.
| Market | What to select in MT5 | Notes |
|---|---|---|
| Gold | GO1OZ or MTOLA | Use the symbol your broker shows in Market Watch. These are the gold contracts this desk is built around. |
| Silver | The silver contract in your Market Watch | Use the exact name from your broker. Contract size follows that symbol. |
| Crude | The crude contract in your Market Watch | Confirm the expiry your broker is trading. See Contract Rollover Guard below. |
| Major FX | The major pair in your Market Watch | Spreads and session hours differ from metals. The gatekeeper uses the live spread from your heartbeat. |
If a symbol is not in your allow list, the gatekeeper denies new entries on it. Managing an already open position is unchanged: your broker still holds that position.
Safety Systems Explained
These four systems are the reason the Expert Advisor calls home before it trades.
AI Gatekeeper
Before a new entry, the Expert Advisor asks the desk. Spread, symbol, position count, and the daily loss rule are checked first. The gatekeeper then requires a real stop and a reward-to-risk ratio at least as high as the minimum you saved (1.2 unless you change it). A stop of zero is denied with MISSING_OR_INVALID_STOP_LOSS. A ratio that is too small is denied with INSUFFICIENT_RISK_REWARD. A wide spread combined with a ratio below 1.5 is denied with HIGH_VOLATILITY_SPREAD_TRAP.
Deterministic mode stops there. It does not call a model. Ollama asks a model on your own computer. OpenAI asks an OpenAI-compatible endpoint. The model has 3.5 seconds to answer. If it is down or too slow, the desk uses the quantitative result and marks the decision as a fallback. It does not block a trade only because the model failed to answer. If the model answers with confidence below your threshold, the reason is AI_LOW_CONFIDENCE.
Open Risk & AI, choose the account, set the mode, the minimum ratio, and the minimum AI confidence, then choose Save gatekeeper. A new account starts at 68, which is 0.68 on a 0 to 1 scale. The field uses 0 to 100.
Dry-run simulator
On the same page, Dry-run signal simulator runs those checks for a symbol, entry, stop, target, and spread you type in. It does not send an order and MetaTrader does not need to be open. The verdict shows allow or deny and the reason. The Decision audit table lists the latest signal checks and kill-switch changes from the bridge.
Economic News Shield
The desk reads the public weekly economic calendar and keeps a copy for six hours. If that download fails, it keeps using the last copy. A high-impact event in USD, EUR, GBP, JPY, or ALL inside your buffer denies a new entry with HIGH_IMPACT_NEWS_SHIELD. The badge on Risk & AI says Clear or Shield active. Refresh calendar downloads the week again.
Inject 5-min test event places a temporary high-impact USD event five minutes ahead so you can see the shield turn on. Clear test event removes it. The test event is not a real release. Open positions stay at the broker either way.
Equity Guardian
You set a maximum daily loss percent on the account. The first heartbeat of a UTC day records the incoming balance as that day’s start. If the balance is zero, the desk uses the incoming equity instead. Later heartbeats the same day compare the drop from that start. If the drop reaches your percent, or the optional currency amount, the kill switch turns on with reason EQUITY_GUARDIAN_DAILY_LOSS_LIMIT. The bridge is told to stop opening trades. Positions already open stay at the broker until you close them in MT5.
The switch stays on until you resume it on the desk. Resume clears the reason and moves the day’s start to the current equity, so Daily PnL shows zero and the next heartbeat does not immediately stop the account again. At the next UTC date, the first heartbeat starts a new day from that heartbeat’s balance before it measures drawdown. A new day does not turn the switch off by itself. If heartbeats stop, the Expert Advisor must stop opening new trades on its own.
Contract Rollover Guard
Futures-style PMEX contracts expire. The bridge can send each symbol’s expiration as Unix seconds. When Rollover guard is on and that expiration is within 48 hours, a new entry in that symbol is denied with CONTRACT_ROLLOVER_IMMINENT. The desk does not roll the position for you. You close or roll at the broker, then trade the next contract once its expiration is further out.
When Islamic session only is on, new entries are also denied from 21:30 to 23:30 UTC, which is 02:30 to 04:30 PKT. That is the daily FX rollover window, when spreads widen and swap charges are applied. The reason is ISLAMIC_SESSION_ROLLOVER_WINDOW. Leave the switch off if you want the desk to allow entries during those two hours.
Troubleshooting & FAQ
The Experts log says WebRequest error 4014
MT5 blocked the URL. Open Tools → Options → Expert Advisors, enable Allow WebRequest for listed URL, and add the desk address character for character, including http:// and the port. localhost and 127.0.0.1 are different addresses. Restart the Expert Advisor after you click OK (remove it from the chart and attach it again).
The Experts log says WebRequest is not allowed (error 4060)
Allow WebRequest for listed URL is off, or the Expert Advisor was attached before you saved the option. Enable the option, add the URL, and attach the Expert Advisor again. Algo Trading must also be on.
Heartbeats fail with "invalid signature" or "timestamp expired"
The signing secret in the Expert Advisor inputs must be the secret from key generation, with no extra spaces. Your Mac clock and the broker PC clock should be within one minute of real time. Turn on automatic date and time. Then reattach the Expert Advisor. Generating a new key is the right fix if you are unsure which secret was saved.
The desk shows the account offline
The bridge sends a heartbeat on a timer. Offline means no valid heartbeat arrived in time. Check that MT5 is open, that you are logged into the same account number you registered, that Algo Trading is on, and that the URL is allowed. A laptop sleep will mark the account offline until MT5 sends the next heartbeat.
The API key was rejected
The key was revoked, typed incorrectly, or belongs to another desk login. Generate a new key while signed into the correct website account, paste both values again, and confirm the MT5 login and server match the key.
A trade I expected was not sent
Open the decision on the desk. Common denies are: kill switch on, equity floor hit, news shield, symbol not allowed, spread wider than your limit, or the allow expired before MT5 sent the order. Fix the rule or wait for the shield to clear, then request a new check. Do not assume an old allow is still valid.
I attached the EA but AutoTrading stays off
Click Algo Trading on the MT5 toolbar until it is active, and tick Allow Algo Trading in the Expert Advisor properties. On some builds the menu label is AutoTrading. Both must allow the Expert Advisor to run.
Can PMEX AI Desk withdraw my money or see my broker password?
No. You never type the MT5 master password into this website. Orders are placed only by MetaTrader on your machine, at your broker. Deleting your bridge key stops this desk from accepting calls. It does not close the broker account.
What happens if my internet drops mid-trade?
Positions already filled stay at the broker with the stop and target MT5 accepted. The desk cannot change them until the connection returns. The Expert Advisor must not open new trades while heartbeats are failing. When the connection returns, the next heartbeat refreshes equity and the kill switch.