Symmetrical Triangle Detector
- 指标
-
Augusto Martin D'anna
你好,欢迎访问我的个人资料。我是 Augusto Danna,拥有7年经验的交易员。我擅长结合市场经验与编程技能来实现交易策略的自动化。如有任何疑问,欢迎随时联系我!
自动交易系统: 开发 MT4 和 MT5 的智能交易系统 (Expert Advisors)。
自定义指标: 开发和修改技术指标。
高级风险管理: 实施移动止损 (Trailing Stop)、保本 (Breakeven) 和动态手数计算。
策略转换: 将 TradingView (Pine Script) 策略转换为 MQL4/MQL5。
策略优化: 策略回测与参数调整。 - 版本: 1.0
Symmetrical Triangle Detector finds horizontal symmetrical triangles with objective rules and draws them up to the apex. Most traders draw triangles by eye; this indicator uses fixed, measurable criteria, so the same chart always gives the same triangles. It uses closed bars only and does not repaint.
What counts as a triangle
- Pivots with N bars on each side, joined in an alternating zigzag.
- The last 4 to 8 pivots: the upper line joins the first and last high, the lower line the first and last low, and the other pivots stay inside.
- At least 3 touches on one line and 2 on the other.
- Symmetric: the upper line falls, the lower line rises, and the steeper slope is at most 4 times the flatter one.
- Horizontal and compact: the middle axis barely moves, the lines are not too steep and the pattern is not too tall.
- Clean: no wick or candle body breaks the lines between the first and the last touch, and enough candles reach the lines (no empty space).
- The apex is ahead of the last touch and not too far away.
All thresholds are measured in ATR(14), so the indicator adapts to any market and timeframe.
What it draws
- Both lines from the first touch to the apex, with the touches numbered.
- An arrow at the breakout (the first wick out of the lines, or a close outside the lines from the 0.75 time mark on), or the pattern ends at the apex.
- Optional Gann box from the first touch to the apex: price levels 0 / 0.5 / 1 and time lines at 0.75 and 0.9.
- Optional alerts when a new triangle appears and when it breaks.
Notes
- This is a pattern detection tool, not a trading signal. In my own tests, trading the breakout or the false breakout of these triangles had no edge after costs on gold, Nasdaq and Bitcoin, so use it as context for your own analysis.
- Defaults were calibrated on BTCUSD M5 and XAUUSD M15. On other markets you may want to adjust the touch tolerance, minimum width and maximum height.
- It is a port of my open-source "Horizontal Symmetrical Triangle Detector" for TradingView, with the same detection rules.
