Skip to main content

Alert 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.

TradingView alert configuration settings in Gunbot

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 by default as market orders to ensure they will get filled. Optionally, you can let it send limit orders as well.

tip

Webhooks​

Be sure to add at least one pair for any exchange you want to execute alerts on. This is required to establish the exchange connectivity

This can be any pair, it will not be used by the add-on. Only if you have TV_GB enabled, will the pairs also 'cycle' normally and process strategy settings.

Emails​

Be sure to add all pairs to your config that you want to execute alerts on. Only if you have TV_GB enabled, will the pairs also 'cycle' normally and process strategy settings.

Gain​

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.

danger

Only works for spot trading.

Values: numerical, represents a percentage.

Default value: 0.6

Parameter name in config.js: TV_GAIN


Market orders​

By default, orders are sent as market orders.

When you want to send limit orders instead, disable this option. Buy orders are then sent at a limit price of the best bid order in the order book, sell orders are placed at the rate of the best ask price.

Values: true or false

Default value: true

Parameter name in config.js: TV_MARKET_ORDERS


Trading Limit Buy​

This value defines the trading limit for each buy order placed through the add-on.

The default value of 0.002 would place 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.

tip

Bitmex: enter the desired number of contracts

Other margin exchanges: enter an amount in quote currency

Values: numerical – represents an amount in base currency.

Default value: 0.002

Parameter name in config.js: TV_TRADING_LIMIT_BUY


Trading Limit Buy Pyramid​

This value defines the trading limit for each pyramid buy order placed through the add-on.

The default value of 0.002 would place orders of 0.002 BTC when used on a BTC-x pair.

tip

Bitmex: enter the desired number of contracts

Other margin exchanges: enter an amount in quote currency

Values: numerical – represents an amount in base currency.

Default value: 0.002

Parameter name in config.js: TV_TRADING_LIMIT_BUY_PYRAMID


Pyramid​

Setting this to true enables pyramid trading, the amount for each pyramid order is defined by TV_TRADING_LIMIT_SELL or TV_TRADING_LIMIT_BUY_PYRAMID.

Values: true or false

Default value: false

Parameter name in config.js: TV_PYRAMID


Trading Limit Sell​

This value defines the trading limit for sell orders when TV_PYRAMID is enabled.

The default value of 0.002 would place orders of 0.002 BTC when used on a BTC-x pair.

tip

Bitmex: enter the desired number of contracts

Other margin exchanges: enter an amount in quote currency

Values: numerical – represents an amount in base currency.

Default value: 0.002

Parameter name in config.js: TV_TRADING_LIMIT_SELL


Protection​

When set to true Gunbot will check if 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.

tip

Only works for spot trading.

Values: true or false

Default value: false

Parameter name in config.js: TV_PROTECTION


Close all​

When enabled, an entire position will be closed upon receiving a close command - even if the position is bigger than the set trading limits.

tip

Only works for margin trading.

Values: numerical – represents an amount in base currency.

Default value: false

Parameter name in config.js: TV_CLOSE_ALL


Trading Limit Cap​

The maximum amount of base currency to be invested in a pair.

tip

Only works for spot trading

Values: numerical – represents an amount in base currency.

Default value: 0.0001

Parameter name in config.js: TV_TRADING_LIMIT_CAP


Stoploss Percentage​

Percentage below average bought price at which a sell signal should override TV_PROTECTION and sell in a stop-loss manner.

Values: numerical – represents a percentage.

Default value: 60

Parameter name in config.js: TV_STOPLOSS_PERCENTAGE


Trading Limit All-In​

When set to true, each buy order will use all available base currency balance.

Values: true or false

Default value: false

Parameter name in config.js: TV_TRADING_LIMIT_ALLIN


Retry Order​

Enable this when you have problems receiving multiple alerts.

Gunbot will retry processing orders for 15 minutes.

Values: true or false

Default value: false

Parameter name in config.js: RETRY_TV_ORDER


TV MVTS​

Sets a threshold for sell orders, If you own less than the set amount, sell orders will not be placed and the tradingview bot goes into buying mode again.

Values: numerical – represents the total value of a coins holdings in base currency.

Default value: 0.001

Parameter name in config.js: TV_MVTS


TV GB​

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.

Values: true or false

Default value: false

Parameter name in config.js: TV_GB


TV Leverage​

For margin trading only. Sets the leverage for opening any position. Setting 0 places the order with cross margin, if your exchange supports cross leverage.

Only use values supported by your exchange.

tip

On some exchanges it may be needed to manually set leverage on the exchange itself. Always test if this works as expected.

Values: numerical – between 0 and 100

Default value: 0

Parameter name in config.js: TV_LEVERAGE


TV Lending​

Sets the maximum acceptable lending rate when opening a position.

The default setting of 0.02 stands for 2% interest per day.

tip

Only works on Poloniex.

Values: numerical

Default value: 0.02

Parameter name in config.js: TV_LENDING