Skip to content
OctoBot cloudTradingView alerts automation

TradingView alerts automation

With OctoBot cloud, you can easily turn any TradingView price alert, indicator or Pine Script strategy into trades. Trading can be on your favourite exchanges or risk free with simulated funds.

tradingview automation illustrated by tradingview logo

To trade on any TradingView alert, you first need to configure the alert email address or webhook for your traded pair if not done already.

If you are not sure about how to use TradingView alerts, have a look at our TradingView trading tutorial.

Automating trading on TradingView price alerts

TradingView can automatically send an alert when the price of an asset crosses a given value.

creating a price alert from tradingview

This price alert that will notify my automation of a buy order identified by d4f18425-b3b6-4e6b-94d0-61f362aa10c7 if BTC crosses 40.000 USDT.

Automating trading on TradingView indicators

TradingView can automatically send an alert when something happens on a indicator.

creating an indicator alert from tradingview

This indicator alert using the Relative Strength Index (or RSI) that will notify my automation of a sell order identified by 2b82c8b2-7397-44dc-9141-f0ec85fc9ef1 if the RSI value crosses 80, which I consider as a sell signal.

An indicator alert can be a simple event such as crossing an indicator value or a much more advanced condition such as Bearish Divergences or channel exiting as shown in the RSI indicator example above.

creating a indicator alert from tradingview trigger options

Any TradingView indicator (built-in or custom, paid and free) can be used to send alerts and automate your trades using your TradingView OctoBot automations.

Automating Pine Script strategies

TradingView can automatically send an alert when your Pine Script strategies create orders.

To send alerts from a Pine Script strategy, use the alert_message parameter from Pine Script strategy functions which can create orders.

creating a strategy alert from tradingview

To send alerts with your Pine Script strategy, create a new alert and make sure to:

  1. Select the name of your strategy as the condition
  2. Replace ALL the message content with exactly {{strategy.order.alert_message}}

In the strategy’s Pine Script code, add alert_message="yourAutomationIdentifier" to your strategy entry, exit or close calls.
Example with a d4f18425-b3b6-4e6b-94d0-61f362aa10c7 automation identifier:

strategy.entry("Buy", strategy.long, comment="Buy Signal Triggered", alert_message="d4f18425-b3b6-4e6b-94d0-61f362aa10c7")

Learn more TradingView Pine Script strategies automation on the TradingView strategy automation tutorial.

Using TradingView Pine Script strategies to automate you trading is very powerful as you can also use the TradingView integrated strategy tester to optimize your strategy.

TradingView custom automations

Additionally to the automation defined from your TradingView OctoBot user interface, it is also possible to use alerts with custom content.

This format allows for more flexibility in the way automations are executed by specifying your automation content within the alert message.

Example: market BUY order of 0.001 BTC on a bot with id 123

SYMBOL=BTCUSDT;SIGNAL=BUY;VOLUME=0.001;BOT_ID=123

View all examples.

Custom automation parameters

ParameterExample 1Example 2Details
SYMBOLBTCUSDTETH/USDTYou traded symbol, can also be {{ticker}}.
SIGNALBUYCANCELWhether to create a buy, sell or cancel an order.
ORDER_TYPELIMITMARKETType of the order to create (MARKET, LIMIT, STOP). Default value: MARKET.
VOLUME0.0150qThe amount to use. Follows the amount syntax.
PRICE30000-10%The price to use. Follows the price syntax. Required when ORDER_TYPE=LIMIT.
TAKE_PROFIT_PRICE4500010%The price of this order’s take profit. Follows the price syntax.
TAKE_PROFIT_PRICE_25000025%The price of this order’s Nth take profit. Follows the price syntax. Entry funds are evenly split among take profits.
STOP_PRICE40000-25%The price of this stop loss. Follows the price syntax. Required when ORDER_TYPE=STOP.
TAG entry1exit2The tag of this order, or tag of orders to cancel.
REDUCE_ONLYfalsetrueWhether the created order should be reduce only or not. Only used in futures trading. Default is false.
LEVERAGE102The updated leverage value to use. Only used in futures trading.
BOT_IDc403ee03-ba4c-4d9d-9d78-ad692333a291b403ee03-ba4c-4d9d-9d78-ad692333a292The ID of your OctoBot to run this signal on.

