TradingView alerts format
The following guide describes how to format TradingView alerts to trade using the open source version of OctoBot. Alert format is identical for both email and webhook alerts.
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
For a buy signal.
EXCHANGE={{exchange}}
SYMBOL={{ticker}}
SIGNAL=SELL
For a sell signal.
Parameters can be separated using a new line or a ;
character.
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 beMARKET
,LIMIT
orSTOP
VOLUME
is the volume of the order in base asset (BTC for BTC/USDT) it supports the orders amount syntaxPRICE
is the price of the limit order in quote asset (USDT for BTC/USDT). The orders price syntax is supportedSTOP_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 LIMITORDER_TYPE
, the stop loss will be created instantly. Required whenORDER_TYPE=STOP
. The orders price syntax is supportedTAKE_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 LIMITORDER_TYPE
, the take profit will be created instantly. The orders price syntax is supported. Multiple take profit prices can be used fromTAKE_PROFIT_PRICE_1
,TAKE_PROFIT_PRICE_2
, …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 falseTAG
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 +10% of its current price in BTC
EXCHANGE=binance
SYMBOL=ETHBTC
VOLUME=0.01
PRICE=10%
SIGNAL=SELL
ORDER_TYPE=LIMIT
A stop loss sell order of 10 ATOM at 3 USDT from the current price wigh an “exit1” tag
EXCHANGE=binance
SYMBOL=ATOMUSDT
VOLUME=10
STOP_PRICE=-3d
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 bebuy
orsell
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 email or webhook alerts 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