TradingView add-on

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.

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 unless TV_GB is enabled.

Be sure to add one pair for the exchange you want to run TV on (this can be any pair, it will not be used by the add-on)!

Trading limits for buy orders are set in the configuration settings, optionally you can override these by specifying the trading limit in the alert message contents.

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

ParameterDefault ValueDescription
TV_GAIN0.6Values: numerical – represent a percentage.
Set a minimum gain in % that trades initiated by Tradingview must comply to when TV_PROTECTION is enabled.When Tradingview sell alerts are sent 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_BUY0.002Values: numerical – represents an amount in base currency.
This value defines the trading limit for each buy order placed through the add-on.The default value of 0.002 would place maximum orders of 0.002 BTC when used on a BTC_x pair.When not using TV_PYRAMID, a sell alert will place a sell order for the full quote balance held.Bitmex: enter the desired number of contracts.
TV_TRADING_LIMIT_BUY_PYRAMID0.002Values: numerical – represents an amount in base currency.
This value defines the trading limit for each pyramid buy order placed through the add-on.The default value of 0.002 would place maximum orders of 0.002 BTC when used on a BTC_x pair.Bitmex: enter the desired number of contracts.
TV_PYRAMIDfalseValues: true or false.
Setting this value to true enables pyramid trading, the amount for each pyramid order is defined by TV_TRADING_LIMIT_SELL or TV_TRADING_LIMIT_BUY_PYRAMID.
TV_TRADING_LIMIT_SELL0.002Values: numerical – represents an amount in base currency.
This value defines the trading limit for sell orders when TV_PYRAMID is enabled.The default value of 0.002 would place maximum orders of 0.002 BTC when used on a BTC_x pair.Bitmex: enter the desired number of contracts.
TV_PROTECTIONfalseValues: 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 alerts without interfering with a custom strategy.
TV_STOPLOSS_PERCENTAGE60Values: numerical – represents a percentage.
Percentage below average bought price at which a sell signal should override TV_PROTECTION and sell in a stop-loss manner.
TV_TRADING_LIMIT_CAP0.002Values: numerical – represents an amount in base currency.
The maximum amount of base currency to be invested in a pair.Bitmex: enter the desired number of contracts.
RETRY_TV_ORDERfalseValues: 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_ALLINfalseValues: true or false.
When set to true, each buy order will use all available base currency balance.
TV_MVTS0.001Values: numerical – represents the total value of a coins holdings in base currency.
Sets a threshold for sell orders, If you own less than the set amount, sell orders will not be placed and the bot goes into buying mode again.
TV_GBfalseValues: true or false.
Enable this to run Gunbot strategies simultaneously with the TradingView add-on. This way buying and selling with Gunbot strategies or TradingView alerts can be mixed.The IMAP listener needs to be enabled to use this option.
TV_LEVERAGE0Values: numerical – between 0 and 100
For margin trading at Bitmex only. Sets the leverage for opening any position. Setting 0 places the order with cross margin.

Imap listener settings

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

ParameterDefault ValueDescription
enabledfalseSet this to true to enable the Tradingview plugin. You need to acquire a licence for this.
authorized_froms[“noreply@tradingview.com“]Sets the email addresses that should be processed for incoming alerts. Make sure that the alert message in contained in the email subject.
Multiple address are possible if you enter them like this: “email-1@mail.com“,”email-2@mail.com
userYOUREMAILSet your own email address here. This address listens for mails from Tradingview.
passwordYOURPASSWORDInput the password for your own email address.
hostimap.gmail.comThe address of the IMAP server that the plugin needs to connect to.
port993The port number for the IMAP server.
tlstrueDefines if TLS encryption is used for the IMAP connection.
rejectUnauthorizedfalse

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 with the name of your exchange.

For all exchanges

  • BUY_EXCHANGE_BTC-ETH would buy ETH using BTC
  • BUY_EXCHANGE_BTC-ETH_0.1 would buy ETH using BTC with a trading limit of 0.1 BTC
  • SELL_EXCHANGE_USDT-BTC would sell BTC for USDT
  • STOPLOSS_EXCHANGE_BTC-PIVX would sell PIVX for BTC if stoploss is triggered

Alerts for margin trading, supported on Bitmex, Poloniex, Huobi and Bitfinex

  • SHORT_EXCHANGE_BTC-ETH would send a short order for BTC-ETH
  • LONG_EXCHANGE_BTC-ETH would send a long order for BTC-ETH
  • LONG_EXCHANGE_BTC-ETH_0.1 would send a long order for BTC-ETH with a trading limit of 0.1 BTC
  • CLOSE_EXCHANGE_BTC-ETH closes an open margin position

To close positions at Bitfinex, use the following alerts

  • CLOSELONG_BITFINEX_USD-BTC
  • CLOSESHORT_BITFINEX_USD-BTC

Trading limits can only be specifically defined in buy/long/short alerts, for other alerts or buy/long/short alerts without specified amounts, the limits as set in your TradingView settings apply.