Retour au classement

fabston/TradingView-Webhook-Bot

Python

📊 Send TradingView alerts to Telegram, Discord, Slack, Twitter and Email.

webhookbotcryptoflasktelegramdiscordtweepytwittertradingviewbitcointradingslack
Croissance des étoiles
Étoiles
1.8k
Forks
502
Croissance hebdomadaire
Issues
0
5001k1.5k
avr. 2020mai 2022juin 2024juil. 2026
ArtefactsPyPIpip install tradingview-webhook-bot
README

Python version GitHub license GitHub issues GitHub pull requests
GitHub stars GitHub forks GitHub watchers

AboutFeaturesInstallationImagesHelp

About

The TradingView Webhook Bot ⚙️ listens to TradingView alerts via webhooks using flask. All alerts can be instantly sent to Telegram, Discord, Twitter and/or Email.

📊 If you are looking for an exchange to trade on, I can recommend Bybit. Sign up now and receive up to $30,000 in Deposit Rewards!

Features

  • Telegram Support using the Python Telegram libary.
  • Discord Support using webhooks.
  • Slack Support using webhooks.
  • Twitter Support using the tweepy libary.
  • Email Support using smtplib.
  • Alert channels can be enabled or disabled in config.py.
  • Dynamically send alerts to different Telegram and/or Discord channels.
  • TradingView {{close}}, {{exchange}} etc. variables support. Read more here.

Installation

⚠️ Best to run the bot on a VPS. I can recommend Hetzner's CX11 VPS for 3.79€/month. Sign up now and receive €20 free credits.

  1. Clone this repository git clone https://github.com/fabston/TradingView-Webhook-Bot.git
  2. Create your virtual environment python3 -m venv TradingView-Webhook-Bot
  3. Activate it source TradingView-Webhook-Bot/bin/activate && cd TradingView-Webhook-Bot
  4. Install all requirements pip install -r requirements.txt
  5. Edit and update config.py
  6. Setup TradingView alerts. An example alert message would be:
    {
     "key": "9T2q394M92",
     "telegram": "-1001277977502",
     "discord": "789842341870960670/BFeBBrCt-w2Z9RJ2wlH6TWUjM5bJuC29aJaJ5OQv9sE6zCKY_AlOxxFwRURkgEl852s3",
     "slack": "T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
     "msg": "Long *#{{ticker}}* at `{{close}}`"
    }
    
    • key is mandatory! It has to match with sec_key in config.py. It's an extra security measurement to ensure nobody else is executing your alerts
    • telegram, discord, slack is optional. If it is not set it will fall back to the config.py settings
    • msg can be anything. Markdown for Telegram and Discord is supported as well
      • TradingViews variables like {{close}}, {{exchange}} etc. work too. More can be found here
    • Your webhook url would be http://<YOUR-IP>/webhook
  7. If you use a firewall be sure to open the corresponding port
  8. Run the bot with python main.py
  9. PM2 can help you in running the app in the background / on system boot.

Forward Port 80 to 8080 using NGINX

It is recommended to run flask on a different port like 8080. It is then necessary to forward port 80 to 8080.

  1. Install the necessary packages: sudo apt-get install nginx
  2. Edit the NGINX configuration file: sudo nano /etc/nginx/sites-enabled/tv_webhook
  3. Add the following content:
    server {
       listen 80;
    
       server_name <YOUR-IP>;
    
       location / {
           proxy_pass http://127.0.0.1:8080;  # Forward traffic to port 8080
           proxy_set_header Host $host;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  # Pass client's IP address
           proxy_set_header X-Forwarded-Proto $scheme;
       }
    }
    
  4. Restart NGINX sudo service nginx restart

Docker

  1. Clone this repository git clone https://github.com/fabston/TradingView-Webhook-Bot.git
  2. Edit and update config.py
  3. docker-compose build
  4. docker-compose up

Images

Webhook Bot

How can I help?

All kinds of contributions are welcome 🙌! The most basic way to show your support is to ⭐️ star the project, or raise 🐞 issues.


Buy Me A Coffee

Dépôts similaires
pppscn/SmsForwarder

短信转发器——监控Android手机短信、来电、APP通知,并根据指定规则转发到其他手机:钉钉群自定义机器人、钉钉企业内机器人、企业微信群机器人、飞书机器人、企业微信应用消息、邮箱、bark、webhook、Telegram机器人、Server酱、PushPlus、手机短信等。包括主动控制服务端与客户端,让你轻松远程发短信、查短信、查通话、查话簿、查电量等。(V3.0 新增)PS.这个APK主要是学习与自用,如有BUG请提ISSUE,同时欢迎大家提PR指正

KotlinBSD 2-Clause "Simplified" Licensesmsdingding
27.2k3.3k
adnanh/webhook

webhook is a lightweight incoming webhook server to run shell commands

GoGo ModulesMIT Licensewebhookgo
12k871
risingwavelabs/risingwave

Event streaming platform for agentic AI. Continuously ingest, transform, and serve event streams in real time, at scale.

Rustcrates.ioApache License 2.0databasestream-processing
go.risingwave.com/slack
9.2k800
Thysrael/Horizon

📡 Your own AI-powered news radar. Generates daily briefings in English & Chinese. | 用 AI 构建你专属的新闻雷达

PythonPyPIMIT Licenseaggregatornews
horizon1123.top
8.4k1.2k
webhooksite/webhook.site

⚓️ Easily test HTTP webhooks with this handy tool that displays requests instantly.

JavaScriptnpmOtherwebhookangular
webhook.site
6.7k526
rubenlagus/TelegramBots

Java library to create bots using Telegram Bots API

JavaMavenMIT Licensetelegram-bottelegram-bots-api
telegram.me/JavaBotsApi
5.5k1.4k
svix/svix-webhooks

The open source and enterprise-ready webhooks service 🦀

Rustcrates.ioMIT Licensewebhooksrust
svix.com
3.3k262
keel-hq/keel

Kubernetes Operator to automate Helm, DaemonSet, StatefulSet & Deployment updates

GoGo ModulesMozilla Public License 2.0kubernetesdocker
keel.sh
2.7k318
bubenshchykov/ngrok

Expose your localhost to the web. Node wrapper for ngrok.

JavaScriptnpmngroktunneling
ngrok.com
2.4k319
zdz/ServerStatus-Rust

✨ Rust 版 ServerStatus 探针、威力加强版

Rustcrates.ioApache License 2.0rustserverstatus
ssr.rs
2.3k386
danni-cool/wechatbot-webhook

轻量、可部署的微信机器人webhook服务,使用http接口收发微信消息, 用它作为个人通知、AIGC 应用或者 coze、n8n等自动化工作流的消息节点

JavaScriptnpmMIT Licensebothttp-service
2.2k353
standard-webhooks/standard-webhooks

The Standard Webhooks specification

JavaMavenApache License 2.0apiasyncapi
standardwebhooks.com
1.7k63