Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

How to Send TradingView Alerts to Telegram Without Any Coding or Third-Party Tools

3 min read

If you’re a trader using TradingView, you know how crucial it is to stay updated with real-time alerts. Telegram, with its instant messaging capabilities, is an excellent platform to receive these alerts. The good news is you can integrate TradingView alerts with Telegram without any coding or third-party tools. Here’s a step-by-step guide to help you set this up seamlessly.

Prerequisites

Before we dive into the steps, ensure you have the following prerequisites:

  1. TradingView Account:
    • You need a TradingView (paid account) with webhook feature to create and configure alerts.
  2. Telegram Account:
    • You need a Telegram account to create a bot and set up a group or channel.
  3. Telegram Bot:
    • You need a Telegram bot, which you can create using @BotFather.
  4. Group or Channel:
    • A Telegram group or channel where you want to receive alerts.

Step 1: Create a Telegram Bot

  1. Open Telegram and search for @BotFather:
    • @BotFather is the official bot to create other bots.
    • Start a chat with @BotFather and send the command /start.
  2. Create a new bot:
    • Send the command /newbot and follow the prompts to name your bot and create a username for it.
    • For this example, let’s name the bot mytelegram_bot.
    • @BotFather will provide you with a token. For this example, the token is bot6490145838:AAEurGwl5v56thGHTufPOFHG1jsTFLQ. Save this token as you will need it to send messages via the Telegram API.

Step 2: Add the Bot to a Group or Channel

To send messages to a specific chat, you need to add the bot to the chat and get the chat ID:

  1. Create a Group or Channel:
    • You can add your bot to a private group, public group, or public channel where you want to receive alerts.
    • If you are using a public channel, the chat ID is the channel’s username prefixed with @. For example, if your channel’s username is @tradingview_alerts, then @tradingview_alerts is your chat ID.
  2. Add Bot to the Group or Channel:
    • Add mytelegram_bot to the group or channel as admin
    • If it’s a group, send a message in the group to activate the bot.
  3. Get Chat ID for Groups:
    For groups, you need to get the chat ID.
    Open a web browser and enter the following URL, replacing bot6490145838:AAEurGwl5v56thGHTufPOFHG1jsTFLQ with your bot token:
https://api.telegram.org/bot6490145838:AAEurGwl5v56thGHTufPOFHG1jsTFLQ/getUpdates

Look for the chat object in the JSON response and note the id. This is your group chat ID.

Step 3: Configure TradingView Alerts

  1. Open TradingView:
    • Go to your chart and create a new alert by clicking on the alarm clock icon.
  2. Set Alert Conditions:
    • Configure the condition and frequency for your alert based on your trading strategy.
  3. Webhook URL:
    • In the alert dialog, enable the “Webhook URL” option.
    • Enter the following URL, replacing bot6490145838:AAEurGwl5v56thGHTufPOFHG1jsTFLQ with your bot token:
https://api.telegram.org/bot6490145838:AAEurGwl5v56thGHTufPOFHG1jsTFLQ/sendMessage

Alert Message:

  • In the message field, enter the JSON message format. Replace @tradingview_alerts with your actual chat ID:
{
    "chat_id": "@tradingview_alerts",
    "text": "Alert for {{ticker}}: price is {{close}}",
    "parse_mode": "Markdown"
}

For the Detailed Parameters List refer to the Telegram API Documentation

Example for Public Channel

Suppose your public channel’s username is @tradingview_alerts.

Your webhook URL and message would be:

  • Webhook URL:
https://api.telegram.org/bot6490145838:AAEurGwl5v56thGHTufPOFHG1jsTFLQ/sendMessage

Alert Message:

{
    "chat_id": "@tradingview_alerts",
    "text": "*Alert for {{ticker}}*\nPrice: `{{close}}`\nCheck the chart [here](https://www.tradingview.com)",
    "parse_mode": "Markdown"
}

Example for Private Group

Suppose your private group’s chat ID is -4200378220. Your webhook URL and message would be:

  • Webhook URL:
https://api.telegram.org/bot6490145838:AAEurGwl5v56thGHTufPOFHG1jsTFLQ/sendMessage

Alert Message:

{
    "chat_id": "-4200378220",
    "text": "*Alert for {{ticker}}*\nPrice: `{{close}}`\nCheck the chart [here](https://www.tradingview.com)",
    "parse_mode": "Markdown"
}

Step 4: Test the Integration

  1. Trigger an Alert:
    • Ensure the alert condition is met to trigger the webhook.
  2. Check Telegram:
    • Verify that the alert message is received in your Telegram group or channel.

Why Use Markdown?

Using "parse_mode": "Markdown" in your JSON message allows you to format your alerts, making them more readable and visually appealing. Here are a few formatting options:

  • Bold: *bold text*
  • Italic: _italic text_
  • Inline Code: `inline code`
  • Links: [text](http://url)

By leveraging these formatting options, you can highlight important information in your alerts, making them easier to read and understand at a glance.

For More HTML Markdown formatting options examples

Example Markdown Message

Here’s an example of how you can use Markdown in your TradingView alert message:

{
    "chat_id": "@tradingview_alerts",
    "text": "*Alert for {{ticker}}*\nPrice: `{{close}}`\nCheck the chart [here](https://www.tradingview.com)",
    "parse_mode": "Markdown"
}

In this example:

  • *Alert for {{ticker}}*: The ticker symbol will be displayed in bold.
  • Price: \{{close}}“: The price will be displayed as inline code.
  • [here](https://www.tradingview.com): The word “here” will be a clickable link to TradingView.

Integrating TradingView alerts with Telegram without any coding or third-party tools is straightforward and highly effective for real-time trading updates. By following these simple steps, you can ensure that you never miss an important market move again. Enjoy the seamless integration and happy trading!

Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

6 Indian Brokers You Can Connect with TradingView to…

TradingView is a globally recognized charting and trading platform that empowers traders with its advanced analytical tools and intuitive interface. For Indian traders, TradingView...
Rajandran R
2 min read

Integrating Tradingview Lightweight Charts with Yahoo Finance Data –…

Hey traders! If you’re looking for a way to visualize your stock data dynamically and interactively, you’re in for a treat. Today, we’ll explore...
Rajandran R
2 min read

Automate Your Trading with OpenAlgo and TradingView: A Step-by-Step…

For traders seeking to automate their strategies, OpenAlgo and TradingView offer a powerful combination. OpenAlgo is an open-source algo-trading platform allowing seamless integration with...
Rajandran R
1 min read

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More