OPEN-SOURCE SCRIPT

Chart Patterns [FEELS]

767
Classical chart patterns, drawn only after price confirms them, each one carrying a running count of how often that pattern has reached its measured target on this chart.

No pattern appears until its neckline breaks. Once drawn, it never moves.

لقطة

FEATURES

- Four classical reversal patterns: Double Top, Double Bottom, Head & Shoulders, Inverse Head & Shoulders
- Confirmed-only: a pattern is drawn after its neckline breaks, not while it is still forming
- Non-repaint: once drawn, the geometry never changes
- Measured target and neckline plotted for every pattern
- Live per-pattern hit-rate table: how often each type reached its target on the current chart
- Target-reached and invalidated outcomes marked on the chart
- ATR-based tolerances that adapt to each symbol
- Close or wick neckline confirmation, optional weaker-second-peak filter
- Four alerts, fully adjustable colors, labels and text

WHAT IT DETECTS

Four of the most widely taught reversal patterns: Double Top, Double Bottom, Head & Shoulders, and Inverse Head & Shoulders. Each is built from confirmed swing pivots, so the shape on the chart is the same shape a trader would draw by hand.

HOW IT WORKS

The engine keeps a zigzag of confirmed swing highs and lows and checks the most recent pivots against each pattern template: two equal tops over a shared low for a Double Top, a higher head between two level shoulders for Head & Shoulders, and so on. A candidate is not shown yet. It is only drawn once price breaks through the neckline, which is the point at which the pattern is considered complete. From that bar the geometry is locked.

لقطة

- Neckline: the line the pattern breaks. Horizontal for double tops and bottoms, sloped through the two inner pivots between the shoulders and the head for Head & Shoulders and its inverse.
- Measured target: the pattern height projected from the break, drawn as a dotted line. This is the standard textbook objective, not a forecast.
- Outcome tracking: after a pattern confirms, the script follows it for a set number of bars to see whether price reached the measured target, closed back past the pattern, or did neither in time. All three outcomes feed the table.
- Hit-rate table: for every pattern type it shows how many confirmed patterns reached their target, out of every pattern that has finished tracking, as a running count on the current symbol and timeframe. Head & Shoulders reaching target less often than a Double Bottom is information, not a defect.

HOW TO READ IT

1. Wait for the break. A shape only appears after the neckline gives way, so what you see is a completed pattern, not a guess about one still forming.
2. Use the table as context. A pattern type that has historically reached its target often on this chart carries more weight than one that rarely has. The sample size is shown next to the percentage so you can judge how much to trust it.
3. The measured target is the reference objective. A pattern is only marked invalidated when price closes back past its own extreme, the high of a double top or the right shoulder of a head and shoulders, so the invalidation mark sits at that level rather than at the neckline. How you act on either is your decision.

لقطة

ORIGINALITY

This script waits for the neckline break before drawing anything, locks the geometry once a pattern is drawn, and keeps a live per-pattern tally of how each one resolved on the chart you are looking at. The idea is to combine the shape a trader would draw by hand with a running record of what happened after that shape completed, on this exact symbol and timeframe. The zigzag, the pattern templates, the neckline construction and the outcome tracking are written from scratch for this script.

HONESTY

- A swing pivot confirms only after the Swing size number of bars, so a pattern appears on the chart once its break is confirmed, and its earlier points are drawn back to where they occurred. On a bar replay this looks like a shape appearing into the past. That is the cost of the no-repaint rule, not a glitch. After a pattern is drawn its position never changes, and the break is evaluated on bar close.
- The hit-rate table is a historical count on the current symbol and timeframe. Reaching target means price hit the measured objective within the tracking window; a pattern that neither reached target nor closed back past its extreme within that window counts against the rate, not as a skipped sample. Only patterns that reached target or invalidated print a mark on the chart, so a timed-out pattern is counted in the table but not tagged, and the visible marks are fewer than the table total. It describes what happened after past patterns, it does not predict future ones, and a small sample can move a lot. It is not a performance claim.
- Tolerances are ATR-based, so the definition of equal tops or a clean break adapts to each symbol's volatility instead of a fixed percentage.
- The tool is most useful on liquid symbols and on intraday-to-daily timeframes, where enough clean swings form. On very long histories only the most recent patterns stay drawn to keep the chart readable.

ALERTS

Bearish pattern confirmed · Bullish pattern confirmed · Target reached · Pattern invalidated.

SETTINGS

Every input has a tooltip. The main ones: "Swing size" sets how many bars on each side define a swing, "Neckline break" chooses close or wick confirmation, "Second peak / bottom" can require the classic weaker-second-peak form, "Patterns kept" caps how many stay on the chart, and the table, colors, outcome text and both text sizes are all adjustable.

This is a descriptive tool for reading classical chart patterns. It is not financial advice and does not predict price.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.