Hi @Everyone,
Telegram Integration for Algo Trading
Telegram integration allows your algo trading application to send real-time notifications directly to your Telegram account. This can be used to receive trade entries, exits, order status updates, target and stop-loss alerts, error notifications, and other important trading events instantly.
Follow the below steps to create a Telegram Bot and obtain the required credentials:
Step 1 : Open Telegram and search for @BotFather.


Step 2 : Send the command:
/newbot
Step 3 : Enter a Bot Name of your choice.

Step 4 : Enter a unique Bot Username ending with bot (e.g., my_trading_bot).

Step 5 : Copy and save the Bot Token provided by BotFather.
Step 6 : Open your newly created bot and click Start or send:
/startStep 7 : Send a message such as:
Hi
Step 8 : Open the following URL in your browser:
https://api.telegram.org/bot<BOT_TOKEN>/getUpdatesReplace <BOT_TOKEN> with your actual bot token.
https://api.telegram.org/bot8810674038:AAGxFEf1ylA7IJXma9Cb710HQpFpP9D91jc
/getUpdatesThe response –

Step 9 : In the response, locate:
"chat": {
"id": 123456789
}Step 10 : Copy the value of id . This is your Chat ID.
Step 11 : These are the credentials to set a Telegram Integration Chat ID and BOT TOKEN.
Step 12 : We have updated the Dhan-Tradehull .
Do run the below commands in cmd terminal-
pip install dhanhq==2.2.0
pip install Dhan-Tradehull==3.3.1Refer this below link for codebase –

Dhan-Tradehull
A Dhan Codebase from TradeHull
Step 13: Refer the code for the telegram alert –
from Dhan_Tradehull import Tradehull
client_code = ""
tsl = Tradehull(client_code, mode="pin_totp", pin="", totp_secret="")
tsl.send_telegram_alert(message="Order executed: BUY 50 shares of RELIANCE",receiver_chat_id="7599439802",bot_token="8810674038:AAGxFEf1ylA7IJXma9Cb710HQpFpP9D91jc")Output –





