Skip to main content

TradingView webhooks (experimental)

In active development

This feature is part of the TradingView add-on, availability depends on your license type. It is currently considered experimental and will reach a more complete status soon.

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
  • Like with TradingView alerts in email mode, make sure to add one valid pair to Gunbot for each exchange you'll receive alerts on. This pair will not get actively traded unless you send alerts for it.

Alert message contents#

The alerts have to be in the following format in order for Gunbot to act on them: passphrase exchange order_type pair amount price

Alerts follow the same standardized pair syntax that also apply for normal Gunbot usage, the alert text must be in the subject line of an email.

Limit order alert examples#

spot:
123456 binance buy USDT-BTC 0.1 42553.4
123456 binance sell USDT-BTC 0.1 42553.4
futures:
123456 binanceFutures long USDT-BTC 0.1 42553.4
123456 binanceFutures short USDT-BTC -0.1 42553.4
123456 binanceFutures close USDT-BTC 0.1 42553.4
123456 binanceFutures close USDT-BTC -0.1 42553.4

Market order alert examples#

spot:
123456 binance buy USDT-BTC 0.1 0
123456 binance sell USDT-BTC 0.1 0
futures:
123456 binanceFutures long USDT-BTC 0.1 0
123456 binanceFutures short USDT-BTC -0.1 0
123456 binanceFutures close USDT-BTC 0.1 0
123456 binanceFutures close USDT-BTC -0.1 0

Change strategy alert#

format:
passphrase exchange strat pair name_of_strategy_here 0
example:
123456 okgunbot strat ETH-AVAX superCoolDCA 0

Other settings#

Currently a small subset of the settings available for email alerts are available for use with webhooks:

  • TV_GB
  • TV_PROTECTION

Installing LibreSSL on Windows#

If you get certificate related errors when enabling the webhook listener on a windows server, the following steps should resolve it.

  1. open powershell and install chocolatey by pasting this line and press enter
  2. open cmd terminal and paste this line: choco install -confirm libressl

In case errors persist, manually install LibreSSL using this method:

  1. download .dll from here https://sourceforge.net/projects/libressl-3-2-0-for-windows/files/LibreSSL-3.3.3_MinGW_Windows7%28static%29.zip/download
  2. extract the folder in c:/libressl