# Alerts

{% stepper %}
{% step %}

### Add Alert

<div data-with-frame="true"><figure><img src="/files/GPCTYe40mO03zI4s9KA1" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Set Condition and Expiration Date

<div data-with-frame="true"><figure><img src="/files/1AOzOvGAOSdlwdOfbKZE" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Customize the Alert Message

<mark style="color:$info;">Enter a clear</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**Alert Name**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">and edit the</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**Message**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">that will appear when the alert triggers.</mark>\ <mark style="color:$info;">You can also add</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**placeholders**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">like</mark>

* `{{ticker}}` <mark style="color:$info;">- ticker of the symbol used in alert (AAPL, BTCUSD, etc.)</mark>
* `{{interval}}`  <mark style="color:$info;">- returns the interval (i.e. timeframe/resolution) of the chart that the alert is created on</mark>
* `{{strategy.position_size}}` <mark style="color:$info;">- returns the value of the same keyword in Pine, i.e., the size of the current position.</mark>
* `{{strategy.order.action}}` <mark style="color:$info;">- returns the string “buy” or “sell” for the executed order.</mark>
* `{{strategy.order.contracts}}` <mark style="color:$info;">- returns the number of contracts of the executed order.</mark>
* `{{strategy.order.price}}` <mark style="color:$info;">- returns the price at which the order was executed.</mark>
* `{{strategy.order.id}}` <mark style="color:$info;">- returns the ID of the executed order (the string used as the first parameter in one of the function calls generating orders: strategy.entry, strategy.exit or strategy.order).</mark>
* `{{strategy.order.comment}}` <mark style="color:$info;">- returns the comment of the executed order (the string used in the comment parameter in one of the function calls generating orders: strategy.entry, strategy.exit or strategy.order). If no comment is specified, then the value of</mark> <mark style="color:$info;"></mark>*<mark style="color:$info;">strategy.order.id</mark>* <mark style="color:$info;"></mark><mark style="color:$info;">will be used.</mark>
* `{{strategy.order.alert_message}}` <mark style="color:$info;">- 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.entry, strategy.exit or strategy.order. This feature is only supported in Pine v4 and higher.</mark>
* `{{strategy.market_position}}` <mark style="color:$info;">- returns the current position of the strategy in string form: “long”, “flat”, or “short”.</mark>
* `{{strategy.market_position_size}}` <mark style="color:$info;">- returns the size of the current position as an absolute value, i.e. a non-negative number.</mark>
* `{{strategy.prev_market_position}}` <mark style="color:$info;">- returns the previous position of the strategy in string form: “long”, “flat”, or “short”.</mark>
* `{{strategy.prev_market_position_size}}` <mark style="color:$info;">- returns the size of the previous position as an absolute value, i.e. a non-negative number.</mark>

<div data-with-frame="true"><figure><img src="/files/hg85Xf5w1h3t4xRm0aRD" alt=""><figcaption></figcaption></figure></div>

**Example:**\ <mark style="color:$info;">Alert name: SMC Backtester</mark>\ <mark style="color:$info;">Message:</mark>&#x20;

{\
"symbol":"{{ticker}}"\
"size":"{{strategy.order.action}}"\
"qty":"{{strategy.position\_size}}"\
"price":"{{close}}"\
"trigger\_time":"{{timenow}}"\
}
{% endstep %}

{% step %}

### Click **Create Alert**

<mark style="color:$info;">Once all settings are configured — click</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**Create Alert**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">to activate it.</mark>\ <mark style="color:$info;">Your alert will now monitor the (SMC) Backtester trades automatically and send a notification as soon as the trade appears.</mark>
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bigbeluga.com/backtesters/smart-money-backtester/alerts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
