Troubleshooting¶
Start with two places: the Experts tab at the bottom of MetaTrader 5 (what the EA did and why), and the Signal History in the dashboard (what happened to each alert).
The EA does not connect¶
When the EA starts, the Experts tab should show License Confirmed by Server. If it shows
License not accepted on connection: <reason>. Shutting down. or another error instead:
| Reason or message | What to do |
|---|---|
LIC_NOT_FOUND |
The license input is wrong. Copy the id from My Licenses (the default 123456789 is only a placeholder). |
LIC_EXPIRED |
The license has expired. Extend it from My Licenses. |
LIC_IN_USE |
The license is tied to another MetaTrader account or installation. See Moving a license. |
DB_ERROR or ERR_INTERNAL |
A problem on our side. Attach the EA again in a few minutes. |
Failed to get initial response from server or an ERROR: WinHttp... line |
The EA could not reach our servers. Check the internet connection and any firewall or antivirus that blocks MetaTrader. |
| The EA does not start, or MetaTrader says DLL calls are not allowed | Attach the EA again and tick Allow DLL imports in its Dependencies tab. |
In all these cases the EA removes itself from the chart. Once the problem is solved, attach it again: the EA only retries by itself after it has been connected once.
You do not need to add our address to Tools > Options > Expert Advisors > Allow WebRequest: the EA does not use WebRequest.
Signals show "Not delivered"¶
Not delivered means no EA was connected for the license when the alert arrived. The signal is not kept and is not executed later. Check, in this order:
- Is MetaTrader running? The computer or VPS must be on and not asleep, and MetaTrader open. The EA cannot receive signals while MetaTrader is closed.
- Is the EA still on the chart? Look at the top right corner of the chart. An EA removes itself when its license is refused or expires, and versions older than 1.39 also after a failed reconnection.
- Is it connected? On My Licenses the EA column should say Connected. Send a test signal to check the whole path.
- Is the alert for the right license? The license id at the start of the alert must be the one entered in this EA's inputs.
To execute a signal that was not delivered, use Retry now, keeping in mind that it trades at the current price.
The connection drops¶
EA 1.39 reconnects by itself: the Experts tab shows Connection lost... and then Reconnect attempt #1.... It tries
after 2, 5, 10 and 30 seconds, then every minute, until it is back. While it is disconnected, alerts are
Not delivered and are never executed later. When it is back, License Confirmed by Server after reconnection
appears and new signals are executed again.
If our server refuses the license while reconnecting (expired, or tied to another terminal), the EA stops and removes itself.
Versions older than 1.39 try to reconnect only once and then remove themselves from the chart. If that happens often, update to 1.39.
Nothing appears in the signal history¶
The alert did not reach us, or it did not start with one of your license ids.
- Check that the TradingView alert really fired, and that its webhook URL is exactly
https://hook.pine2trade.com/. - Check that the message starts with your license id followed by a comma, without spaces or other text before it.
- Alerts for a license id that does not exist are discarded without a trace, so a typo in the license id looks exactly like this.
Symbol names and broker suffixes¶
The symbol in the alert must be written exactly as your broker names it in Market Watch. Many brokers add a
suffix or prefix: EURUSD.pro, EURUSDm, XAUUSD.r, US30.cash. The EA does not translate names: if the broker
calls it EURUSD.pro, the alert must say EURUSD.pro.
A symbol that exists but is not shown in Market Watch is added by the EA, which waits up to 10 seconds for its
prices. A symbol that does not exist on your account ends as Error with SYMBOL_UNAVAILABLE_IN_MARKET_WATCH.
Error messages¶
When MetaTrader or the broker refuses an order, the signal history shows the reason, usually followed by a dash and a
MetaTrader error number (for example NO_MONEY- and a number). Keep the full message if you contact support.
| Message | Meaning and what to do |
|---|---|
INVALID_STOPS |
The alert has no sl= but the size is calculated from a risk (the default), or the stop-loss or take-profit is too close to the price for your broker. Add sl=, or use larger distances. |
MARKET_CLOSED |
The market of that symbol was closed. Nothing is held until it opens. |
NO_MONEY |
Not enough free margin for that size. |
INVALID_VOLUME |
The EA could not calculate a valid size, for example because the symbol's data was not available. |
AUTO_TRADING_DISABLE |
Algo trading is off: turn on the Algo Trading button and the EA's Allow Algo Trading setting. |
AUTO_TRADING_DISABLE_BY_SERVER |
Your broker does not allow algo trading on this account. Ask the broker. |
TRADE_DISABLED |
Trading is disabled for this symbol on your account. |
HEDGE_PROHIBITED |
Your account does not allow opposite positions on one symbol. Consider OneSideTrading=true. |
REQUOTE, PRICE_CHANGED, PRICE_OFF |
The price moved too fast or there was no valid price at that moment. |
LIMIT_VOLUME |
Your broker's limit on the total volume for this symbol is reached. |
SYMBOL_UNAVAILABLE_IN_MARKET_WATCH |
The symbol does not exist on your account, or had no prices within 10 seconds. See Symbol names. |
DUPLICATE_SIGNAL_IGNORED |
The EA had already executed this exact signal, so it ignored the second copy. Nothing to do. |
UNKNOWN (0) |
The command is not a Pine2Trade command: check its spelling against the Alert Syntax. |
UNKNOWN (1) |
A close or cancel command could not close or cancel at least one trade. The Experts tab shows why. |
LIC_EXPIRED |
The license had expired, so the signal was not sent. |
BUS_PUBLISH_ERROR |
Our servers could not pass the signal on. Use Retry now if you still want it. |
A trade was opened twice¶
- Two EAs are running with the same license: on two charts, an old and a new version side by side, or on two terminals. Every running copy executes every signal. Keep exactly one.
- TradingView sent the alert twice: each alert is a separate signal and is executed.
- A signal was retried after No response, although the original had been executed.
Breakeven or trailing stop does nothing¶
- The Pine2Trade Helper must be running on its own chart in the same MetaTrader terminal, with algo trading allowed. See Getting Started.
- Breakeven needs both
betrigger=andbeoffset=; trailing needs all three oftrailtrig=,traildist=andtrailstep=. The Experts tab says when trailing parameters are incomplete. - The profit is counted in pips from the entry to the bid (buys) or ask (sells), so the spread counts. Check the pip size of the symbol.
The lot size is not what I expected¶
- With
AllowRiskOverwrite=false(the default),risk=,vol=andmoney=in alerts are ignored and the size comes fromRiskPercentandsl=. risk=must be a fraction below 0.5:risk=1is ignored (writerisk=0.01for 1%).- The size is never above
MaxLotsand never below the symbol's minimum volume. - Distances are in pips, and a pip depends on the decimals of the symbol.
See Position size.