TradingView

dotpim edited this page Oct 21, 2018 · 28 revisions

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.

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 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_BUY
0.002 Values: 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.

TV_TRADING_LIMIT_BUY_PYRAMID
0.002 Values: 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.

TV_PYRAMID
false 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 and TV_TRADING_LIMIT_BUY_PYRAMID

TV_TRADING_LIMIT_SELL
0.002 Values: numerical – represents an amount in base currency.


This value defines the trading limit for sell orders 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.

TV_PROTECTION
false 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 alerts without interfering with a custom strategy.

TV_STOPLOSS_PERCENTAGE
60 Values: 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_CAP
0.002 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.

TV_MVTS
0.001 Values: 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_GB
false Values: 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.

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
YOUREMAIL Set your own email address here. This address listens for mails from Tradingview.
password
YOURPASSWORD 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
  • LONG_POLONIEX_BTC-PIVX would send a long order for BTC-PIVX
  • CLOSE_POLONIEX_BTC-PIVX closes an open margin position
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.