TradingView to Telegram process
Last updated
Last updated
This guide will teach you how to link your TradingView strategy to Telegram via Webhook. Follow these steps to set up alerts that send notifications to your Telegram Group.
TradingView Essential Plan:
Ensure you have at least the Essential Plan. This plan enables you to set up price alerts, which are necessary for sending alerts to Telegram. Higher subscription tiers allow more alerts.
If you're buying a subscription and want to pay with crypto, skip the trial and press the "pay now" link.
Follow the Previous Section:
Ensure you have set up your strategy without the backtest features as described in the "Final Strategy Adjustments" section.
Open TradingView and Apply Strategy:
Log in to TradingView.
Ensure you have the token and chart timeframe you want the strategy to apply to. Make sure that you have the strategy applied to the chart. To do this click "Add to Chart" while on the "Pine Editor" tab.
Create an Alert:
Click the "Add Alert" button (the alarm clock icon) at the top within the strategy tester tab.
The "Create Alert" window will pop up.
Configure Alert Settings:
In the "Condition" dropdown, select your strategy.
Set the alert conditions based on your strategy's criteria.
For the "Expiration" section, set the expiry date. If you have the Premium plan, you can keep the alerts open-ended. Otherwise, you'll need to extend the expiry every month or two.
Name Your Alert:
Give your alert a meaningful name related to your strategy.
Set the Alert Message:
Copy the "TradingView Alert Message" template below and paste into the Alert Message field replacing anything already in the message field:
The message above is a template and as such we need to change the -chat_id
, (insert_name_of_token)
and (insert_contract_address)
. The next process will give us all the necessary information to fill this message in correctly.
Create a Telegram Group:
Open the Telegram app.
Tap on the menu icon (three horizontal lines) in the top left corner.
Select "New Group" from the menu.
Name the Group after your strategy.
Tap "Create" button to make group.
Configure the Group:
Tap on the group name at the top to open the group settings.
Tap on the "+ Person" button to add members.
Tap "Members" then "Add Members."
Type https://t.me/Read_XPayDEXBot to search bar, click on the user and select "add" to add the user to the group. This allows XPayDexBot to read the messages sent to the channel and initiate transactions automatically.
Next click on the 3 dots and then "Manage Group."
Change "Chat History for new members" to Visible in most cases. Click Save.
Click on "Permissions" and set the permissions accordingly for what you would like other users rights to be. Best practice for a signal group is to disable all rights and allow users to only view content.
Create a Bot with BotFather:
In Telegram, search for "BotFather."
Select the official BotFather bot and tap "Start." Make sure the bot handle specifically reads "BotFather."
Type /newbot
and follow the prompts to create a new bot.
Name your bot and choose a unique username that ends with "bot."
Keep you HTTP API secure and safe. Never give your HTTP API to anyone unless you really trust them. (The HTTP API is how applications will use your bot)
Add Bot to your Group:
Tap on your Group name at the top to open the Group settings.
Tap on the "+ Person" button to add members.
Type your bot's username into the search bar, click on it and click on the "Add" button.
Click on the 3 dots and "Manage Group" again.
Click on "Administrators."
Click on "Add Administrator"
Select the bot you made in BotFather and then hit "Save" to make the bot an Admin.
Use a Bot to Find Chat ID:
In Telegram, search for https://t.me/username_to_id_bot
Select the correct bot making sure there is no extra characters or weird characters and tap "Start."
Click the button "Chat" and then select your group. This'll forward that group to the bot and the bot will send you the Chat ID. Copy the Chat ID to clipboard.
Update TradingView Alert Message:
Go back to TradingView and replace "-chat_id" in the alert message with your group's chat ID, including the hyphen and numbers.
Replace "(insert_name_of_token)" with the token name (e.g. "Andy").
Replace "(insert_contract_address)" with the token's contract address. You can find the contract address on charting websites like DexTools.
Set Webhook URL:
In the "Notifications" tab of the alert settings, find the "Webhook URL" field.
Copy the "Webhook URL" below and paste it into the field:
Replace "(insert_your_http_api)" with the HTTP API you received from BotFather.
Create the Alert:
Click "Create" to save the alert.
If you click on the alarm clock icon on the right side bar then you can see all your active alerts in Tradingview.
By following these steps, you can link your TradingView strategy to Telegram via Webhook. This setup allows you to receive notifications in your Telegram Group which will allow you to automate your trading strategy with XPayBot.
Join us in the next section where we'll describe how you can automate your trading of these alerts with XPayBot. See you in the next section!
Automate. Save Time. Profit. With XPayBot.