> For the complete documentation index, see [llms.txt](https://infinity.aloen.to/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinity.aloen.to/infinity-algo-features/alerts.md).

# 警报 Alerts

{% hint style="warning" %}
注意：使用非回测版本
{% endhint %}

Infinity Algo V3.0 提供可定制的告警 (customizable alerts)，帮助你及时了解重要的交易机会和市场情况。设置告警有助于确保对关键信号的及时响应，直接提升你的交易效果。

***

## 📋 如何设置告警

{% tabs %}
{% tab title="🖥️ 桌面版 (Desktop)" %}
**桌面告警设置**

**步骤 1：打开告警对话框**

在 TradingView 图表上**右键**或按 `ALT + A`

![告警菜单访问](https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2FXLsh0U6f3GJRD1zymbhY%2Fimage.png?alt=media\&token=6bfd123c-15dc-44d0-92aa-d13d01e2a496)

**步骤 2：选择指标**

从指标列表中选择 **Infinity Algo V3.0**

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2F2c4bk0cdIb4Unzt8eURK%2Fimage.png?alt=media&#x26;token=2aadb06a-0cfc-4990-aa63-afd5d106c1a0" alt="" width="375"><figcaption><p>指标选择</p></figcaption></figure>

**步骤 3：配置告警**

从可用选项中选择你偏好的告警条件

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2FGmfnqhfwBmsPCPm503wh%2Fimage.png?alt=media&#x26;token=c371c0b2-dad9-4585-96a3-c824744ddab8" alt="" width="375"><figcaption><p>告警选择</p></figcaption></figure>

**步骤 4：配置通知**

从可用选项中选择你偏好的通知方式

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2FfXhC70DVvUj1bM2PASka%2Fimage.png?alt=media&#x26;token=67838085-8031-4aa2-822c-27003666c5cf" alt="" width="375"><figcaption><p>TradingView 通知</p></figcaption></figure>
{% endtab %}

{% tab title="📱 移动版 (Mobile)" %}
**移动告警设置**

**步骤 1：点击设置**

点击右下角的**设置**图标

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2F0PNBkESkWOZbQUswKVlr%2FIMG_0638.PNG?alt=media&#x26;token=1095dd53-39f3-46f6-ac72-3d40783bf6be" alt="Settings Button" width="375"><figcaption><p>底部工具栏中的设置</p></figcaption></figure>

**步骤 2：点击告警**

从工具菜单中选择**告警 (Alerts)**

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2FRXKvtESkHP04S4vmjWBR%2FIMG_0636.PNG?alt=media&#x26;token=098ad89c-2a8b-481f-b424-824a6219585c" alt="Alerts Option" width="375"><figcaption><p>分析中心 (Analysis Hub) 中的告警</p></figcaption></figure>

**步骤 3：点击创建告警**

点击\*\*创建告警 (Create alert)\*\*按钮

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2F1u5Y0dZSESEGf2FE8FDo%2FIMG_0637.PNG?alt=media&#x26;token=49e98983-4407-4168-ab52-f0cce08496ab" alt="Create Alert Button" width="375"><figcaption><p>创建新告警</p></figcaption></figure>

**步骤 4：选择 Infinity Algo**

从条件下拉菜单中选择 **Infinity Algo V3.0**

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2FbtopX47qjJ559RtBAQbQ%2FIMG_0642.png?alt=media&#x26;token=c07b5862-d5f3-4a48-ba3d-ac2c03438583" alt="Select Infinity Algo" width="375"><figcaption><p>条件中的 Infinity Algo</p></figcaption></figure>

**步骤 5：选择告警类型**

从列表中选择你需要的信号

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2FAkbR5cbi75NDKy5aRizc%2FIMG_0643.PNG?alt=media&#x26;token=c28281f1-b9af-4e6e-a55b-15d038fccb86" alt="Alert Type Selection" width="375"><figcaption><p>可用的告警信号</p></figcaption></figure>

**步骤 6：选择通知类型**

启用你偏好的通知方式

<figure><img src="https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2F9R6TFyYsArkmeSePsVRd%2FIMG_0640.PNG?alt=media&#x26;token=c3544d43-28d2-417e-9be6-93d97648a816" alt="Notification Settings" width="375"><figcaption><p>通知选项</p></figcaption></figure>
{% endtab %}
{% endtabs %}

***

### 🎯 可用的告警条件

**快速参考表**

| 信号类型        | 告警数值          | 触发设置                        | 用途   |
| ----------- | ------------- | --------------------------- | ---- |
| **📈 做多入场** | `1.0` - `1.4` | 仅在柱线收盘 (Once Per Bar Close) | 买入信号 |
| **📉 做空入场** | `1.5` - `1.9` | 仅在柱线收盘                      | 卖出信号 |
| **💰 止盈**   | `2.0` - `2.1` | 每柱线触发一次 (Once Per Bar)      | 利润目标 |
| **🛡️ 止损**  | `2.2` - `2.3` | 每柱线触发一次                     | 风险管理 |
| **⏰ 预信号**   | `2.4` - `2.5` | 仅在柱线收盘                      | 早期预警 |

**详细告警选项**

{% tabs %}
{% tab title="📈 入场信号 (Entry Signals)" %}
**买入信号**

* **`1.0` 买入信号 - 普通型** → 逆趋势买入信号
* **`1.1` 买入信号 - 智能型** → 趋势跟踪型买入信号
* **`1.2` 普通或智能买入** → 任一类型的触发
* **`1.3` 买入信号 - HL 狙击型** → 高精度买入入场信号
* **`1.4` 买入信号 - AI** ⭐ → AI 优化的信号

**卖出信号**

* **`1.5` 卖出信号 - 普通型** → 逆趋势卖出信号
* **`1.6` 卖出信号 - 智能型** → 趋势跟踪型卖出信号
* **`1.7` 普通或智能卖出** → 任一类型的触发
* **`1.8` 卖出信号 - HL 狙击型** → 高精度卖出入场信号
* **`1.9` 卖出信号 - AI** ⭐ → AI 优化的信号

{% hint style="info" %}
**AI 告警**：`1.4` 和 `1.9` 告警适用于标准 AI 模式和 AI 狙击 (AI Sniper) 模式
{% endhint %}
{% endtab %}

{% tab title="💰 出场告警 (Exit Alerts)" %}
**止盈告警**

* **`2.0` 做多止盈** → 做多头寸的利润目标已触及
* **`2.1` 做空止盈** → 做空头寸的利润目标已触及

**止损告警**

* **`2.2` 做多止损已触发** → 做多头寸的止损已触发
* **`2.3` 做空止损已触发** → 做空头寸的止损已触发

{% hint style="warning" %}
**重要**：使用"每柱线触发一次 (Once Per Bar)"以确保在价格触及水平时立即触发
{% endhint %}
{% endtab %}

{% tab title="⏰ 预信号 (Pre-Signals)" %}
**早期预警系统**

* **`2.4` 可能的做多信号** → 潜在的买入信号即将出现
* **`2.5` 可能的做空信号** → 潜在的卖出信号即将出现

这些告警帮助你为即将到来的机会做好准备，而无需误触发。
{% endtab %}
{% endtabs %}

***

### ⚠️ 关键告警设置

{% hint style="danger" %}
**必读**：不正确的触发设置会导致错过交易或产生虚假告警！
{% endhint %}

**入场信号配置**

| 设置        | 值                             | 原因                      |
| --------- | ----------------------------- | ----------------------- |
| **触发方式**  | `仅在柱线收盘` (Once Per Bar Close) | 确认信号在蜡烛图 (candle) 收盘时触发 |
| **为什么重要** | ✅ 防止虚假告警 (灯芯触发)               | 避免过早入场                  |
| **切勿使用**  | ❌ `每柱线触发一次` (Once Per Bar)    | 会在临时价格波动时触发             |

**出场信号配置**

| 设置        | 值                               | 原因                           |
| --------- | ------------------------------- | ---------------------------- |
| **触发方式**  | `每柱线触发一次` (Once Per Bar) 或更快    | 需要立即执行 (immediate execution) |
| **为什么重要** | ✅ 即时止盈/止损触发                     | 保护利润并限制亏损                    |
| **切勿使用**  | ❌ `仅在柱线收盘` (Once Per Bar Close) | 会延迟出场直到蜡烛图收盘                 |

***

### 🧩 可选 - TradingView 变量 (Placeholders) — 高级应用

将这些添加到**告警消息**中，使你的告警包含实时数据。

**高级应用：(适用于指标告警)**

| 占位符                                   | 含义                | 示例                     |
| ------------------------------------- | ----------------- | ---------------------- |
| `{{exchange}}`                        | 交易所               | `BINANCE`              |
| `{{ticker}}`                          | 交易对/代码            | `BTCUSDT`              |
| `{{interval}}`                        | 图表时间周期 (see note) | `15` (=15 分钟)          |
| `{{time}}`                            | 柱线时间 (UTC)        | `2025-01-01T12:00:00Z` |
| `{{timenow}}`                         | 告警触发时间 (UTC)      | `2025-01-01T12:00:03Z` |
| `{{open}} {{high}} {{low}} {{close}}` | 柱线的开高低收价格         | `43250.5`              |
| `{{volume}}`                          | 柱线成交量             | `1234.56`              |
| `{{syminfo.currency}}`                | 计价货币              | `USD`                  |
| `{{syminfo.basecurrency}}`            | 基础货币 (外汇/加密货币对)   | `BTC` 或 `na`           |

**工作原理**

{% columns %}
{% column width="50%" %}
**步骤 1：创建模板** 在告警消息中添加占位符：

![告警设置](https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2FGYSnPELERloNa2Nw8O9j%2Fimage.png?alt=media\&token=f77902ab-dcd0-47ea-a84f-e7d8d558cfbf)

```
🟢 做多信号 - {{ticker}}

📍 市场信息
交易所: {{exchange}}
交易对: {{ticker}}
计价货币: {{syminfo.currency}}
基础货币: {{syminfo.basecurrency}}

📈 价格数据
开盘: {{open}}
最高: {{high}}
最低: {{low}}
收盘: {{close}}
成交量: {{volume}}

⏱️ 时间信息
时间周期: {{interval}}
柱线时间: {{time}}
告警触发时间: {{timenow}}
```

{% endcolumn %}

{% column %}
**步骤 2：获取实时数据** 收到告警后，变量会被替换为实际值

![告警输出](https://2387257950-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5cf3dRpPzq1Qbyc8GksH%2Fuploads%2FYTQcaYYNrQ1CnyNOomEL%2Fimage.png?alt=media\&token=07938767-0762-41c1-8911-4e75a14eeb9d)
{% endcolumn %}
{% endcolumns %}

<details>

<summary><strong>快速复制模板</strong></summary>

**简单版做多**

```
🟢 做多 {{ticker}} @ {{close}}
{{exchange}} | {{interval}} | {{timenow}}
```

**详细版做多**

```
🟢 买入信号已触发
交易对: {{ticker}}
入场价: {{close}}
交易所: {{exchange}}
时间周期: {{interval}}
成交量: {{volume}}
时间: {{timenow}}
```

**专业版做多**

```
═══ 做多入场 ═══
{{exchange}}:{{ticker}}
价格: {{close}}
波幅: {{low}} - {{high}}
成交量: {{volume}}
时间周期 {{interval}}
═════════════════
```

#### 📉 **做空/卖出信号**

**简单版做空**

```
🔴 做空 {{ticker}} @ {{close}}
{{exchange}} | {{interval}} | {{timenow}}
```

**详细版做空**

```
🔴 卖出信号已触发
交易对: {{ticker}}
入场价: {{close}}
交易所: {{exchange}}
时间周期: {{interval}}
成交量: {{volume}}
时间: {{timenow}}
```

**风险关注版做空**

```
⚠️ 做空头寸已开启
{{ticker}} 于 {{close}}
每日最高: {{high}}
风险等级: 密切关注
时间: {{timenow}}
```

#### 💰 **止盈 (TP)**

**做多止盈已触发**

```
✅ 止盈 (做多)
{{ticker}}: 目标价于 {{close}} 已触及
入场 → 出场: 利润已锁定
{{interval}} | {{timenow}}
```

**做空止盈已触发**

```
✅ 止盈 (做空)
{{ticker}}: 目标价于 {{close}} 已触及
做空头寸已平仓
{{interval}} | {{timenow}}
```

**多阶段止盈告警**

```
💰 止盈水平已触及 - {{ticker}}
价格: {{close}}
建议部分止盈
保持剩余头寸
时间: {{timenow}}
```

#### 🛡️ **止损 (SL)**

**做多止损已触发**

```
🛑 止损 (做多)
{{ticker}}: 止损于 {{close}} 已触发
头寸已平仓 - 风险管理有效
{{interval}} | {{timenow}}
```

**做空止损已触发**

```
🛑 止损 (做空)
{{ticker}}: 止损于 {{close}} 已触发
做空头寸已平仓
{{interval}} | {{timenow}}
```

**紧急止损**

```
⚠️ 止损已触发 ⚠️
{{ticker}} @ {{close}}
立即行动: 头寸已平仓
保护资金
时间: {{timenow}}
```

#### ⏰ **可能的信号 (预告警)**

**可能的做多设置**

```
⏳ 可能的做多设置
{{ticker}} 正在准备入场
当前: {{close}}
关注水平: {{high}}
时间周期: {{interval}}
待命中...
```

**可能的做空设置**

```
⏳ 可能的做空设置
{{ticker}} 正在准备入场
当前: {{close}}
关注水平: {{low}}
时间周期: {{interval}}
待命中...
```

</details>

### 🔍 故障排查指南

| 问题          | 可能的原因   | 解决方案                                                           |
| ----------- | ------- | -------------------------------------------------------------- |
| **告警未触发**   | 信号模式错误  | <p>• 验证设置是否匹配告警设置<br>• 检查是否为"仅在柱线收盘"<br>• 如使用 AI 告警，请启用 AI</p> |
| **告警过多**    | 敏感度设置过低 | <p>• 使用组合告警<br>• 增加敏感度<br>• 切换至更高时间周期</p>                      |
| **虚假告警**    | 触发设置错误  | <p>• 入场使用"仅在柱线收盘"<br>• 检查是否重绘 (repainting)<br>• 验证时间周期</p>     |
| **缺少止盈/止损** | 触发类型错误  | <p>• 必须使用"每柱线触发一次"<br>• 不能使用"仅在柱线收盘"</p>                       |

***

### 💡 专业建议及最佳实践

#### 告警命名规范

#### 告警管理

* **清晰命名告警** - 包括时间周期和信号类型
* **预先测试告警** - 使用 "Once" 频率验证设置
* **使用告警消息** - 使用代码、时间周期和操作自定义
* **考虑多个时间周期** - 在不同图表上设置告警
* **定期审查** - 随着市场情况的变化更新告警

#### 移动通知

* 在 TradingView 移动应用中启用推送通知
* 配置电子邮件告警作为备份
* 考虑对自动化系统进行 webhook 集成 (webhook integration)

***

### ✅ 总结检查清单

{% hint style="info" %}
**记住这些关键点：**

* ✅ 入场信号：`仅在柱线收盘`
* ✅ 出场信号：`每柱线触发一次`或更快
* ✅ AI 告警适用于两种 AI 模式
* ✅ 清晰描述告警名称
* ✅ 在实盘交易前进行测试
* ✅ 定期审查设置
  {% endhint %}

遵循这些指南，你将充分利用 Infinity Algo 的告警系统，并且永远不会错过重要的交易机会。


---

# 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://infinity.aloen.to/infinity-algo-features/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.
