> For the complete documentation index, see [llms.txt](https://docs.pinescriptstrategy.com/tools/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pinescriptstrategy.com/tools/tips-and-tricks/how-to-create-an-alert.md).

# How To Create An Alert?

The PSStrategyX tool comes with automated built in alerts for many different conditions including:

* Open Position
* Close Position
* Close All Positions
* Cancel Position&#x20;
* Cancel All Positions
* Set Take Profit and Stop Loss For Position
* Shut Down&#x20;
* More to be added....

All of these alerts are automatically converted into the correct syntax so your strategy can be connected with an exchange. So you only have to do one thing when you set an alert.

### Here's what you do

When your ready to start auto trading open up the "Alert" tab.&#x20;

<figure><img src="/files/fGhwLEFyx4lDrCCH3opi" alt=""><figcaption><p>Click Alert on TradingView</p></figcaption></figure>

Set the "Condition" to PSStrategyX with "Order fills and alert() function calls"

You can add whatever "Alert name" you like or keep it blank. It doesn't matter.

Finally, in the "Message" you need to use this special placeholder \
`{{strategy.order.alert_message}}`

<figure><img src="/files/HFPm3H3io9822KoW2G25" alt=""><figcaption><p>The alert popup in tradingview</p></figcaption></figure>

Once you're done, you can click "Create" and your strategy is live! You can delete the indicators from the chart if you wish, or set up another strategy! There's no known limit to how many bots you can run as long as they are running on different exchanges (there is currently no way to specify different order ids)&#x20;

<figure><img src="/files/MbAPZ1ZtVyXhfgOFhcCx" alt="What working alerts look like in TradingView with PSStrategyX"><figcaption><p>What working alerts look like in TradingView with PSStrategyX</p></figcaption></figure>

{% hint style="info" %}
Note: If you want to make changes to your strategy, those changes will not be reflected in the alert. Once set, the alert cannot be modified. Any changes will have to set in a new alert.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.pinescriptstrategy.com/tools/tips-and-tricks/how-to-create-an-alert.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
