TradingView Alerts to MT4: Ghost Setup Guide
How to automate MetaTrader 4 from TradingView alerts: the MQL4 install path, URL whitelisting, broker symbol suffixes, lot sizing, and an honest answer on whether to move to MT5.
What You Need Before You Start
Why a Webhook Cannot Reach MT4 Directly
Every guide that promises to point a TradingView webhook straight at MetaTrader is describing something that cannot happen. A webhook is an outbound HTTP POST, and it needs an address to arrive at. MetaTrader ships no inbound HTTP listener. There is no URL that resolves to your terminal. The connection has to be made from the other side.
The EA calls out, Ghost never calls in
TradingView posts your alert to Ghost. Ghost writes the command to a queue. The bridge EA inside your MT4 runs OnTimer() every 1500 ms and asks the server whether anything is waiting for it. Nothing ever reaches into your machine.
Native OrderSend, not a bolt-on
Once the EA picks up a command it submits it with MT4 OrderSend, the same execution path a manual click takes. Stop-loss and take-profit go on with the entry, converted from price levels into pips.
The bracket anchors to your actual fill
Ghost converts your alert SL and TP into pip distances, and the EA applies those distances to the price it actually filled at, not the price on the alert. If the market moved between signal and fill, your stop distance is still the distance you asked for.
Online means recently seen
The poll doubles as a heartbeat. Ghost treats the EA as online if it has checked in within the last 20 seconds. An entry queued to an offline EA fails loudly instead of pretending to be live.
The MetaTrader terminal has to be running for the EA to execute. Tools that run without a terminal are cloud-API bridges, which talk to a broker REST API instead of a desktop platform.
Step 1 - Install the Bridge EA into MQL4
Download the MT4 build from Ghost. It is a .mq4 file. The MT5 build is a separate .mq5 and the two are not interchangeable.
In MT4 open File > Open Data Folder, then go into MQL4 > Experts. This is the MT4 tree; MT5 users want MQL5 > Experts instead.
Paste the .mq4 file into that folder and restart the terminal so it compiles, or open it in MetaEditor and press F7.
QuantCrawler-MT4-Bridge now appears under Expert Advisors in the Navigator panel.
Step 2 - Whitelist quantcrawler.com
This step is not optional and it is the single most common reason a fresh install does nothing at all. MT4 blocks outbound WebRequest calls to any host you have not explicitly allowed, and it fails silently: no popup, no order, no error in the trade log.
Open Tools > Options > Expert Advisors, tick Allow WebRequest for listed URL, and add:
https://quantcrawler.comWithout it the EA sees WebRequest error 4060 on every poll. The Ghost Bridge EA detects that case and prints the fix to the Experts tab, so check there first when a new install looks dead.
Step 3 - Connect MT4 in Ghost and Paste Your Key
In Ghost, go to Settings > Brokers > MT4 and create the connection. Ghost issues one API key for that terminal and shows it once. Copy it immediately.
Add your MT4 account number under the connection. The EA checks the account it is attached to and skips any order addressed to a different login.
Drag the EA onto any chart in MT4, paste the key into the ApiKey input, and click OK.
Enable AutoTrading. Within a few seconds the connection flips to online in Ghost. That is the poll heartbeat landing.
Step 4 - Find Your Webhook URL
Go to Ghost Dashboard > Tickers.
Create or open the ticker you want to automate (e.g. EURUSD, XAUUSD) and route it to your MT4 account.
Set the lot size on the ticker. Lots are used exactly as entered (0.01, 0.10, 1.00) and never auto-converted.
Copy the Webhook URL. It looks like: https://quantcrawler.com/api/ghost/webhook/{your-ticker-id}?secret={your-secret}
Keep this URL private. The secret in the URL is what authenticates your alerts.
Name the ticker with the plain TradingView symbol, not your broker decorated one. Pip size is computed on the symbol Ghost queues, before the EA adds its SymbolPrefix and SymbolSuffix. A trailing suffix such as EURUSDm still reads as a EURUSD pair, but a prefix in front of the pair on the Ghost side (M.EURUSD) breaks the pip calculation. That trap is explained in full in the symbol suffix guide.
Step 5 - Set Up Your TradingView Alert
Paste this payload into the TradingView alert message field. Replace sl and tp with your actual price levels. Ghost converts them into pip distances and the EA re-anchors those distances to the price it actually fills at.
In TradingView, right-click on your chart or use the Alerts tab > Create Alert.
Set your condition (indicator cross, price level, or a Pine Script strategy).
In the "Notifications" tab, enable "Webhook URL" and paste your Ghost webhook URL.
In the "Message" field, paste the JSON payload above with your own sl and tp levels.
For Pine Script strategies, use {{strategy.order.action}} as the action value. TradingView fills it in automatically.
Use "action": "close" or "exit" to flatten the position on that ticker.
What TradingView Requires On Their Side
Two TradingView rules catch people out on every broker rail, not just MT4. First, webhook alerts are only allowed when two-factor authentication is enabled on your TradingView account. With 2FA off, the webhook field will not work no matter what you paste into it. Second, alerts expire. On Essential and Plus an alert runs on a timer and stops; Premium is the first tier where an alert can be set to run indefinitely.
| Plan | Price | Webhooks | Active alerts | Alert lifetime |
|---|---|---|---|---|
| Basic (free) | Free | No | Not available | Not applicable |
| Essential | $12.95 | Yes | 20 | Alerts expire |
| Plus | $29.95 | Yes | 100 | Alerts expire |
| Premium | $59.95 | Yes | 400 | Can run indefinitely |
| Ultimate | $199.95 | Yes | 1000 | Can run indefinitely |
Prices are TradingView list rates billed annually and shown per month. Webhooks are included from Essential upward, so you do not need a higher tier to automate. You need a higher tier only if you want more concurrent alerts or alerts that never expire. Pro and Pro+ are retired tier names you will still see quoted in older guides.
Broker Symbol Suffixes: The MT4 Retail Reality
MT4 today is overwhelmingly a retail-broker platform. Exness, IC Markets, Pepperstone, XM and FP Markets between them account for most live MT4 terminals, and every one of them decorates symbol names to distinguish account types on the same server. EURUSD becomes EURUSDm, EURUSD.a, EURUSD.pro or EURUSD. depending on whose server you are on and which account type you opened.
MT4 treats a single extra character as a completely different instrument, so an order for EURUSD on a server that only lists EURUSDm is rejected with an unknown symbol error, not silently corrected. The fix is the EA SymbolPrefix and SymbolSuffix inputs: set them to match exactly what your own Market Watch shows and the EA applies them before every order. If your broker uses plain names, leave both empty.
Because decoration varies by account type as well as by broker, published broker-to-suffix tables go stale fast. Read yours off your own Market Watch. Our symbol suffix guide walks the whole taxonomy, both MT4 and MT5 error codes, and why the pip size is computed on the symbol Ghost queues, before the EA adds its own decoration.
Lot Sizes and What Gets Sent
Lots come from quantity, not contracts
The MetaTrader rail is denominated in decimal lots. Whatever you set as the ticker quantity is what the EA sends: 0.01 goes across as 0.01. Nothing is scaled, rounded up, or converted from a contract count.
Your broker volume rules still apply
If the lot size does not match the broker minimum lot or lot step, MT4 rejects it as an invalid volume and the EA reports the rejection back with the broker error text. Check the symbol contract specification and set an increment your broker accepts.
SL and TP travel as pip distances
Ghost converts your alert price levels into pips using a fixed table both ends share, so the server and the EA can never disagree on what a pip is. The EA converts back to price against its own fill.
Market orders only on this rail
There are no resting limit entries on the MetaTrader bridge. Every entry goes in as a market order at the moment the EA picks the command up.
What the MT4 Rail Does Not Do
Every one of these is a real limit, not a footnote. If any of them is a dealbreaker for your strategy, better to know now than after you have wired up an alert.
Should You Move to MT5?
The honest answer is that it depends far less on automation than most comparisons suggest. On the Ghost rail MT4 and MT5 are the same product: same bridge, same 1500 ms poll, same bracket behaviour, same lot handling, same limits. Switching terminals buys you nothing on our side. What it does change is which accounts you can get and which instruments exist.
Reason to move: account availability
Only around four prop firms still issue MT4 accounts. MT4 is now mostly a retail-broker story, and if you want a funded MetaTrader account you will almost certainly be handed MT5. That, not features, is the real forcing function.
Reason to move: instrument coverage
MT5 was built to carry exchange-traded instruments alongside forex and CFDs, so brokers list a wider set on it. If the symbol you want is not on your MT4 server, no bridge can conjure it.
Reason to stay: your EAs do not port
MQL4 and MQL5 are different languages. Any custom EA or indicator you rely on has to be rewritten, not copied. Our bridge ships as two separate builds for exactly this reason.
Reason to stay: hedging is the MT4 default
MT4 accounts always allow multiple positions on the same symbol. MT5 accounts can be netting or hedging depending on how the broker configured them, and on a netting account an opposite order reduces your existing position instead of opening a second one. Check which mode your MT5 account uses before you move a strategy across.
The short version: if your broker gave you MT4 and you trade forex or CFDs, stay where you are and automate it. Move to MT5 when you want a funded account, when the instrument you need only exists on the MT5 server, or when your broker retires the MT4 offering. Ghost covers both either way, so the migration is a broker decision rather than a tooling one. The MT5 walkthrough is here.
Ghost MT4 and MT5 Coverage
Ghost supports both MT4 and MT5 through one bridge EA with two builds. If your broker only offers MT4, Ghost runs on it.
| Tool | MT4 | MT5 | Notes |
|---|---|---|---|
| Ghost (QuantCrawler) | Yes | Yes | One bridge EA, two builds: .mq4 and .mq5 |
What Ghost includes
Ghost is $69/mo standalone, or bundled in Elite at $169/mo, with signal secrets and symbol decoration included from the start and eleven broker rails.
Ghost runs an EA in your terminal. If you need a MetaTrader position managed while your machine is off, look at cloud-API bridges that drive a broker REST API.
Frequently Asked Questions
Can TradingView send alerts to MT4?
Not directly. TradingView fires a webhook over the internet, and an MT4 terminal has no inbound listener for one to arrive at. There is physically no address to POST to. Ghost closes the gap from the other side: TradingView posts to Ghost, Ghost queues the order, and the QuantCrawler Bridge EA running inside your own MT4 polls Ghost and submits the trade natively with OrderSend.
Do I need to leave MT4 running for trades to execute?
Yes. The EA is the only thing that can reach your terminal, and it only runs while MT4 is open, the EA is attached to a chart, and AutoTrading is enabled. There is no cloud API to fall back on. Ghost considers the EA online if it has polled within the last 20 seconds. Market entries have a 20 second terminal pickup window, while close commands stay valid for 15 minutes so an open position can still be flattened once you reconnect. Traders who want the terminal up around the clock run it on a VPS.
Where does the Ghost Bridge EA go in MT4?
MT4 uses the MQL4 tree, not MQL5. In the terminal open File > Open Data Folder, then drop the .mq4 file into MQL4 > Experts and restart the terminal so it compiles, or open it in MetaEditor and press F7. The EA then appears under Expert Advisors in the Navigator panel. The MT5 build is a separate .mq5 file that goes in MQL5 > Experts. MQL4 and MQL5 are different languages and the files are not interchangeable.
Why do my MT4 orders get rejected with an unknown symbol error?
Because your broker decorates its symbol names. Retail MT4 brokers commonly ship EURUSD as EURUSDm, EURUSD.a, EURUSD.pro or similar, and MT4 treats a one-character difference as a completely different instrument: error 4106. Set the EA SymbolPrefix and SymbolSuffix inputs to match exactly what your own Market Watch shows. The full taxonomy, including why pip size is computed on the symbol Ghost queues and why a prefix on the Ghost side is the real risk, is covered in our MT4 and MT5 symbol suffix guide.
Does the MT4 rail support trailing stops or break-even?
No. There is no trailing stop and no break-even on the MT4 or MT5 rail, and Ghost has no working server-side trailing on any of its eleven broker rails. Trailing and break-even belong to your TradingView strategy: your Pine script decides when to move the stop and fires the alert, and Ghost executes what the alert says.
Can I trade futures or indices futures through the MT4 bridge?
No. The MetaTrader rail is forex and CFDs only, never futures. If you trade futures, Ghost reaches them on other rails (Tradovate, Rithmic, ProjectX and NinjaTrader 8), and those are entirely separate integrations from the MetaTrader bridge.
Should I switch from MT4 to MT5?
On the Ghost rail it changes nothing: both terminals run the same bridge with the same feature set, the same 1500 ms poll, and the same bracket behaviour. The reason to move is account availability rather than automation. Only around four prop firms still issue MT4 accounts, so MT4 today is mostly a retail-broker story, and if you want a funded MetaTrader account you will almost certainly be handed MT5. Stay on MT4 if your broker gives you MT4 and your strategy is forex or CFDs.
Continue Learning
PineConnector Alternatives →
An honest comparison, including where PineConnector still wins
MT4 and MT5 Symbol Suffixes →
Fix unknown symbol errors, error 4106 and 4756, and broker decoration
TradingView to MT5 →
The MetaTrader 5 side of the same bridge
TradingView Webhook Setup Guide →
How Ghost webhooks work and the full JSON payload reference
Lot Size Calculator →
Work out the lot size to put on your MT4 ticker
Ghost Webhook Automation →
Connect TradingView to 11 brokers
Risk Disclosure: Trading involves substantial risk of loss and is not suitable for all investors. This content is for educational purposes only and does not constitute financial advice.
Last updated: November 2026