NadirAliOfficial
tradingview-capitalcom-bot
Python

Webhook bridge that receives TradingView strategy alerts and auto-executes trades on Capital.com demo/live via REST API

Last updated Jul 1, 2026
11
Stars
0
Forks
0
Issues
0
Stars/day
Attention Score
41
Language breakdown
No language data available.
Files click to expand
README

TradingView → Capital.com Webhook Bot

Receives TradingView webhook alerts and automatically executes trades on Capital.com (demo or live account).

Python Flask

How It Works

  • TradingView sends a webhook POST to your server when an alert fires
  • Flask app receives and parses the JSON payload
  • Capital.com API places the order (market buy/sell)

Webhook Payload Format

Configure your TradingView alert message as:

{
  "action": "buy",
  "symbol": "EURUSD",
  "size": 1
}

| Field | Values | Description | |----------|---------------------|--------------------------| | action | "buy" / "sell" | Trade direction | | symbol | e.g. "EURUSD" | Capital.com market name | | size | number | Position size (lots) |

Setup

pip install flask requests python-dotenv

Create .env:

CAPITALAPIKEY=yourapikey
CAPITALPASSWORD=yourpassword
CAPITALIDENTIFIER=youremail
DEMO=true

Run the server:

python app.py

Point your TradingView webhook to http://your-server:5000/webhook.

Files

| File | Purpose | |---------------------|----------------------------------| | app.py | Flask webhook server | | capital_client.py | Capital.com REST API wrapper | | config.py | Environment config loader | | generate_guide.py | Generates a trading setup guide |

License

MIT

🔗 More in this category

© 2026 GitRepoTrend · NadirAliOfficial/tradingview-capitalcom-bot · Updated daily from GitHub