TradingView Alerts to Telegram

In this tutorial, you’ll learn how to receive TradingView alerts automatically and directly in Telegram, without having to constantly monitor your charts. By creating a Telegram bot and connecting it to TradingView, you can send signals, prices, symbol names, and other relevant information to a Telegram channel or group whenever specific conditions are met.
تعداد دانشجو:
زمان آموزش:
سطح دوره:
بروزرسانی:

How to Send TradingView Alerts Directly to Telegram

If you use TradingView to analyze the market and create trading alerts, you can automatically send your alerts to a Telegram group or channel.

This feature is useful for people who want to receive alerts from an indicator, strategy, or specific price condition without having to constantly monitor TradingView. In this method, when an alert is triggered, the desired message is sent via a webhook to a Telegram bot, and the bot then publishes that message in the specified group or channel.

The overall communication flow looks like this:

TradingView → Webhook → Telegram Bot → Telegram Channel / Group

In the following sections, we will go through all the steps required to set up this system.


Requirements for Sending TradingView Alerts to Telegram

To set up this system, you will need the following:

  • A TradingView account with Webhook URL support
  • A Telegram account
  • A Telegram Bot
  • A channel or group where you want to receive the messages

Do You Need a Paid TradingView Account?

Unfortunately, at the moment, the Webhook URL feature in the alert settings is not available on free TradingView accounts.


Step 1: Create a Telegram Bot

To allow TradingView to send messages to Telegram, you need a Telegram bot.

A Telegram bot can easily be created using the official BotFather bot.

In Telegram, search for:

@BotFather

and open the official bot.

After selecting Start, choose New Bot.

Choosing a Bot Name

BotFather will first ask you to choose a name for your bot. You can use any name you like.

For example: TradingView Telegram

This is simply the bot’s display name and there are no specific requirements for it.

Choosing a Bot Username

In the next step, you need to choose a Username for your bot.

The Username must be unique and must end with bot.

For example: tv_to_telegram_bot

If the Username has not already been taken by someone else, BotFather will create the bot.


Step 2: Get the Bot Token

After creating the bot, BotFather will provide you with information about it. One of the most important pieces of information is the Token.

The Token is a unique identifier used to communicate with the Telegram Bot API.

In this tutorial, we will use this token to create the Webhook URL in TradingView.

Therefore, copy the token and store it somewhere secure.

Security Note: Treat your Bot Token like a password and never share it with others. Anyone who has access to your Token can communicate with your bot through the API.


Step 3: Add the Bot to Your Telegram Channel or Group

Now you need to specify where the messages should be published.

The destination can be either a Telegram channel or a group.

For the Bot to be able to send messages to the desired destination, you need to add it to the channel or group and grant it permission to send messages.

Open the channel’s management section and go to Administrators, then add the bot you created as an administrator.

When configuring its permissions, make sure the Bot has permission to send messages.

Without this permission, even if all TradingView and webhook settings are correct, the bot will not be able to publish messages in the channel.


Step 4: Create the Message Using JSON Format

Now we need to specify what the bot should do when it receives a message from TradingView.

For this, we use the JSON format.

JSON is a common format for transferring information between different software applications and services.

The general structure of JSON data looks like this:

{
  "key": "value"
}

In this structure, each property consists of two parts:

  • Key: The name of the property
  • Value: The value assigned to that property

For example, if we wanted to define a person’s information, we could have properties such as name, age, and so on.

We use the same structure when communicating between TradingView and Telegram.

To send a Telegram message, we need two main properties:

chat_id
text

chat_id specifies where the message should be sent, while text specifies the content of the message.

For example:

{
  "chat_id": "CHAT_ID",
  "text": "hello"
}

In this example, hello is the message that the Bot should send.


Step 5: Find the Chat ID

Now we need to find the ID of the message destination.

If your destination is a private channel or group, you need to find its Chat ID.

It is recommended to use Telegram Web to find the ID of a private channel or group. You can also use Telegram bots to find it.

After logging in to Telegram Web, click on the channel or group you want to use and check the address displayed in your browser.

You will find a numeric ID in this address.

Important Note About Telegram Web Versions

If the ID you are looking for is not displayed in the URL, go to the settings and select Switch to a version, then choose version A.

After selecting the appropriate version, click on the channel or group. You should then see a unique number in the URL.

Copy this number in its entirety.

The minus sign at the beginning of the number is also part of the Chat ID and must not be removed.

For example: -1001234567890

It must be used exactly in this format.


Step 6: Prepare the Alert Message in TradingView

Now we have all the information needed to create the message.

A simple message can look like this:

{
  "chat_id": "-1001234567890",
  "text": "hello"
}

Here:

  • chat_id is the ID of the destination channel or group.
  • text is the message that should be published on Telegram.

You can replace hello with any message you want.

For example:

{"chat_id": "-1001234567890", "text": "TradingView Alert"}

