Skip to content
Investing
TradingView 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.
Examples:

  • With Pine Script dynamic ticker and a simple BUY order of 0.001 BTC:

    SYMBOL={{ticker}};SIGNAL=BUY;VOLUME=0.001;BOT_ID=123
  • With static ticker and a BUY limit order of 45 USDT at -3% of the current price :

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

Supported parameters are:

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. Default value: MARKET.
VOLUME0.0150qThe amount to use. Follows the amount syntax.
PRICE30000-10%The price to use. Follows the price syntax.
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.
TAG entry1exit2The tag of this order, or tag of orders to cancel.
BOT_IDc403ee03-ba4c-4d9d-9d78-ad692333a291b403ee03-ba4c-4d9d-9d78-ad692333a292The ID of your OctoBot to run this signal on.

Parameters can be separated using a new line or a ; character. Order of the parameters in a signal is not important.

Please follow the TradingView alerts format guide from the open source version of OctoBot to learn more on custom alerts.

Note: if you run multiple TradingView OctoBots, then the BOT_ID parameter is required.

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.