Include current price and more in your alerts

26 October 2019

Using TradingView alerts, it is now possible to add the current price, indicator values and more into your alert messages. Here we explain how...

TradingView now let you add special placeholders into your alert message text (when you create or edit an alert) that are replaced with key trading data at the moment the alert is sent to you.

Let's start with an example alert message text...

The current price of {{ticker}} is {{close}}!

When an alert with this message text is sent to you, {{ticker}} will be replaced with the ticker symbol that the alert was set up on. {{close}} will be replaced with the close price on the current candle. So the message your receive might look more like this...

The current price of XBTUSD is 10000!

Here is a list of all the standard values that you can now drop into your alert messages...

Placeholder Replaced with
{{open}} The opening price of the current candle.
{{high}} The high price of the current candle.
{{low}} The low price of the current candle.
{{close}} The closing price of the current candle. AKA, the current price
{{volume}} The volume on the current candle.
{{time}} The current bar time (in ISO8601 format, eg: 2019-10-01T15:52:00Z)
{{timenow}} The exact time the alert was sent from TradingView (in ISO8601 format, eg: 2019-10-01T15:52:00Z)
{{ticker}} The current ticker (eg XBTUSD).
{{exchange}} The exchange the ticker is from (eg BITMEX).

What about values from my indicators?

Yes, that's possible too.

Let's say you have an indicator that gives you signals to open and close positions, and tracks a Stop Loss price and a Take Profit price for you. Ideally you want to be able to send out the SL and TP values with the alert, so you can either auto-trade using those values, or use them in manual trading.

All the indicator values that are plotted can be accessed. The Data Window (a panel on the right hand side of TradingView) shows you all the values exposed by an indicator.

Below are the placeholders for plotted values in your indicators...

Placeholder Replaced with
{{plot_0}} The value of the first plot in your indicator.
{{plot_1}} The value of the second plot in your indicator.
... and so on...

Working out the exact order of your plots, so you know which one is which is a little fiddly at the moment and will likely require a bit of trial and error and testing. Check the order in the Data Panel - that will be a great place to start. If you wrote the indicator in PineScript, then it should be the order your plot() calls appear in the script.

Using the names of plots

You can also refer to the names of each of the plots, which can easier to use. The name is the title given to the plot in pinescript.

Placeholder Replaced with
{{plot("Name")}} The value of the plot with the title Name in your indicator.

Values available in Strategy Alerts

If your alerts are being generated from a strategy script on TradingView, there is a separate set of values that you can access...

Placeholder Replaced with
{{strategy.position_size}} returns the value of the same keyword in Pine, i.e., the size of the current position.
{{strategy.order.action}} returns the string “buy” or “sell” for the executed order.
{{strategy.order.contracts}} returns the number of contracts of the executed order.
{{strategy.order.price}} returns the price at which the order was executed.
{{}} returns the ID of the executed order (the string used as the first parameter in one of the function calls generating orders: strategy.entrу, strategy.exit or strategy.order).
{{strategy.order.comment}} returns the comment of the executed order (the string used in the comment parameter in one of the function calls generating orders: strategy.entrу, strategy.exit or strategy.order). If no comment is specified, then the value of will be used.
{{strategy.order.alert_message}} returns the value of the alert_message parameter which can be used in the strategy's Pine code when calling one of the functions used to place orders: strategy.entrу, strategy.exit or strategy.order. This feature is only supported in Pine v4.
{{strategy.market_position}} returns the current position of the strategy in string form: “long”, “flat”, or “short”.
{{strategy.market_position_size}} returns the size of the current position.
{{strategy.prev_market_position}} returns the previous position of the strategy in string form: “long”, “flat”, or “short”.
{{strategy.prev_market_position_size}} returns the size of the previous position.

How can I use this...

Let's make an automated trading command to open an order, set a stop loss and take profit using the price given in an imaginary indicator we might have that plots the take profit line and stop loss line.

We'll assume that the Stop Loss price turns out to be in plot 1, and the take profit price in plot 2.

myApiKeys({{ticker}}) {
    marketOrder(side=buy, amount=100);
    stopOrTakeProfit(side=sell, amount=100, sl=@{{plot_1}}, tp=@{{plot_2}})

We are using the special 'absolute price' notation for sl=... and tp=.... For example, to set at stop loss at the exact price of $10,000 (regardless of what the current price is), the automated trading bot allows us to write sl=@10000. In the example above, {{plot_1}} and {{plot_2}} are replaced with the target prices.

Learn More...

Some images from Unsplash


Your TradingView alerts, with automated trading, with charts, PM'd to you.
Auto-trade on any alert.

Automate Trading

Trigger orders on popular cryptocurrency exchanges and trade 24/7. Access powerful algorithmic orders to maximise your profits.

Capture Charts

See a high quality chart with every alert, captured at the moment the alert was triggered. See exactly what the market was doing and make informed decisions.


Connect your alerts to Telegram (channels, groups and private chats), Discord, Slack, email or send push notifications to other services with webhooks.

Easy To Setup

Nothing to install and no browser extensions. Captures alerts 24/7, even with your computer switched off. Be up and running in seconds.

Related content


Getting started with Alertatron Groups

We're all familiar with email. All your incoming emails arrive in your Inbox, but as we receive so many, most email services offers lots of ways to help you organise them into folders as they arrive. These are called all sorts of things, from folders and groups, to filters, labels, smart folders and many more.

Read more


Adjusting the symbol and time interval on saved TradingView charts

TradingView has a feature that lets you view any of your shared charts using a different symbol or time interval to the one used on the saved chart. Alertatron offers a couple of ways you can use this to adjust your charts for each alert that arrives.

Read more


Keeping your alerts organized

It's too easy to end up with all your alerts mixed up in a big mess. Here's how we recommend you keep things organised and ensure you see the right alerts in the right places at the right times.

Read more


Making use of groups

Groups provide a powerful way to filter your alerts into different categories. Each group can have its own set of integrations linked to it so each group can forward alerts to different places.

Read more


Troubleshooting guide

Answers to common questions and problems

Read more


Sending alerts to Telegram

Telegram is our most popular integration, so it makes sense to include a step by step guide to help you get started. Each Telegram integration you add can send alerts to a single chat, group or channel, and there are a couple of simple steps to go through to securely link up Alertatron and your chat session.

Read more


Getting alerts from TradingView

It's simple to ensure that every alert you have configured in TradingView comes straight through to Alertatron, ready to be sent on to places like Telegram or Discord. Let's get started...

Read more


How to capture a chart with your TradingView alerts

When you get an alert from a trading signal, via TradingView, it is so useful to be able to glance at a relevant chart immediately. Alertatron can attach a snapshot of your charts to your alerts if you like.

Read more


Getting alerts from web services

Many services can announce interesting events by calling a magic URL called a Webhook. By entering your unique Alertatron webhook address to these services, you can pass those alerts on to any supported integration, like Telegram or Discord.

Read more