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.
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.
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.
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.
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.
To send alerts with your Pine Script strategy, create a new alert and make sure to:
- Select the name of your strategy as the condition
- 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:
Parameter | Example 1 | Example 2 | Details |
---|---|---|---|
SYMBOL | BTCUSDT | ETH/USDT | You traded symbol, can also be {{ticker}} . |
SIGNAL | BUY | CANCEL | Whether to create a buy, sell or cancel an order. |
ORDER_TYPE | LIMIT | MARKET | Type of the order to create. Default value: MARKET . |
VOLUME | 0.01 | 50q | The amount to use. Follows the amount syntax. |
PRICE | 30000 | -10% | The price to use. Follows the price syntax. |
TAKE_PROFIT_PRICE | 45000 | 10% | The price of this order’s take profit. Follows the price syntax. |
TAKE_PROFIT_PRICE_2 | 50000 | 25% | The price of this order’s Nth take profit. Follows the price syntax. |
TAG | entry1 | exit2 | The tag of this order, or tag of orders to cancel. |
BOT_ID | c403ee03-ba4c-4d9d-9d78-ad692333a291 | b403ee03-ba4c-4d9d-9d78-ad692333a292 | The 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
- Death and Golden Cross Strategy: buy and sell based on Death and Golden Crosses.
- Bull market RSI Strategy: buy and sell using RSI to increase bull market profits.
- Custom TradingView strategy tutorial: learn how to trade using any TradingView strategy.
Automation rate limit
Automation type | Hourly rate limit | Average execution time |
---|---|---|
20 | 10 seconds | |
Webhook | 20 | 5 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.