Skip to main content

Connect TradingView alerts to any crypto exchange via PULSE Protocol — free alternative to 3Commas

Project description

pulse-tradingview

PyPI version PyPI downloads License

Connect TradingView alerts to any crypto exchange — free alternative to 3Commas and Alertatron.

TradingView fires a webhook when your alert triggers. pulse-tradingview catches it and places the trade on Binance, Bybit, OKX, or Kraken. No cloud subscription. Runs on your own machine.


Installation

pip install pulse-tradingview

# Add the exchange you trade on:
pip install pulse-tradingview pulse-bybit
pip install pulse-tradingview pulse-binance
pip install pulse-tradingview pulse-okx
pip install pulse-tradingview pulse-kraken

# Or all at once:
pip install "pulse-tradingview[all]"

Quick Start

1. Create config

pulse-tv init

Edit the generated pulse_tv_config.json:

{
  "bybit": {
    "api_key": "YOUR_BYBIT_API_KEY",
    "api_secret": "YOUR_BYBIT_API_SECRET"
  },
  "min_confidence": 0.7,
  "pairs": ["BTC/USDT", "ETH/USDT", "SOL/USDT"]
}

2. Start the server

pulse-tv start
pulse-tradingview v0.1.0
Webhook server: http://0.0.0.0:8888/
Exchanges:      Bybit

In TradingView → Alert → Webhook URL:
  http://YOUR_PUBLIC_IP:8888/

Waiting for signals...

3. Set up TradingView alert

In TradingView, create an alert and set the webhook URL to http://YOUR_SERVER_IP:8888/.

Use this JSON template as the alert message:

{
  "action": "{{strategy.order.action}}",
  "symbol": "{{ticker}}",
  "price": "{{close}}",
  "interval": "{{interval}}",
  "confidence": "0.85"
}

That's it. When the alert fires, the trade goes to Bybit.


Alert message format

TradingView sends the alert message as the POST body. pulse-tradingview understands three formats:

JSON (recommended):

{"action": "buy", "symbol": "BTCUSDT", "price": "83000", "confidence": "0.9"}

Pine Script placeholders (TradingView fills these in automatically):

{"action": "{{strategy.order.action}}", "symbol": "{{ticker}}", "price": "{{close}}"}

Plain text (legacy):

BUY BTCUSDT

Supported fields:

Field Required Values Example
action Yes buy, sell, long, short, close "buy"
symbol Yes Exchange symbol "BTCUSDT"
price No Current price "83000"
interval No Chart timeframe "60" (= 1h)
confidence No 0.0 – 1.0 "0.85"

Any extra fields (rsi, strategy, reason) are passed through and available in your handler.


Python API

For more control, use the library directly:

from pulse_tradingview import WebhookReceiver, SignalRouter
from pulse_bybit import BybitAdapter

# Set up router
router = SignalRouter()
router.add_adapter(BybitAdapter(api_key="...", api_secret="..."), "Bybit")

# Only act on confident signals for major pairs
router.add_filter(lambda p: p["confidence"] >= 0.8)
router.add_filter(lambda p: p["pair"] in ["BTC/USDT", "ETH/USDT"])

# Start server
with WebhookReceiver(port=8888, on_signal=router.route):
    print("Listening...")
    input("Press Enter to stop")

Multi-exchange routing

One TradingView alert → multiple exchanges simultaneously:

router = SignalRouter()
router.add_adapter(BybitAdapter(api_key="...", api_secret="..."), "Bybit")
router.add_adapter(BinanceAdapter(api_key="...", api_secret="..."), "Binance")

# Signal goes to both exchanges
router.route({"pair": "BTC/USDT", "direction": "long", "confidence": 0.9})

Pine Script strategies

Ready-to-use Pine Script files are in pine_scripts/:

  • rsi_pulse_strategy.pine — RSI oversold/overbought with configurable levels
  • macd_pulse_strategy.pine — MACD crossover strategy

Both send properly formatted JSON alerts that pulse-tradingview parses automatically.

Example from rsi_pulse_strategy.pine:

long_msg = '{"action":"buy","symbol":"' + syminfo.ticker +
           '","price":"' + str.tostring(close) +
           '","confidence":"0.85","rsi":"' + str.tostring(rsi) + '"}'

alertcondition(long_signal, title="PULSE Buy Signal", message=long_msg)

CLI reference

# Start webhook server
pulse-tv start
pulse-tv start --port 9000 --config my_config.json --verbose

# Create sample config
pulse-tv init
pulse-tv init --output /path/to/config.json

# Send test signal to running server
pulse-tv test
pulse-tv test --action buy --symbol BTC/USDT --price 83000 --confidence 0.9

Security

Add a shared secret so only TradingView can trigger your server:

Config:

{"secret": "my-random-secret-string", "bybit": {...}}

TradingView webhook URL:

http://YOUR_IP:8888/

Add header in TradingView alert (Advanced → Headers):

X-PULSE-Secret: my-random-secret-string

Requests without the correct secret get a 401 response.


PULSE Ecosystem

pulse-tradingview is part of the PULSE Protocol ecosystem.

Package Description
pulse-protocol Core protocol
pulse-bybit Bybit exchange
pulse-binance Binance exchange
pulse-okx OKX exchange
pulse-kraken Kraken exchange
pulse-freqtrade Freqtrade bot
pulse-anthropic Claude AI adapter

License

Apache 2.0 — free forever, open source.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulse_tradingview-0.1.1.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pulse_tradingview-0.1.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file pulse_tradingview-0.1.1.tar.gz.

File metadata

  • Download URL: pulse_tradingview-0.1.1.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pulse_tradingview-0.1.1.tar.gz
Algorithm Hash digest
SHA256 abf3c9106a9d0491e65890fd04536b64fcf3e4306b332eff0cc285c16ee7d391
MD5 79ae970bfec431e3306e4fd505cd6ebb
BLAKE2b-256 69d1b4e898512f21b62a80921de9c483d83c9b8007b2f3803be355a260488382

See more details on using hashes here.

File details

Details for the file pulse_tradingview-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pulse_tradingview-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1836efc593e8feba15168e6c476e3d0c3af379240a09fa200ea0cbb88c47e975
MD5 8a8972201c18abdd8d3150b7ab423dac
BLAKE2b-256 3a6d600a60bd7ceeafe28908b23fb1dca618676d185f5f66fd2dfee49d4b5e08

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page