It feels like ages since I last updated this blog. After more than 16 years, it often just gets extended without new content, haha. Today is Friday, June 20, 2025, a good day, and I suddenly felt like adding content to this blog again.
This time, I want to discuss the trading world, specifically about TradingView and how to connect TradingView alerts to MetaTrader, both MT4 and MT5, to use them as trading signals. I’ve noticed many great TradingView indicators popping up on TikTok dashboards, which provide clearer information or trading analysis. Since I subscribe to TradingView Premium, I thought about utilizing one of its Webhook alert features.
To connect TradingView to MT4 or MT5, there are several tools you need to prepare:
- A TradingView account with Essentials package or higher. Create account www.tradingview.com if you dont have it.
- An indicator or strategy in TradingView selected as an alert to be used as a signal
- A trading server that must be online 24/7
- A bridge application to connect TradingView with the trading server and MetaTrader running on the server
- An Expert Advisor (EA) for MT4 or MT5 that will receive alerts and convert them into trading orders
About TradingView Webhook Notifications…
The Webhook alert feature in TradingView is only available in the paid Essentials package and above. I chose Premium because the alert duration in Premium has no expiration limit. The Essentials and Plus packages are lower-tier paid packages that have alert durations of only 2 months. This can be a hassle when you have hundreds of alerts, as you need to check and reactivate them.
This Webhook alert feature will be used to connect to the trading server where MetaTrader is running.
What about the basic TradingView account? A basic account cannot use this method because it does not have an active webhook feature.
TradingView Indicators for Building Alerts
In the past few days, I have been trying to create PineScript code in TradingView to interpret my trading style into a TradingView indicator, which is also set up for sending alerts. Here’s a snippet of the JSON code for sending alerts (if you want to backtest the indicator in TradingView, you can find the link to my profile on the right, it’s FREE):
// Create JSON alert
if buySignal
sl_buy = candle1_low
json = '{"symbol":"' + syminfo.ticker + '","action":"BUY","volume":0,"sl":' + str.tostring(sl_buy, "#.#####") + ',"tp":0}'
alert(json, alert.freq_once_per_bar)
if sellSignal
sl_sell = candle1_high
json = '{"symbol":"' + syminfo.ticker + '","action":"SELL","volume":0,"sl":' + str.tostring(sl_buy, "#.#####") + ',"tp":0}'
alert(json, alert.freq_once_per_bar)
In essence, when an alert matches the indicator, in addition to an arrow appearing on the chart, the indicator code will also send data in JSON format, like this (for example):
{
“symbol”:“BTCUSD”,
“action”:“SELL”,
“volume”:0,
“sl”:107000.00,
“tp”:0
}
Now that the indicator is ready… what’s next?
Cloud-Based Trading Server
To run trading using TradingView alerts, I use a Cloud Trader server from VPSTrading.net. Why VPSTrading.net? Because they provide a bridge and have an EA to connect TradingView to MetaTrader, whether MT4 or MT5. This means I don’t need to rent a bridge like TradingConnector.com or PineConnector.com, which typically costs between $15-$30 per month (around IDR 250,000 – IDR 500,000). So, tools 3, 4, and 5 (server + bridge + EA) are all provided by the server provider.
Okay, since all the necessary tools are ready, let’s move on to the next stage.
1. Run the Bridge and EA on the Trading Server
First, the bridge…
On the trading server, download the bridge application from the VPSTrading.net website; the download link can be found in the provider portal under the Tools menu. The application is called TradingView Subscriber.
After successfully downloading TradingView Subscriber, you will receive several files.
Since I am using MT4, I only need TradingView-Subscriber4 and TVHttpsBridge.exe. TradingView-Subscriber5 contains DLL and EA specifically for MT5.
After transferring the TradingView-Subscriber4 and TVHttpsBridge folders to the trading server, I first run TVHttpsBridge. I set a secret password in the tvbridge.cfg file located in the TVHttpsBridge folder. This file can be opened with Notepad, and the format should be:
secret=okamah123
Then just click File > Save or press Ctrl+S. That’s it; after that, I run the TVHttpsBridge.exe application. If the application runs without errors, a message indicating that the application has been activated will appear, looking something like this:
Since TradingView webhook only supports port 80, there should not be anything else using port 80 on the trading server. This port is often used by web server applications, so if the server is used as a web application, the bridge application may be rejected. Fortunately, the status of port 80 can be seen when we run it. It should show 1 like the image above, indicating that the Bridge application has successfully bound to port 80 and is ready to receive alerts.
Now for the EA…
There are 2 specific files for MetaTrader 4 from the download: TVCopyBridge4.dll which should be placed in the open data folder MQL4 > Libraries, and another EA file TradingView-Subscriber4_V4.00.ex4 which should be placed in MQL4 > Experts.
Here’s what the EA Input Configuration looks like:
The EA input settings are quite comprehensive and mostly function as order management. You can find detailed configuration explanations in the official guide link TradingView Subscriber V4.00. This EA, which is responsible for order management, is quite unique; the maximum risk per trade is only 2%. If it exceeds this, the EA will deactivate. There’s also a max drawdown feature, which is usually required by funded traders. Additionally, there’s a function for sending alerts to WhatsApp/Telegram/Email through a dedicated webhook API provided by VPSTrading.net, which is input into the EA settings above. So far, the setup procedure has been quite easy.
2. Time to Create Alerts in TradingView
Let’s move on to the final stage, which is creating a webhook alert in TradingView.
Since I am using my own indicator, this is much simpler because the alert type in the PineScript code has already been adjusted to the data required by the TradingView Bridge from VPSTrading.net (as shown in the code above), which is the JSON format containing symbol (pair), action (BUY/SELL), volume, sl, and tp.
I opened the BTCUSD pair from Binance. Then I clicked the Indicators menu to attach my TradingView indicator to the chart.
After the indicator is on the chart, I just need to create an Alert by clicking the Alerts menu.
In the alert settings:
What needs to be noted is in the Condition column; I select the alert indicator being used, and the alert type is Any alert() function call. This option will trigger the type of alert coded in the PineScript from the indicator. The interval should be set to Same as chart, which is 30 minutes. Lastly, for Expiration, I choose Open-ended alert, meaning this alert has no expiration limit.
Then, in the Message alert section, this indicator only has the alert name option.
Finally, in the Notifications section:
The main input here is the Webhook URL; in this column, I need to input the webhook URL from TradingView Subscriber. The format provided by VPSTrading.net is http://my_server_ip/webhook/secret_password. By inputting this webhook URL, alerts will be sent to my server and processed by TradingView Subscriber into orders in MT4 where I have installed the TradingView Subscriber EA.
I also check several notifications to receive additional information, such as: Notify in app, send email, and play sound, so I also get extra information when an alert appears.
At this point, I just need to click Create. Done!
If I get the chance, I will update again and review the reliability of the TradingView Subscriber application and continue the alert signals from the indicators I created in TradingView.




Tinggalkan Komentar