<a href="https://www.python.org/downloads/release/python-380/"><img src="https://img.shields.io/badge/python-3.8-blue.svg?style=plastic" alt="Python version"></a>
<a href="https://github.com/fabston/TradingView-Webhook-Bot/blob/master/LICENSE"><img src="https://img.shields.io/github/license/fabston/TradingView-Webhook-Bot?style=plastic" alt="GitHub license"></a>
<a href="https://github.com/fabston/TradingView-Webhook-Bot/issues"><img src="https://img.shields.io/github/issues/fabston/TradingView-Webhook-Bot?style=plastic" alt="GitHub issues"></a>
<a href="https://github.com/fabston/TradingView-Webhook-Bot/pulls"><img src="https://img.shields.io/github/issues-pr/fabston/TradingView-Webhook-Bot?style=plastic" alt="GitHub pull requests"></a>
About • Features • Installation • Images • Help
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!
config.py.{{close}}, {{exchange}} etc. variables support. Read more here.⚠️ 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.git1. Create your virtual environmentpython3 -m venv TradingView-Webhook-Bot1. Activate itsource TradingView-Webhook-Bot/bin/activate && cd TradingView-Webhook-Bot1. Install all requirementspip install -r requirements.txt1. Edit and updateconfig.py1. Setup TradingView alerts. An example alert message would be:json { "key": "9T2q394M92", "telegram": "-1001277977502", "discord": "789842341870960670/BFeBBrCt-w2Z9RJ2wlH6TWUjM5bJuC29aJaJ5OQv9sE6zCKY_AlOxxFwRURkgEl852s3", "slack": "T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX", "msg": "Long *#{{ticker}}* at `{{close}}`" }-keyis mandatory! It has to match withsec_keyinconfig.py. It's an extra security measurement to ensure nobody else is executing your alerts -telegram,discord,slackis optional. If it is not set it will fall back to the config.py settings -msgcan 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 behttp://<YOUR-IP>/webhook1. If you use a firewall be sure to open the corresponding port 1. Run the bot withpython main.py1. PM2 can help you in running the app in the background / on system boot.
It is recommended to run flask on a different port like 8080. It is then necessary to forward port 80 to 8080.
sudo apt-get install nginxsudo nano /etc/nginx/sites-enabled/tv_webhookAdd the following content: ```nginx server { listen 80;
server_name ;
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;
}
}
``
1. Restart NGINXsudo service nginx restart`
git clone https://github.com/fabston/TradingView-Webhook-Bot.gitconfig.pydocker-compose builddocker-compose up
All kinds of contributions are welcome 🙌! The most basic way to show your support is to ⭐️ star the project, or raise 🐞 issues.
<a href="https://www.buymeacoffee.com/fabston"><img alt="Buy Me A Coffee" title="☕️" src="https://raw.githubusercontent.com/fabston/TradingView-Webhook-Bot/master/assets/bmac.png" width=200px></a>
$ claude mcp add TradingView-Webhook-Bot \
-- python -m otcore.mcp_server <graph>