# Alerts

## Overview

Lune Automated Strategies support a fully configurable **alert system** within TradingView, giving users real-time notifications for **entries**, **exits**, and **partial exits**. These alerts can also be used in combination with [**Lune Auto Trader**](broken://pages/xDKwyCxKwYiTzUOK8bIC) to enable automated trade execution based on signal events.

The alert system allows users to define custom messages, select alert types, and configure how TradingView should handle these notifications.

{% hint style="info" %}
If you're using [**Lune Auto Trader**](broken://pages/CPnGv5FO8y4yofaBHnCx), alerts generated through this system can be used to automate your trades.\
Refer to this guide to get started with Lune Auto Trader automation: [Automate TradingView Strategies Guide](https://docs.lunetrading.com/automated-ninjatrader-tradovate-trading-software/getting-started/automate-tradingview-strategies-guide)
{% endhint %}

### How Alerts Work

The alert system operates by using TradingView’s built-in strategy alert function. When you create an alert, you must ensure that your alert message is set to:

```
{{strategy.order.alert_message}}
```

This setting tells TradingView to listen to the alerts embedded in the Lune strategy and trigger the appropriate alert messages.

<figure><img src="/files/0ON5ELIe4jwnSUJtzS7E" alt=""><figcaption></figcaption></figure>

### Alert Settings

You can toggle alerts for the following event types In your strategy settings:

<figure><img src="/files/p1MmkQFNdk0lu96IbwsZ" alt=""><figcaption></figcaption></figure>

| Alert Type              | Description                                                        |
| ----------------------- | ------------------------------------------------------------------ |
| **Entry Alerts**        | Receive alerts when a long or short trade entry is triggered.      |
| **Exit Alerts**         | Get notified when a position is closed based on an exit condition. |
| **Partial Exit Alerts** | Alerts are triggered when partial take profit levels are reached.  |

Each alert type can be independently enabled or disabled for **long** and **short** trades.

### Custom Alert Messages

Lune allows users to define personalized alert messages for each trade event type. These messages will be included in the alert notification sent by TradingView and can be customized in the strategy settings.

<figure><img src="/files/z2lU7NizmgCUaNcwZd3j" alt="" width="160"><figcaption></figcaption></figure>

| Alert Message Field            | Purpose                                         |
| ------------------------------ | ----------------------------------------------- |
| **Entry Long Alert Message**   | Triggered when a long entry is signaled.        |
| **Entry Short Alert Message**  | Triggered when a short entry is signaled.       |
| **Exit Long Alert Message**    | Triggered when a long trade exits.              |
| **Exit Short Alert Message**   | Triggered when a short trade exits.             |
| **Long Partial Exit Message**  | Triggered on partial TP level for long trades.  |
| **Short Partial Exit Message** | Triggered on partial TP level for short trades. |

These messages are ideal for use with webhook integrations, mobile push notifications, or automated systems like **Lune Auto Trader**.

### Best Practices

* **For Automation**: Make sure to copy your custom alert message into the alert box when creating an alert in TradingView.
* **Webhook Use**: These messages can include JSON for integrations with third-party bots and systems.
* **Always** use the **alert message** `{{strategy.order.alert_message}}` when creating an alert.

## How to Set Up Alerts in TradingView

1. Open the chart with your configured Lune Automated Strategy.

<figure><img src="/files/SWKlboJsLJ6cli0goWJt" alt=""><figcaption></figcaption></figure>

2. Open your strategies settings and navigate to the Alert Configuration section. Ensure that all of the alerts are enabled. Fill out the text boxes with your desired alert message.

<figure><img src="/files/txE0ZvQp8Bnd0q4TUMlG" alt=""><figcaption></figcaption></figure>

3. Create a TradingView alert, set your alert message to `{{strategy.order.alert_message}}`. Customize your settings and notifications.
4. Click **Create**. Thats it!


---

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

```
GET https://docs.lunefi.com/automated-tradingview-trading-strategies/lune-automated-strategies/lune-momento/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.
