Skip to content
Trading bot
Interfaces
Alert format

TradingView alerts format

Creating orders

Minimal alert content

The alert format is designed to be easily used from TradingView. Minimal alerts contain the exchange name, the alert symbol (BTCUSDT for BTC/USDT and BTC/USDT:USDT) and the side of the order to create. Example:

EXCHANGE={{exchange}}
SYMBOL={{ticker}}
SIGNAL=BUY

alert-message

For a buy signal.

EXCHANGE={{exchange}}
SYMBOL={{ticker}}
SIGNAL=SELL

For a sell signal.

Additional alert parameters

Additional order details can be added to the alert. These are optional:

ORDER_TYPE=LIMIT
VOLUME=0.01
PRICE=42000
STOP_PRICE=38000
TAKE_PROFIT_PRICE=55000
REDUCE_ONLY=true
  • ORDER_TYPE is the type of order, it can be MARKET, LIMIT or STOP
  • VOLUME is the volume of the order in base asset (BTC for BTC/USDT) it supports the orders amount syntax
  • PRICE is the price of the limit order in quote asset (USDT for BTC/USDT)
  • STOP_PRICE is the price of the stop order to create. When increasing the position or buying in spot trading, the stop loss will automatically be created once the initial order is filled. When decreasing the position (or selling in spot) using a LIMIT ORDER_TYPE, the stop loss will be created instantly. Required when ORDER_TYPE=STOP.
  • TAKE_PROFIT_PRICE is the price of the take profit order to create. When increasing the position or buying in spot trading, the take profit will automatically be created once the initial order is filled. When decreasing the position (or selling in spot) using a LIMIT ORDER_TYPE, the take profit will be created instantly.
  • REDUCE_ONLY when true, only reduce the current position (avoid accidental short position opening when reducing a long position). Only used in futures trading. Default is false
  • TAG is an identifier to associate to the order(s) to create. Any value can be used as tag. Tags can later be used to cancel specific orders.

Examples

A limit buy order of 0.01 BTC at 30000 USDT with a take profit

EXCHANGE=binance
SYMBOL=BTCUSDT
VOLUME=0.01
PRICE=30000
TAKE_PROFIT_PRICE=35000
SIGNAL=BUY
ORDER_TYPE=LIMIT

A limit sell order of 0.01 ETH at 0.1 BTC

EXCHANGE=binance
SYMBOL=ETHBTC
VOLUME=0.01
PRICE=0.1
SIGNAL=SELL
ORDER_TYPE=LIMIT

A stop loss sell order of 10 ATOM at 5 USDT wigh an “exit1” tag

EXCHANGE=binance
SYMBOL=ATOMUSDT
VOLUME=10
STOP_PRICE=5
SIGNAL=SELL
ORDER_TYPE=STOP
TAG=exit1

Canceling orders

Use SIGNAL=CANCEL to cancel orders identified buy their SYMBOL and EXCHANGE

Canceling every ETH/BTC order on Binance

EXCHANGE=binance
SYMBOL=ETHBTC
SIGNAL=CANCEL

Canceling every ATOM/USDT sell order with an “exit1” tag on Binance

EXCHANGE=binance
SYMBOL=ATOMUSDT
SIGNAL=CANCEL
PARAM_SIDE=SELL
TAG=exit1

Additional cancel parameters are available:

  • PARAM_SIDE is the side of the orders to cancel, it can be buy or sell to only cancel buy or sell orders.
  • TAG is the tag to select orders to cancel with. When provided, only orders created with the given tag and symbols will be canceled.

Alerts security

You can use a token to add a security layer on your webhook using an identification token, this token is randomly generated by your OctoBot and can be found on the configuration interface and in execution logs.

To add your token on the tradingview.com signal: add the following line to the alert message:

TOKEN=YOUR_TOKEN