OPEN-SOURCE SCRIPT

Trendlines [FEELS]

2 236
Auto trendline tools tend to draw every line they can find, then quietly redraw them when price disagrees. This indicator does the opposite: a line is drawn only after price has respected it three times, and once drawn it never moves. Every line carries its own proof, a plain-text counter of how many times price has touched it.

HOW IT WORKS

The engine pairs confirmed swing pivots and validates the segment between them: if price closed through it anywhere along the way, the pair is rejected. Survivors become invisible candidates. A candidate is promoted to a real chart line only when a third touch confirms that the market actually respects it, and from that moment the geometry is locked.

- Touch counter: every line is labeled in plain text, "Support · 3 touches". More touches also make the line thicker, so the most respected line on the chart is the most visible one.
- Two scales: the base set tracks the swings you trade, the Major set (thicker, built from roughly 3x bigger swings) tracks the macro structure.
- Breaks: a break is a close beyond the line plus an ATR buffer, marked on the chart when it happens. Wicks through the line do not count.
- Flip watch: a broken line is not deleted. It stays on the chart as a dotted grey ghost, and when price returns to it from the other side, a Retest marker prints: broken support acting as resistance, tracked automatically. Ghosts expire on their own.
- Housekeeping: near-duplicate lines merge into the stronger one, and lines nobody has touched for a long time, or that drifted more than 10 ATR away from price, retire quietly. The chart stays at a few lines that matter instead of a fan of guesses.


HOW TO READ IT

1. The touch counter is a strength ranking. A line with 5 touches has proven itself more than a line with 3, and the strongest lines are where reactions have historically been most consistent.
2. Touches and breaks read differently. Price returning to a rising support with a high touch count is the classic trend pullback structure. A close through the line (Break marker) means the structure that carried the trend is gone.
3. Retest markers show the flip. After a break, the old line often gets tested from the other side; the Retest marker prints when that happens, with the line itself as the natural invalidation level of the pattern.

istantanea

HONESTY

- Confirmation has a cost. A swing pivot confirms only after the "Swing size" number of bars, so a line appears on the chart only once its third touch is confirmed, and at that moment it is drawn back to its origin. On a bar replay this looks like a line appearing into the past out of nowhere. That is the price of the no-repaint rule, not a glitch.
- After a line is drawn its position never changes. Breaks are evaluated on closed bars only, and Break/Retest markers stay where they printed.
- The touch badges at the right edge follow the last bar for readability; that movement is cosmetic, not a signal.
- Touch and break tolerances are ATR-based, so they adapt to each symbol's volatility instead of using fixed percentages.
- Works on any symbol and timeframe with enough history to form swings.

istantanea

ALERTS

New support line · New resistance line · Support touched · Resistance touched · Support broken · Resistance broken · Flip retest.

SETTINGS

Every input has a tooltip. The ones that change the picture most: "Swing size" sets how big a swing must be to anchor a line, "Touches to confirm" is the promotion rule (3 by default), "Max lines per side" caps the chart at the lines that matter, "Macro lines" adds the thicker second scale, "Line width" and "Text size" scale the visuals for presentations.

ORIGINALITY

Most auto-trendline scripts connect the latest two pivots and update the line as new pivots print, so the line you see today is not the line you saw yesterday. This engine is built the other way around: lines must earn their place through touch-count validation before they exist, their geometry is locked after, near-duplicates are merged, and broken lines move to a ghost stage that keeps tracking them for the support/resistance flip. The pivot pairing, segment validation, touch accounting and the line lifecycle are written from scratch for this script.

This is a descriptive tool for reading trendline structure. It is not financial advice and does not predict price.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.