MIT License

项目介绍

fabston/TradingView-Webhook-Bot 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 1.9k 个 Star、508 次 Fork。

仓库全名
fabston/TradingView-Webhook-Bot
开源许可证
MIT License
Star 数
1.9k
Fork 数
508
未关闭 Issue
3

README 摘要

About • Features • Installation • Images • Help 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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

TradingView-Webhook-Bot 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 1.9k 个 Star。

TradingView-Webhook-Bot 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 TradingView-Webhook-Bot 的源码?

可以直接克隆仓库:git clone https://github.com/fabston/TradingView-Webhook-Bot.git,默认分支为 master;安装与运行步骤见仓库 README。

TradingView-Webhook-Bot 最近还在维护吗?

仓库最近一次更新为 2 天前,当前有 3 个未关闭 Issue;Star 数为 1.9k,可作为社区活跃度的参考。

语言占比

Dockerfile
Python

README

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

About • Features • Installation • Images • Help

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

评论

暂无评论