This project forwards alerts from TradingView directly to a Telegram channel. When specific financial conditions are met and an alert is triggered on TradingView, this PHP script automatically sends the alert's content to the specified Telegram channel.
- Captures real-time alerts from TradingView.
- Forwards the content of these alerts to a Telegram channel.
- A PHP server (web hosting)
- Telegram bot token and channel ID
-
Create Telegram Bot and Obtain Token:
- Contact @BotFather on Telegram and create a new bot. After creating your bot, you will receive a unique token. Note down this token.
-
Create a Telegram Channel and Add Your Bot:
- Create a Telegram channel and add the bot you created as an admin of this channel.
-
Setting Up the PHP Script:
- Upload the contents of this repository to your web server.
- Open the
webhook.php
file and update the following fields with your information:$telegramBotToken = 'YOUR_TELEGRAM_BOT_TOKEN'; $chatID = 'YOUR_TELEGRAM_CHAT_ID';
- Ensure you have a URL to access your script, e.g.,
https://yourdomain.com/webhook.php
-
Configure TradingView Alert:
- Create an alert on TradingView and select the "Webhook URL" option.
- Enter your script's URL (from step 3) as the webhook URL.
Once the setup is complete, whenever the conditions set in TradingView are met and an alert is triggered, the content of this alert will automatically be sent to the Telegram channel you specified.
This script does not include any authentication mechanism. Consider implementing additional security measures to prevent misuse of your webhook URL.