> ## Documentation Index
> Fetch the complete documentation index at: https://takeprofit.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Variables in Alerts

> Put live values into an alert message with variables, so the notification tells you what the price and the indicator were when it fired.

Create powerful, informative alerts by incorporating dynamic data directly in your alert messages.

### Variable Placeholders

You can customize alert messages with real-time data using special placeholders. For example:

```
{{ticker}}:{{exchange}} {{condition_type}} {{condition_source_1}}
```

When triggered, this might display as: `TSLA:NASDAQ Crossing Down 144.68`

### Message Formatting Options

Switch between two formatting modes:

* **Plain Text Mode**: Type variables manually
* **JSON Mode**: Click variables to insert them or use the "+" icon to add new ones

### Available Variables

| Variable | Description |
| - | - |
| `{{exchange}}` | Trading venue (NASDAQ, NYSE, etc.) |
| `{{exchange_code}}` | Short code of the trading venue |
| `{{ticker}}` | Symbol of the instrument (TSLA, AAPL) |
| `{{exchange_ticker}}` | Instrument together with its venue |
| `{{time_frame}}` | Chart timeframe (1m, 1h, D) |
| `{{session}}` | Trading session (regular, extended) |
| `{{condition_type}}` | Alert trigger type (crossing, reaching) |
| `{{open}}` | Opening price of the bar |
| `{{high}}` | Highest price of the bar |
| `{{low}}` | Lowest price of the bar |
| `{{close}}` | Closing price of the bar, or current price of the intrabar |
| `{{volume}}` | Trading volume |
| `{{time}}` | Time of the price bar |
| `{{timestamp}}` | Time of the price bar as a raw timestamp — useful when the message feeds an automated process |
| `{{condition_source_0}}` | The first series value (e.g., 144.68) |
| `{{condition_source_1}}` | Second series value (if applicable) |
| `{{condition_source_2}}` | Third series value (if applicable) |
| `{{cond<i>.src<k>}}` | i from \[0, 4], k from \[0, 2]. The value if i-th condition's k-th series. `{{cond0.src<k>}}` is an alias for `{{condition_source_k}}` |
| `{{cond<i>.<main/secondary>.<line_id>}}` | i is the number of condition for multicondition alerts, main for Source indicator in condition, secondary for Target indicator in condition, line\_id is id in the indicator code in @plot.line decorator |
| `{{time_now}}` / `{{timenow}}` | Time the alert triggered — both spellings work |
| `{{timestamp_now}}` | Time the alert triggered, as a raw timestamp |

> [!NOTE]
>
> Not every variable appears in the autocomplete dropdown, and the editor may flag one as unrecognized. Type it into the message anyway — as long as the name is spelled correctly inside `{{ }}`, it is substituted when the alert fires.

### Examples

Simple price alert:

```
Alert: {{ticker}}:{{exchange}} {{condition_type}} {{condition_source_1}} 
```

Multi-condition alert:

```
Alert: {{ticker}}:{{exchange}} crossing {{cond0.src1}} AND {{ticker}}:{{exchange}} crossing {{cond1.src1}} AND {{ticker}}:{{exchange}} crossing {{cond2.src1}} 
```

> [!NOTE]
>
> `src1` is a fixed parameter name. It stays `src1` no matter what source you select (price, indicator, or constant).
> You can’t change the number — `src2` or other variants don’t exist.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.