Skip to main content

Executing Trading Alerts With Tradingview Addon

The Gunbot TradingView add-on offers the ability to execute trading alerts from custom strategies created in TradingView. This integration bridges your TradingView strategy management with Gunbot's functionality, allowing Gunbot to respond to trade signals received via email for an efficient trading experience.

info

Note: Availability of this add-on depends on your specific license type or may require a separate purchase.

Setting Up Your TradingView Alerts

Start by setting up either the Gunbot IMAP listener or the Gunbot Webhooks receiver for TradingView alerts.

Gunbot Webhooks Setup

Gunbot webhooks allow dispatching a POST request to a specified URL when a TradingView alert is triggered. To activate this feature, adjust alerts in your TradingView.com chart and include your Gunbot's public IP for prompt request sending upon alert activation.

Configuring Webhooks in Gunbot

Follow these steps to configure webhooks in Gunbot:

  1. In the Gunbot interface, click the three dots in the header and select 'TradingView alerts'.
  2. Go to the Webhooks tab and enter the required port number. Use port 443 for a secure SSL connection.
  3. Enter a unique and secure password in the webhooks passphrase field. This passphrase is vital for the alerts TradingView sends to Gunbot.

Ensure to save your configuration after making these changes.

Creating and Managing Alerts in TradingView

When setting up an alert in TradingView:

  1. Open the chart of interest.
  2. Right-click and select the desired alert type, often linked to strategies in Pinecode or premium indicators.

Enabling Webhooks in TradingView

To activate webhook-based alerts:

  1. Check the Webhook URL box and input https://[Your_Gunbot_IP]:443 (replace [Your_Gunbot_IP] with your actual Gunbot IP).
  2. In the message field, provide webhook details including the passphrase, exchange, trade type, pair, amount, and price, essential for Gunbot to process trades correctly.

Networking and Security

Ensure that port 443 is open on your device's firewall or router, as the setup varies across operating systems or router models. For home networks, set up NAPT to direct external port 443 to your device's private IP.

Windows Users

  • Open Windows Defender Firewall with Advanced Security.
  • Create a new inbound rule for TCP port 443.
  • Allow the connection and name your rule appropriately.

Linux Users

  • Use the ufw firewall to allow connections from Tradingview.com's IPs.
  • Execute sudo ufw allow from [Tradingview_IP] to any port 443 for each Tradingview IP.
  • Check your settings with sudo ufw status.

MacOS Users

  • Issue the required certificate using openssl.

SSL Library Choices

TradingView requires a secure https connection for webhooks. You can use the default automatically created certificate, or follow steps to enable HTTPS in the Gunbot interface, which will also be used for webhooks.

SSL Options

  • Windows: If encountering openssl issues, use LibreSSL 3.2.2 or newer, installing it via PowerShell or downloading LibreSSL Portable 3.3.3.
  • Linux and MacOS: Linux typically cooperates with openssl, whereas MacOS users should issue certificates using openssl.

Setting Up the IMAP Listener

For the IMAP Listener configuration in Gunbot:

  1. Access 'TradingView alerts' from the header menu.
  2. Provide necessary details like User, Password, Host, Port, TLS, and Authorized froms.

Email Configuration

  • User and Password: Gmail users should generate an 'App Password' as per Google's instructions. This is used in Gunbot's Password field.
  • Host and Port: Usually default for Gmail, adjust for other providers if necessary.
  • Authorized froms: Pre-set to ["noreply@tradingview.com"]. Add more emails if required.

Once configured, Gunbot will show a waiting message, indicating it is ready to execute TradingView alerts.