Parameters must be separated using a ; character and can be included in any order.

Note: The BOT_ID parameter is required. Your BOT_ID is the last segment of your TradingView OctoBot URL.
Example: if your OctoBot URL is https://www.octobot.cloud/bots/0280badc-e884-4637-bb86-44444444, then your BOT_ID is 0280badc-e884-4637-bb86-44444444.

BOT_ID=0280badc-e884-4637-bb86-44444444;SYMBOL=BTCUSDT;SIGNAL=BUY;ORDER_TYPE=LIMIT;VOLUME=45q;PRICE=-3%

Custom automation examples

A MARKET BUY order using 20 units of quote asset with dynamic ticker with bot id 123.

SYMBOL={{ticker}};SIGNAL=BUY;VOLUME=20q;BOT_ID=123

A LIMIT BUY order of 0.01 ETH at -3% of the current price with a strategy-1 tag.

SYMBOL=ETHUSDC;SIGNAL=BUY;ORDER_TYPE=LIMIT;VOLUME=0.01;PRICE=-3%;TAG=strategy-1;BOT_ID=123

A LIMIT BUY order of 45 USDT at -3% of the current price immediately followed by a take profit at +10% of the buying price and a stop loss at -20% as soon as the the initial BUY limit order is filled.
Note: when both TAKE_PROFIT_PRICE and STOP_PRICE are provided, the created take profit and stop loss will be OCO (one cancels the other) orders.

SYMBOL=BTCUSDT;SIGNAL=BUY;ORDER_TYPE=LIMIT;VOLUME=45q;PRICE=-3%;TAKE_PROFIT_PRICE=10%;STOP_PRICE=-20%;BOT_ID=123

A MARKET BUY order of 6 SOL followed by 3 take profits at 5%, 10% and 20% from the buying price. Here, each take profit will have a quantity of 2 SOL as the bought amount is split between take profits.

SYMBOL=SOLUSDC;SIGNAL=BUY;VOLUME=6;TAKE_PROFIT_PRICE=5%;TAKE_PROFIT_PRICE_2=10%;TAKE_PROFIT_PRICE_3=20%;BOT_ID=123

CANCEL all SOL/USDC orders with the strategy-1 tag.

SIGNAL=CANCEL;SYMBOL=SOLUSDT;TAG=strategy-1;BOT_ID=123

For futures trading

A futures trading REDUCE_ONLY MARKET SELL order of 3 SOL.

SYMBOL=SOLUSDC;SIGNAL=SELL;VOLUME=3;REDUCE_ONLY=true;BOT_ID=123

A futures trading MARKET BUY order of 200 USDC which also configures the SOL/USDC contract leverage to 3.

SYMBOL=SOLUSDC;SIGNAL=BUY;VOLUME=200q;LEVERAGE=3;BOT_ID=123

Automated TradingView strategies examples

Automation rate limit

Automation typeHourly rate limitAverage execution time
Email2010 seconds
Webhook205 seconds

In order to reduce the impact of misconfigured alerts and prevent exploits of the system, there is a limit to the number of times a given automation can be triggered over 60 minutes.

The amount of bots and automations you can have is unlimited but each individual automation can be triggered at most 20 times over 60 minutes. Please contact us if you need to increase this limit.

The average execution time is the time measured between when TradingView sends the alert and when it is executed by OctoBot. This is an average, this time may vary.
This variation is small for webhooks but can, in rare cases, reach several tens of seconds for email alerts. This is due to the technical constraints associated with email transfer, which is a less optimized process than a simple webhook call.

TradingView alerts security

The OctoBot cloud infrastructure is designed with the security in mind. It is the same when it comes to the TradingView alerts integration.

Only alerts originating from the offical TradingView website can trigger a TradingView automations.