Skip to main content

Email alerts

The Gunbot TradingView add-on lets you carry out trading alerts sent from custom strategies on TradingView, giving you full control over your strategy on the platform. Gunbot gets trade signals via email and responds with trades.

Moreover, this add-on can execute trades from any email alerts, meaning that it is not mandatory to use TradingView.

Alert message contents

Gunbot requires alerts to be in a specific format for it to take action. The alert text should be in the subject line of an email and follow the standard pair syntax used for regular Gunbot trading.

Certain alerts can have specific trading limits defined. For other alerts or those without specified amounts, the trading limits set in your TradingView settings will apply.

Consider enabling the email-to-SMS option on tradingview.com to receive plain text emails instead of HTML formatted messages.

Replace EXCHANGE with the name of your exchange.

For spot exchanges

Alert messageAction
BUY_EXCHANGE_BTC-ETHBuy ETH using BTC
BUY_EXCHANGE_BTC-ETH_0.1Buy ETH using BTC with a trading limit of 0.1 BTC
SELL_EXCHANGE_USDT-BTC

Sell BTC for USDT

  • Normal situation: full balance is sold
  • When usingTV_PYRAMID, the amount is defined byTV_TRADING_LIMIT_SELL
  • When using MULTIPLE BASE, the amount is the same as the last buy order made by the bot on the same trading pair
STOPLOSS_EXCHANGE_BTC-ETHSell ETH for BTC if stoploss is triggered
BUY_EXCHANGE_USDT-BTC_amount_rate

Buy BTC using USDT for a specified amount in USDT

at a specified rate. Requires TV market orders to be disabled

BUY_EXCHANGE_BTC-ETH_0_rate

Buy ETH using BTC for "TV trading limit buy",

at a specified rate.

Requires TV market orders to be disabled.

For futures / margin exchanges

Alert messageAction
LONG_EXCHANGE_XBT-USDLong order for XBT-USD
SHORT_EXCHANGE_XBT-USD_amountShort order for XBT-USD with a specified trading limit
LONG_EXCHANGE_XBT-USD_amountLong order for XBT-USD with a specified trading limit
LONG_EXCHANGE_XBT-USD_amount_rate

Long order for XBT-USD with a specified

trading limit and rate.

Requires TV market orders to be disabled.

SHORT_EXCHANGE_XBT-USD_0_rate

Short order for XBT-USD without

a specified trading limit and with a specified rate.

Requires TV market orders to be disabled.

CLOSE_EXCHANGE_USDT-LTCClose a margin position (made for bitmex, not supported on every exchange)
CLOSELONG_EXCHANGE_XBT-USDClose a long position (made for bitmex, not supported on every exchange)
CLOSESHORT_EXCHANGE_XBT-USDClose a short position (made for bitmex, not supported on every exchange)
tip
  • Orders in the opposite direction of a position can be used to (partially) close positions
  • Want to flip between long and short? Open one position manually, then send long and short alerts at 2x that position size to keep flipping from long to short or vice versa.

Change strategy by alert

You can use alerts to change the strategy of any valid pair that's already in your config.

This alert type can also be used to (indirectly) add pairs to Gunbot, using an AutoConfig job.

Alert messageAction
STRAT_BITMEX_XBT-USD_yourstratnameAssigns strategy yourstratname to XBT-USD