1. Introduction
EASILY CONNECT TRADINGVIEW TO YOUR METATRADER
TradingView Subscriber is a tool from VPSTrading.net that works as a "bridge" between TradingView (chart & alert platform) and MetaTrader (EA on MT4/MT5). With this tool, you can:
- Connect TradingView to MetaTrader 4/5 and other trading platforms.
- Receive webhook alerts from TradingView via HTTP POST port 80.
- Convert webhook alert messages into trading orders on EA in MT4/MT5.
- Open trades with risk & order management configuration.
2. General Architecture
- TradingView Bridge
- Serves as the connector linking TradingView to your trading server.
- Receives messages from TradingView alerts containing
symbol, action, volume, sl and tp
- Dynamic-Link Library (DLL)
- Executed via MetaTrader Library functions: TVCopyBridge4.dll for MT4 (x86 platform) and TVCopyBridge5.dll for MT5 (x64 platform).
- Forwards messages to TradingView-Subscriber EA to process into MetaTrader orders.
- EA Subscriber on MT4/MT5
- Supports up to 18 subscribers, expandable up to 100 subscribers (contact support).
- Provides input configuration for order identification and management.
3. Workflow
- Run Bridge & EA on Trading Server.
The Bridge connects your trading server to TradingView. - TradingView Alert → Webhook
Create a TradingView alert by entering http://<IP-VPS>/webhook/your_password in the webhook URL field. - HTTP Server Receive & Forward
The running Bridge on your server will forward the alert for processing by the EA. - EA TradingView Subscriber
Handles order identification and management. Each EA instance running on MT4/5 must have a unique Subscriber ID.
4. Features & Benefits
Main Feature | Benefit |
---|---|
HTTP Webhook Receiver | No external polling needed — TradingView pushes alerts directly to your trading server. |
Bridge System | Thread-safe & lock-free message processing; supports multiple terminals. |
Auto-suffix symbol matching | Supports various pair name suffixes (.pro, .micro, .mini, etc.). |
Risk & Drawdown Management | Automatically stops trading when daily drawdown limit is reached; auto lot calculation. |
Reverse Orders & Trailing Stop | Flexible trading: reverse signals, trailing stop to breakeven. |
Multi-platform support | Single DLL supports both MT4 (x86) and MT5 (x64); future updates for cTrader & other platforms. |
5. How to Connect MetaTrader with TradingView
- Run the Bridge application
Set the password in the config file tvbridge.cfg. Then run TVHttpBridge.exe. This app must always stay running to maintain connection with TradingView. - Install DLL and Attach EA
The provided .dll files are for x86 (MT4) and x64 (MT5) platforms. Copy the DLL files intoMQL4/Libraries
(for MT4) orMQL5/Libraries
(for MT5). Copy the TradingView-Subscriber EA files intoMQL4/Experts
(for MT4) orMQL5/Experts
(for MT5). Attach to chart, set the input configuration, then click OK.
Attach the EA on M1 EURUSD chart for faster ticks, or on BTCUSD M1 if your TradingView alert is for BTCUSD — so ticks continue even on weekends.
You can run multiple terminals (both MT4 and MT5) as long as each EA uses a unique Subscriber ID.
- Create Alert in PineScript
Addalert(json,...)
in your PineScript; when creating alert, select “Any alert() function call” and set Webhook URL tohttp://<IP-VPS>/webhook/your_password
.To send JSON alerts to the DLL, configure your PineScript code as follows:
// example buySignal
sl_buy = low[1]
json = '{"symbol":"' + syminfo.ticker + '","action":"BUY","volume":0,"sl":' + str.tostring(sl_buy,"#.#####") + ',"tp":0}'
alert(json, alert.freq_once_per_bar)
// example sellSignal
sl_sell = high[1]
json = '{"symbol":"' + syminfo.ticker + '","action":"SELL","volume":0,"sl":' + str.tostring(sl_sell,"#.#####") + ',"tp":0}'
alert(json, alert.freq_once_per_bar)The required variables you must send are symbol, action, volume, sl, and tp.
Some indicators may only need to send a simple format like this in the message:
{ "symbol":"BTCUSD", "action":"SELL", "volume":0, "sl":107000.00, "tp":0 }
- Test & Monitor
Test first using a demo account to ensure everything works correctly before connecting TradingView to your live MetaTrader account.
Conclusion
With TradingView Subscriber, you get real-time, lock-free, and multi-subscriber integration between TradingView and MetaTrader. This tool makes it easy to implement auto-trading directly from PineScript TradingView signals without relying on external services, while providing built-in risk management and highly flexible configuration options.