0

TradingView add-on

You are here:
< Back

TradingView is the most active social network for traders and investors. TradingView allows users to create and share technical analysis and advanced trading strategies on their interactive charts.

With the Gunbot TradingView add-on you can trade on alerts sent from custom strategies at Tradingview, completely managing your strategy at Tradingview. Gunbot receives trade signals by e-mail and trades accordingly.

This is a paid add-on.

Contents:

  1. Setup video
  2. Tradingview settings
  3. Imap listener settings
  4. Alert message contents

Setup video

Before you start setting up your alerts, you need:

  • the IMAP data for the email address you receive alerts from TradingView on
  • a Pro subscription at tradingview.com (works with trial too)

Watch on YouTube

Script used in example: Finn’s Microprofit Strategy

Tradingview settings

To run Gunbot with the TradingView add-on, the following are the only relevant settings. Normal Gunbot strategy and pair settings are not relevant and not used. Be sure to add one pair for the exchange you want to run TV on though (this can be any pair, it will not be used by the add-on)!

Orders placed by the TradingView add-on are placed as market orders.

Parameter Default Value Description
TV_GAIN 0.6 Values: numerical – represent a percentage. Set a minimum gain in % that trades initiated by Tradingview must comply to. When sell orders are being placed by Tradingview that would have a lower gain than this value, Gunbot will not place the order. Use this to prevent selling at loss.
TV_TRADING_LIMIT_BUY 0.001 Values: numerical – represent an amount in base currency.. This value defines the trading limit for buy orders placed through Tradingview. The default value of 0.001 would place maximum orders of 0.001 BTC when used on a BTC_x pair.
`TV_TRADING_LIMIT_BUY_PYRAMID“ 0.001 Values: numerical – represent an amount in base currency. This value defines the trading limit for each pyramid buy order placed through Tradingview. The default value of 0.001 would place maximum orders of 0.001 BTC when used on a BTC_x pair.
TV_PYRAMID true Values: true or false. Setting this value to true enables pyramid selling, the amount for each pyramid sell order is defined by TV_TRADING_LIMIT_SELL.
PYRAMID_BUY true Values: true or false. Setting this value to true enables pyramid buying, the amount for each pyramid buy order is defined by TV_TRADING_LIMIT_BUY_PYRAMID.
TV_TRADING_LIMIT_SELL 0.001 Values: numerical – represent an amount in base currency. This value defines the trading limit for sell orders placed through Tradingview. The default value of 0.001 would place maximum orders of 0.001 BTC when used on a BTC_x pair.
TV_PROTECTION true Values: true or false. When set to true Gunbot will check there is an overall profit before selling, as specified in TV_GAIN. When set to false, Gunbot will execute all TradingView without interfering with a custom strategy.
TV_STOPLOSS_PERCENTAGE 60 Values: numerical – represents a percentage. Percentage below averaged bought price at which a sell signal should override TV_PROTECTION and sell in a stop-loss manner.
TV_TRADING_LIMIT_CAP 0.9 Values: numerical – represents an amount in base currency. The maximum amount of base currency to be invested in a pair.
RETRY_TV_ORDER false Values: true or false. Enable this when you have problems receiving multiple alerts. Gunbot will retry processing orders for 15 minutes until the order expires.
TV_TRADING_LIMIT_ALLIN false Values: true or false. When set to true, each buy order will use all available base currency balance.

Imap listener settings

You need the IMAP settings to configure Gunbot to listen to TradingView signals, which will arrive by e-mail.

Parameter Default Value Description
enabled false Set this to true to enable the Tradingview plugin. You need to acquire a licence for this.
authorized_froms [“noreply@tradingview.com“] Set the Tradingview sender email address that you want to use.
user YOUR_EMAIL_HERE Set your own email address here. This address listens for mails from Tradingview.
password YOUR_PASSWORD_HERE Input the password for your own email address.
host imap.gmail.com The address of the IMAP server that the plugin needs to connect to.
port 993 The port number for the IMAP server
tls true Defines if TLS encryption is used for the IMAP connection.
rejectUnauthorized false

Alert message contents

The alerts messages have to be in the following format in order for Gunbot to act on them. Alerts follow the same standardized pair syntax that also apply for normal Gunbot usage.

Replace EXCHANGE in the examples with the exchange name where the trades should be placed.

For all exchanges

  • BUY_EXCHANGE_BTC-ETH would buy ETH using BTC
  • SELL_EXCHANGE_USDT-BTC would sell BTC for USDT
  • STOPLOSS_EXCHANGE_BTC-PIVX would sell PIVX for BTC if stoploss is triggered

Poloniex exclusive alerts

  • SHORT_POLONIEX_BTC-PIVX would send a short order for BTC-PIVX (margin trading only works on Poloniex)
  • LONG_POLONIEX_BTC-PIVX would send a long order for BTC-PIVX (margin trading only works on Poloniex)
  • Share post