Skip to main content

Webhook alerts

Using webhooks, alerts from TradingView.com can be sent directly to a Gunbot instance. You need to be able to run Gunbot on a device that is publicly accessible on port 443.

Initial setup

Before you start setting up your alerts, you need to:

  • Make sure your system has LibreSSL installed, this will generate the needed certificate
  • Make sure your device is publicly accessible on port 443, the only port allowed by TradingView
  • Enable webhooks support in Gunbot on the TradingView settings page and set a self chosen passphrase to use in alerts, to ensure it is you who sends the alerts that the bot will execute

Notification Message Structure

For Gunbot to effectively process alerts, the notifications need this specific formatting: secret_key platform trade_type pair quantity rate

Ensure you use the standardized pair syntax for consistency with regular Gunbot operations. The notification's text should be placed in an email subject line.

Limit Order Notification Examples

Format:
secret_key exchange order_type pair quantity price

Spot trading:
987654 binance buy USDT-ETH 0.1 1200
987654 binance sell USDT-ETH 0.1 1200

Futures trading:
987654 binanceFutures long USDT-ETH 0.1 1200
987654 binanceFutures short USDT-ETH -0.1 1200
987654 binanceFutures close USDT-ETH 0.1 1200
987654 binanceFutures close USDT-ETH -0.1 1200

Market Order Notification Examples

Format:
secret_key exchange order_type pair quantity 0

Spot trading:
987654 binance buy USDT-ETH 0.1 0
987654 binance sell USDT-ETH 0.1 0

Futures trading:
987654 binanceFutures close USDT-ETH 0.1 0
987654 binanceFutures long USDT-ETH 0.1 0
987654 binanceFutures short USDT-ETH -0.1 0

Change assigned strategy

Format:
secret_key exchange strategy_name pair strategy_name_here 0

Example:
987654 binance strat USDT-ETH yourStrategyName 0