> ## 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

<video
  autoPlay
  muted
  loop
  playsInline
  className="w-full rounded-2xl"
  style={{
border: "1.9px solid rgba(179, 200, 224, 0.08)",
objectFit: "fill",
display: "block"
}}
  src="https://mintlify.s3.us-west-1.amazonaws.com/takeprofit-a5dc0462/images/guide/alerts/using-variables/2.16.12_%20Variable_Placeholders.mp4"
/>

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

<video
  autoPlay
  muted
  loop
  playsInline
  className="w-full rounded-2xl"
  style={{
border: "1.9px solid rgba(179, 200, 224, 0.08)",
objectFit: "fill",
display: "block"
}}
  src="https://mintlify.s3.us-west-1.amazonaws.com/takeprofit-a5dc0462/images/guide/alerts/using-variables/2.16.13_Change_mode.mp4"
/>

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.)                                                                                                                                                                        |
| `{{ticker}}`                             | Symbol of the instrument (TSLA, AAPL)                                                                                                                                                                     |
| `{{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                                                                                                                                                                                     |
| `{{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}}`                           | Current time when alert triggers                                                                                                                                                                          |

### 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.</Note>