This text should be entered in the Message field when creating an Alert in TradingView.


Step 7: Create the Webhook URL

Now we need to tell TradingView where to send this message.

To do this, enable the Webhook URL option in the Alert settings and enter the Telegram Bot API URL.

The URL has the following structure:

https://api.telegram.org/botBOT_TOKEN/sendMessage

In this URL, replace BOT_TOKEN with the actual Token you received from BotFather when you created the Bot.

The final URL will look something like this:

https://api.telegram.org/bot123456789:ABCDEF/sendMessage

Of course, the actual Token will be different for every bot.

Note About sendMessage

At the end of the URL, we use the sendMessage method because our goal is to send a text message to Telegram.

The M in Message must be uppercase.


Step 8: Create an Alert in TradingView

Now all the required components are ready.

Create an Alert in TradingView.

The Alert condition can be anything supported by TradingView, for example:

  • The price reaching a specific level
  • The price crossing a specific level
  • A specific condition being met in an indicator
  • A signal being generated by a strategy
  • An alert defined in Pine Script

In the Message section, enter the JSON you created:

{
  "chat_id": "-1001234567890",
  "text": "hello"
}

Then, under Notifications, enable the Webhook URL option.

In the Webhook URL field, enter the URL you created:

https://api.telegram.org/botBOT_TOKEN/sendMessage

Finally, create the Alert.


Step 9: Test the Message Delivery

To make sure everything is configured correctly, it is a good idea to first send a simple message such as hello.

When the Alert condition is triggered, TradingView sends the request to the webhook.

The Telegram Bot receives the request and publishes the message contained in the text field in the Telegram channel or group specified by the Chat ID.

If all the steps have been completed correctly, you should see the message in your Telegram channel or group.


Sending Dynamic Information in Telegram Messages

One of the important advantages of this method is that the Telegram message does not have to be static.

TradingView allows you to use Placeholders or alert-related variables in the message.

For example, you can automatically include the price at the exact moment the Alert is triggered.

As a result, Telegram can receive a message such as:

Price = 123.45

You can also include additional information in the message.

For example:

  • Symbol name
  • Price
  • Volume
  • Time
  • Information related to the condition that triggered the signal

If the Alert is generated through Pine Script, you have much more flexibility when customizing the message content, and you can include the information you need in the message structure.


Using a Public Telegram Channel

The destination channel can be either Private or Public.

For a private channel, as explained above, you can find the numeric Chat ID through Telegram Web.

However, if you make the channel public, it will have a Username.

For example: @kheirandish_v

In this case, you can use the channel’s Username instead of the numeric Chat ID in the chat_id value:

{
  "chat_id": "@kheirandish_v",
  "text": "hello"
}

Therefore, in a public channel, using the Username can make the process easier.

It is important to note that changing a private channel to a public channel does not change the Bot or its Token. In this case, only the method used to specify the message destination changes.


Troubleshooting Common Errors

If the message is not being sent from TradingView to Telegram, check the following:

1. The Webhook Option Is Not Available

Make sure your TradingView account supports the use of Webhooks.

2. The Bot Is Not Sending Messages

Make sure the Bot has been added to the channel or group and has permission to send messages.

3. The Chat ID Is Incorrect

If you are using a private channel or group, obtain the ID from Telegram Web and make sure to keep the minus sign at the beginning.

4. The Bot Token Is Incorrect

Enter the Token you received from BotFather exactly as provided, without any spaces, in the Webhook URL.

5. The Webhook URL Is Incorrect

The URL should have the following structure:

https://api.telegram.org/botBOT_TOKEN/sendMessage

Make sure that bot appears before the Token and sendMessage appears after the Token.


Summary

To send TradingView alerts directly to Telegram, you do not need to manually forward messages or constantly monitor the charts. By creating a Telegram Bot and connecting it to TradingView using the Webhook feature, you can automate the entire process.

The main steps are:

  1. Prepare a TradingView account with Webhook support
  2. Create a Bot using @BotFather
  3. Get the Bot Token
  4. Add the Bot to the channel or group
  5. Give the Bot permission to send messages
  6. Find the Chat ID
  7. Create a JSON message containing chat_id and text
  8. Create a Webhook URL using the Bot Token
  9. Enter the Message and Webhook URL in the TradingView Alert
  10. Test the message delivery
  11. If needed, use TradingView variables to send the price, symbol, and other information

Once these steps are completed, you can send TradingView alerts directly and automatically to Telegram. This method also provides a solid foundation for building more advanced systems, such as sending indicator signals, multi-symbol alerts, customized Pine Script messages, and trading notification systems.

Our team is ready to develop custom market-monitoring solutions for your preferred symbols and timeframes and send alerts whenever your specified conditions are met.
Feel free to contact us.

Replay on Tradingview Basic Acounts
11
HeikinAshi Chart
32
Publishing Script on Tradingview
17
Re-Painting
5