Coral
- 指标
-
Ulises Calderon Bautista
I am a candidate for Actuary with a strong expertise in the field of insurance and social security, in addition to being an active investor with a talent for mathematics. My passion for programming and finance drives my constant pursuit of learning and improvement. - 版本: 1.0
### 🇨🇳 Coral Trend Indicator v1.0
Coral Trend Indicator 是 LazyBear 在 TradingView 上发布的脚本(超过 10,900 次收藏)向 MetaTrader 4 和 MetaTrader 5 的忠实移植。它将 Tim Tillson 的 T3 移动平均算法(1998年)实现为价格图表上的彩色趋势过滤线。
#### 工作原理
该指标将价格依次通过六级指数移动平均线(EMA),然后使用由 Constant D 参数推导的二项式多项式系数,将第 3 至第 6 级进行合成。与同等平滑度的单一移动平均线相比,生成的曲线更平滑且滞后更小。
趋势方向通过斜率判定:
- **上升趋势**:当前值高于前一根K线的值(绿线)
- **下降趋势**:当前值低于前一根K线的值(红线)
- **中性**:K线之间无变化(蓝线)
#### 显示功能
- 价格图表上绘制变色趋势线
- 三态着色:绿色(上升)、红色(下降)、蓝色(中性)
- 可选的按趋势方向着色K线模式(仅限MQL5)
- 趋势变化时的多通道报警系统(弹窗、声音、推送通知、邮件)
#### 参数
| 参数 | 默认值 | 说明 |
|---|---|---|
| Smoothing Period | 21 | 过滤器长度 — 值越大输出越平滑 |
| Constant D | 0.4 | 容量因子(0.0–2.0)— 控制响应速度与平滑度的平衡 |
| Applied Price | Close | 用于计算的价格类型 |
| Show Trend Line | true | 在图表上显示Coral线 |
| Color Bars | false | 按趋势方向着色K线(仅限MQL5) |
| Line Width | 3 | 趋势线粗细(1–5) |
| Enable Alerts | false | 启用报警系统 |
| Alert: Popup | true | 趋势变化时弹出报警 |
| Alert: Sound | false | 趋势变化时播放声音 |
| Alert: Push | false | 趋势变化时发送推送通知 |
| Alert: Email | false | 趋势变化时发送邮件 |
#### 关键特性
- 不重绘:报警仅在已确认的K线上触发
- 兼容所有交易品种和时间周期
- 初始化时预计算系数,确保高效的逐笔处理
- Smoothing Period 21 对应 T3 周期 11
#### 原始来源
Coral Trend Indicator [LazyBear] — TradingView,2015年1月14日发布
