OPEN-SOURCE SCRIPT

Alpha Chart Patterns [AlphaGroup.Live]

335
What it does
Automatically detects classical patterns and draws clean, price-anchored annotations with a single, text-only label per pattern (no filled background). Each label includes the pattern name and bias (Bullish/Bearish). Uses confirmed pivots, so it’s non-repainting after confirmation.

Detected patterns:

  • Double Top / Double Bottom
  • Head & Shoulders / Inverse H&S
  • Triangles: Ascending, Descending, Symmetrical


How it works
The script builds swing structure from confirmed pivot highs/lows. Tolerance and minimum swing filters keep only meaningful structures. Triangle detection looks for falling highs / rising lows (or flat sides) within a configurable window. Drawings and labels are anchored to bar_index and the price scale so they follow candles when you pan/zoom.

Inputs
  • Pivot Left/Right Bars: pivot sensitivity (higher = stricter, fewer signals).
  • Level Tolerance (%): how close “equal” highs/lows must be (double tops/bottoms, flat triangle sides).
  • Min Swing Size (%): filters out tiny wiggles.
  • Triangles Window (bars): max span used when validating triangles.
  • Max Lookback (bars): limits how far back objects are drawn.
  • Label Offset (ATR): vertical offset for labels to avoid covering price.
  • Draw Necklines / Borders: toggle helper lines.
  • Bullish/Bearish Text & Line Colors + Neutral Line Color: fully editable to match light/dark themes.


Alerts
One-shot alerts are provided for each pattern. After adding the script to your chart:
Create Alert → Condition: this script → choose the specific pattern event (e.g., “Ascending Triangle”). Alerts trigger once per newly labeled instance.

Tips
  • If drawings ever appear detached after manual scale changes, enable Pin to right scale in the script’s Style (or just toggle the indicator once).
  • For noisier markets/timeframes, increase Pivot Bars and/or Min Swing.
  • Combine with trend/volume for confirmation.


Non-repainting note
Patterns are confirmed using completed pivots (labels appear only after the swing completes), so past signals don’t repaint.

Known limitations
Classical pattern recognition is heuristic by nature. Structures can overlap, and triangle classifications may vary with tolerance choices. Tune inputs to your instrument/timeframe.

Open-source
Pine Script v6. Clone, tweak, and share improvements. Please credit “Alpha Chart Patterns” if you fork.

Change log
v1.0 — Initial release: DT/DB, H&S/Inverse, Asc/Desc/Sym triangles, editable colors, minimal labels, price-anchored drawings, one-shot alerts.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。