{"id":13531194,"url":"https://github.com/fabston/TradingView-Webhook-Bot","last_synced_at":"2025-04-01T19:31:45.991Z","repository":{"id":37855412,"uuid":"257615431","full_name":"fabston/TradingView-Webhook-Bot","owner":"fabston","description":"📊 Send TradingView alerts to Telegram, Discord, Slack, Twitter and Email. ","archived":false,"fork":false,"pushed_at":"2025-03-05T23:34:55.000Z","size":288,"stargazers_count":1389,"open_issues_count":1,"forks_count":414,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-03-28T08:01:39.790Z","etag":null,"topics":["bitcoin","bot","crypto","discord","docker","flask","slack","telegram","trading","tradingview","tradingview-webhook-bot","tweepy","twitter","webhook","webhooks","webhooks-json"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabston.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"liberapay":"fabston"}},"created_at":"2020-04-21T14:05:31.000Z","updated_at":"2025-03-28T06:33:58.000Z","dependencies_parsed_at":"2023-02-19T12:00:48.985Z","dependency_job_id":"2a48427c-4197-4892-8e68-152bf8cc49ae","html_url":"https://github.com/fabston/TradingView-Webhook-Bot","commit_stats":{"total_commits":58,"total_committers":11,"mean_commits":"5.2727272727272725","dds":0.6896551724137931,"last_synced_commit":"7eff8f9e9e13f350d7a3f258329285eb3a0bbd37"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabston%2FTradingView-Webhook-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabston%2FTradingView-Webhook-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabston%2FTradingView-Webhook-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabston%2FTradingView-Webhook-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabston","download_url":"https://codeload.github.com/fabston/TradingView-Webhook-Bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246700441,"owners_count":20819872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","bot","crypto","discord","docker","flask","slack","telegram","trading","tradingview","tradingview-webhook-bot","tweepy","twitter","webhook","webhooks","webhooks-json"],"created_at":"2024-08-01T07:01:00.800Z","updated_at":"2025-04-01T19:31:40.983Z","avatar_url":"https://github.com/fabston.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/fabston/TradingView-Webhook-Bot\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/fabston/TradingView-Webhook-Bot/master/assets/logo.png\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.python.org/downloads/release/python-380/\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-3.8-blue.svg?style=plastic\" alt=\"Python version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/fabston/TradingView-Webhook-Bot/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/fabston/TradingView-Webhook-Bot?style=plastic\" alt=\"GitHub license\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/fabston/TradingView-Webhook-Bot/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/fabston/TradingView-Webhook-Bot?style=plastic\" alt=\"GitHub issues\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/fabston/TradingView-Webhook-Bot/pulls\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr/fabston/TradingView-Webhook-Bot?style=plastic\" alt=\"GitHub pull requests\"\u003e\u003c/a\u003e\n    \u003cbr /\u003e\u003ca href=\"https://github.com/fabston/TradingView-Webhook-Bot/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/fabston/TradingView-Webhook-Bot?style=social\" alt=\"GitHub stars\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/fabston/TradingView-Webhook-Bot/network/members\"\u003e\u003cimg src=\"https://img.shields.io/github/forks/fabston/TradingView-Webhook-Bot?style=social\" alt=\"GitHub forks\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/fabston/TradingView-Webhook-Bot/watchers\"\u003e\u003cimg src=\"https://img.shields.io/github/watchers/fabston/TradingView-Webhook-Bot?style=social\" alt=\"GitHub watchers\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#about\"\u003eAbout\u003c/a\u003e\n  •\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\n  •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n  •\n  \u003ca href=\"#images\"\u003eImages\u003c/a\u003e\n  •\n  \u003ca href=\"#how-can-i-help\"\u003eHelp\u003c/a\u003e\n\u003c/p\u003e\n\n## About\nThe **TradingView Webhook Bot** ⚙️ listens to [TradingView](https://tradingview.com) alerts via [webhooks](https://www.tradingview.com/support/solutions/43000529348-i-want-to-know-more-about-webhooks/) using [flask](https://flask.palletsprojects.com/en/1.1.x/).\nAll alerts can be instantly sent to Telegram, Discord, Twitter and/or Email.\n\n\u003e 📊 If you are looking for an exchange to trade on, I can recommend **Bybit**.\n\u003e **[Sign up now](https://partner.bybit.com/b/20882)** and receive up to **$30,000** in Deposit Rewards!\n\n## Features\n- Telegram Support using the [Python Telegram](https://github.com/python-telegram-bot/python-telegram-bot) libary.\n- Discord Support using [webhooks](https://support.discord.com/hc/de/articles/228383668-Webhooks-verwenden).\n- Slack Support using [webhooks](https://api.slack.com/messaging/webhooks).\n- Twitter Support using the [tweepy](https://github.com/tweepy/tweepy) libary.\n- Email Support using [smtplib](https://docs.python.org/3/library/smtplib.html).\n- Alert channels can be enabled or disabled in [`config.py`](https://github.com/fabston/TradingView-Webhook-Bot/blob/master/config.py).\n- Dynamically send alerts to different Telegram and/or Discord channels.\n- TradingView `{{close}}`, `{{exchange}}` etc. variables support. Read more [here](https://www.tradingview.com/blog/en/introducing-variables-in-alerts-14880/).\n\n## Installation\n\u003e ⚠️ Best to run the bot on a VPS. I can recommend \u003ca href=\"https://hetzner.cloud/?ref=tQ1NdT8zbfNY\" title=\"Get €20 in cloud credits\"\u003eHetzner\u003c/a\u003e's CX11 VPS for 3.79€/month. [Sign up](https://hetzner.cloud/?ref=tQ1NdT8zbfNY) now and receive **€20 free** credits.\n1. Clone this repository `git clone https://github.com/fabston/TradingView-Webhook-Bot.git`\n1. Create your virtual environment `python3 -m venv TradingView-Webhook-Bot`\n1. Activate it `source TradingView-Webhook-Bot/bin/activate \u0026\u0026 cd TradingView-Webhook-Bot`\n1. Install all requirements `pip install -r requirements.txt`\n1. Edit and update [`config.py`](https://github.com/fabston/TradingView-Webhook-Bot/blob/master/config.py)\n1. Setup TradingView alerts. An example alert message would be:\n    ```json\n    {\n     \"key\": \"9T2q394M92\",\n     \"telegram\": \"-1001277977502\",\n     \"discord\": \"789842341870960670/BFeBBrCt-w2Z9RJ2wlH6TWUjM5bJuC29aJaJ5OQv9sE6zCKY_AlOxxFwRURkgEl852s3\",\n     \"slack\": \"T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\",\n     \"msg\": \"Long *#{{ticker}}* at `{{close}}`\"\n    }\n    ```\n    - `key` is mandatory! It has to match with `sec_key` in [`config.py`](https://github.com/fabston/TradingView-Webhook-Bot/blob/master/config.py). It's an extra security measurement to ensure nobody else is executing your alerts\n    - `telegram`, `discord`, `slack` is optional. If it is not set it will fall back to the config.py settings\n    - `msg` can be anything. Markdown for [Telegram](https://core.telegram.org/api/entities) and [Discord](https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-) is supported as well\n        - TradingViews variables like `{{close}}`, `{{exchange}}` etc. work too. More can be found [here](https://www.tradingview.com/blog/en/introducing-variables-in-alerts-14880/)\n    - Your webhook url would be `http://\u003cYOUR-IP\u003e/webhook`\n1. If you use a firewall be sure to open the corresponding port\n1. Run the bot with `python main.py`\n1. [PM2](https://github.com/fabston/TradingView-Webhook-Bot/issues/28#issuecomment-766301062) can help you in running the app in the background / on system boot. \n\n### Forward Port 80 to 8080 using NGINX\n\n*It is recommended to run flask on a different port like 8080. It is then necessary to forward port 80 to 8080.*\n\n1. Install the necessary packages: `sudo apt-get install nginx`\n1. Edit the NGINX configuration file: `sudo nano /etc/nginx/sites-enabled/tv_webhook`\n1. Add the following content:\n    ```nginx\n   server {\n       listen 80;\n   \n       server_name \u003cYOUR-IP\u003e;\n   \n       location / {\n           proxy_pass http://127.0.0.1:8080;  # Forward traffic to port 8080\n           proxy_set_header Host $host;\n           proxy_set_header X-Real-IP $remote_addr;\n           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  # Pass client's IP address\n           proxy_set_header X-Forwarded-Proto $scheme;\n       }\n   }\n   ```\n1. Restart NGINX `sudo service nginx restart`\n\n### Docker\n1. Clone this repository `git clone https://github.com/fabston/TradingView-Webhook-Bot.git`\n1. Edit and update [`config.py`](https://github.com/fabston/TradingView-Webhook-Bot/blob/master/config.py)\n1. `docker-compose build`\n1. `docker-compose up`\n\n## Images\n![Webhook Bot](https://i.imgur.com/vZA42cc.png)\n\n## How can I help?\nAll kinds of contributions are welcome 🙌! The most basic way to show your support is to `⭐️ star` the project, or raise [`🐞 issues`](https://github.com/fabston/TradingView-Webhook-Bot/issues/new/choose).\n\n***\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.buymeacoffee.com/fabston\"\u003e\u003cimg alt=\"Buy Me A Coffee\" title=\"☕️\" src=\"https://raw.githubusercontent.com/fabston/TradingView-Webhook-Bot/master/assets/bmac.png\" width=200px\u003e\u003c/a\u003e\n\u003c/p\u003e\n","funding_links":["https://liberapay.com/fabston","https://www.buymeacoffee.com/fabston"],"categories":["Python","Automated Order Execution"],"sub_categories":["Open Source"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabston%2FTradingView-Webhook-Bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabston%2FTradingView-Webhook-Bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabston%2FTradingView-Webhook-Bot/lists"}