Auto Trendlines [AFD]Traders!
If this draws fewer lines than the last auto-trendline script you tried, that is not a bug.
Almost every free entrant in this category will connect any two points and call the result a trendline, including points price has already traded straight through. This one will not draw that line at all.
WHAT IT DOES
Two confirmed same-side pivots define a diagonal line - two swing highs for a descending line, two swing lows for an ascending one. Before it is drawn, the pair has to pass four checks, all required:
Same side. Never one high paired with one low.
Progressive. The second pivot has to be lower than the first on a descending line, higher on an ascending one.
No pierce. No bar between the two anchors may have traded through the line.
Still intact now. No bar since the second anchor may have violated it either.
The third check is the one almost everyone in this category skips, and the fourth closes the gap right behind it - a pivot needs time to confirm, so without the fourth check a line could pass the first three and still be dead on arrival, already traded through in the bars since its own anchor. Of every pair that clears all four, the one nearest current price is the one drawn.
It keeps three lines per side by default - one at your Swing Strength setting, and two more at longer multiples of it - so a short, a medium and a long trendline can all be live on the same side at once, each resting on a different swing rather than three readings of the same one.
HOW A LINE LIVES AND DIES
A live line is maintained, not redrawn - its right edge follows price, and its label counts how many bars have touched it within your tolerance. It is retired, dimmed and kept on the chart, never silently deleted, for exactly one of two reasons: price violated it, or its anchor aged past your Bars to Apply setting. A retired line's colour, width and style are yours to set - the defaults reproduce a plain grey dotted line, but a violated line and an aged-out line both use the same styling, because both are "no longer live" and neither claims anything about what happens next.
When a side has nothing to show, an optional note names the refusal directly instead of leaving a blank chart that reads as broken - something like "No valid ascending line - recent pivot pairs failed the validity rule." It disappears the moment a line forms on that side.
THE TWO ALERTS
One alert per side, on one event: a line was violated and retired, on the bar that just closed. That is the whole alert surface.
It does not fire on a developing bar - only once a bar closes.
It does not fire when a line is retired for age. An aged line was not violated, and an alert saying it was would be a false statement about your chart.
It does not tell you what to do next. It names the event and points at the settings that produced it.
There is no alert for a line forming, for a touch, or for price approaching a line.
SETTINGS WORTH KNOWING FIRST
Swing Strength sets how many bars either side of a pivot must confirm it - higher means steadier, later pivots; lower means more of them, sooner and noisier. Pivots Searched sets how many recent pivots each length keeps in its pool to test pairs from. Pierce Tolerance and Touch Tolerance are both a multiple of ATR: Pierce is how far price may travel through a line before it counts as pierced or violated, and Touch is the separate band used only for counting touches. Bars to Apply bounds how old a line's anchor may get before it ages out - 0 means no limit.
Minimum Touches is worth reading twice, because it does not do what it sounds like. Requiring touches before a line can be drawn does not find a better line - it defers the same line's appearance into a later, shorter-lived part of its own life, since touches accrue before the line is drawn, not after. What it actually buys is recency: the lines that survive it are the ones price is currently working on.
Label position offers "Right of line" (default, floats along the line's own slope) or "Below, centered" (sits directly under the line's tip). Either way the label is a plain box with no pointer.
WHAT IT WILL NOT DO
It is not a signal tool. It does not grade a line's strength, does not rank one line against another, and does not name a target, a breakout, or a bounce - each of those is a claim about the bar after the one that just closed, and this script has no view on that. A touch count is a count of what already happened, shown with the tolerance that produced it, nothing more.
WHAT IS DISCLOSED RATHER THAN HIDDEN
A line appears late by design - its anchors are confirmed pivots, so a line shows up Swing Strength bars after the bar that anchors it. That lag is the price of not drawing lines that vanish a bar later.
Whether this script repaints has not been observed on a replay and is not claimed here either way. Its behaviour on a logarithmic price scale is likewise unobserved and unclaimed.
Zero request.*() calls of any kind - every calculation reads the chart's own series.
Open source under the Mozilla Public License 2.0. Indicator

Trendline Architect [Quantum Algo]Trendline Architect
====================================================
🔶 OVERVIEW
Trendline Architect is an automatic trendline indicator that does what most trendline tools skip: it validates every line before drawing it, makes each line earn its status through real touches, grades every breakout by quality, and then automates the break-and-retest sequence that trendline traders normally track by hand. Lines are born as dotted candidates, promoted to solid confirmed trendlines only after the market validates them with a third touch, graded on breakout, kept on a retest watch after they break, and paired into parallel channels automatically — all with a deliberately quiet chart: one-letter signals whose full context lives in hover tooltips.
The problem this script solves is trendline spaghetti and trendline noise. Automatic trendline tools typically draw every pivot-to-pivot connection and alert on every violation. This engine rejects invalid lines at birth, refuses duplicates, caps how many lines can exist per side, silences the breaks of unproven lines by default, and filters weak breakouts by grade — so what remains on the chart is only what the market has actually respected.
🔶 WHAT IS A TRENDLINE BREAK AND RETEST?
A trendline connects successive swing points and acts as dynamic support or resistance while price respects it. A breakout occurs when price closes decisively through the line. The retest is what disciplined traders wait for next: price returning to the broken line from the other side and rejecting — old support acting as new resistance, or old resistance reclaimed as support. That return-and-reject is one of the most traded patterns in classical charting, and this engine detects the entire sequence automatically: validated line, graded break, watch window, confirmed retest.
🔶 WHY THIS SCRIPT IS ORIGINAL
1. Geometric validity at birth. A candidate line is rejected before it is ever drawn if any candle close violated the segment between its two anchor pivots. Lines that were never respected never reach the chart.
2. Touch-earned lifecycle. Every line starts as a dotted, untagged candidate. Each validated touch — a wick into tolerance with a close that respects the line — is counted, and only at the configured touch count is the line promoted: solid, thicker, fully colored, with a live ×N touch tag. The chart itself shows which lines the market obeys.
3. Anti-spaghetti engineering. Duplicate candidates with similar slope and position are refused, each side is capped at a configurable number of active lines with the weakest evicted first, and stale lines expire by age. The chart stays readable on every timeframe.
4. Breakout quality grading. Every breakout is scored from three observable components — volume z-score, penetration depth in Average True Range units, and breakout candle body ratio — into grades A, B, and C. Grade A signals highlight in the accent color.
5. A retest engine. Broken lines are not deleted; they turn into gray watch lines for a configurable window. A return to the broken line with a rejecting close prints the Retest signal — the classic polarity flip, automated.
6. Silence by default, depth on demand. Signals print as single letters — B for breakout, R for retest — with the full context (direction, grade, volume, penetration) in the hover tooltip. Two noise filters ship enabled: breaks of unconfirmed lines retire silently, and breakouts below a minimum grade stay off the chart and out of the alerts.
7. Automatic channel detection. When an active support line and resistance line run parallel within a slope tolerance, the engine fills the channel between them and reports it on the dashboard.
8. A live architecture dashboard. Active support and resistance counts, the nearest line with its distance in Average True Range units, a trend read derived from confirmed line slopes, the last break grade, the retest watch count, and channel status — in a compact, fully themeable panel.
🔶 HOW IT WORKS
Line construction: Confirmed swing pivots anchor every candidate line. Each new pivot is paired with the previous same-side pivot, the segment is checked for historical violations, duplicates are rejected, and side capacity is enforced before the line is created.
Touch validation: A touch counts only when the wick enters the tolerance band around the line and the close still respects it. Touches accumulate on the line's tag; the confirming touch promotes the line and, from that point, validated touches are marked with dots.
Breakouts: A close through the line beyond the buffer triggers the break. Confirmed lines produce graded signals; forming lines retire silently when the default filter is on. The broken line converts to a gray dashed watch line.
Retests: Within the watch window, a return to the broken line with a rejecting close prints R — upward reclaim of broken resistance, or downward rejection at broken support. Watch lines that see no retest expire quietly.
Channels: Active opposite-side lines are compared by slope; the closest parallel pair within tolerance is filled as a channel.
Non-repainting: Pivots require confirmation, and all touches, promotions, breaks, and retests are evaluated on closed bars only. Once printed, nothing moves.
Chart hygiene: Completed lines, touch dots, and signals are all capped by input, keeping the chart clean and the auto-scale anchored to current price.
🔶 HOW TO USE IT
1. Works on any market — cryptocurrency, forex, gold, indices, stocks, futures — and any timeframe. Raise the pivot length for larger structures.
2. Trust the visual hierarchy: dotted lines are candidates, solid lines with ×N tags are market-validated, gray dashed lines are broken and on retest watch.
3. Treat B signals as regime information: grade A breakouts with volume and penetration carry far more weight than the minimum-grade ones, and the grade is one hover away.
4. The R signal is the classic entry location: the broken line has flipped roles and price has confirmed the flip. Stops belong on the far side of the retested line.
5. Use the dashboard's Nearest row to know how far price is from the closest active line in Average True Range units before it gets there.
6. If you want the raw, unfiltered feed, disable the two noise filters in Signals — the engine detects everything either way.
🔶 SETTINGS
- Detection: pivot length, maximum anchor span, active lines per side, line expiry, completed lines to keep.
- Touches, breaks and retests: touch tolerance, touches to confirm, breakout buffer, retest watch window.
- Signals: breakout and retest toggles, confirmed-lines-only filter, minimum breakout grade.
- Channel detection with slope similarity tolerance.
- Full color customization, extension length, touch dots toggle.
- Themeable dashboard: position, four text sizes, title band, background, frame, grid, and three text colors.
🔶 ALERTS
- Trendline Confirmed — a line collected its confirming touch.
- Bullish / Bearish Trendline Breakout — a qualified close through a line, honoring the grade filter.
- Bullish / Bearish Retest Confirmed — a broken line was retested and rejected.
- Parallel Channel Detected — an active support and resistance pair is running as a channel.
🔶 FREQUENTLY ASKED QUESTIONS
Does the indicator repaint? No. Anchors are confirmed pivots and every touch, break, and retest is evaluated at bar close. Pivot confirmation introduces intentional lag equal to the pivot length.
Why do I see so few lines? By design. Between geometric validation, duplicate rejection, side caps, and expiry, only lines with genuine market respect survive. Raise the per-side cap or lower the confirmation count for a busier chart.
What do B and R mean? B is a graded breakout and R is a confirmed retest of the broken line. Hover either label for direction, grade, volume, and penetration details.
Why did a breakout print no signal? Either the line was still unconfirmed while the confirmed-only filter is on, or the break graded below your minimum. The line still changed state; only the signal was filtered.
What makes a grade A breakout? Elevated volume, deep penetration beyond the line in Average True Range terms, and a strong-bodied breakout candle — all three together.
🔶 CREDITS
Trendline analysis, breakout trading, and the break-and-retest pattern are classical charting techniques in the public domain, refined by generations of technicians. This script gratefully acknowledges that shared lineage. The geometric validity engine, touch-earned lifecycle, breakout grading model, retest watch engine, channel detection, noise-filtering architecture, and all code in this script are original work — no third-party or open-source script code was reused.
🔶 LIMITATIONS
Trendlines are geometry, not guarantees: valid lines break and graded breakouts fail. Pivot confirmation delays anchor recognition by design. Volume grading is less meaningful on symbols with unreliable volume reporting. Channel detection reports the closest parallel pair, not every possible channel. No indicator replaces independent analysis.
🔶 DISCLAIMER
This script is provided strictly for educational and informational purposes. It is not financial advice, an investment recommendation, or a solicitation to buy or sell any financial instrument. Past behavior of any trendline, breakout, or retest does not guarantee future results. Trading involves substantial risk. Always do your own research and manage risk independently.
Indicator

AUTO TRENDLINE PROauto trendline pro
auto trendline pro is an automatic trendline indicator designed to display multiple degrees of market structure at the same time: live trendlines, confirmed trendlines, and higher timeframe trendlines.
the purpose of the tool is to help traders identify dynamic support and resistance lines, projected levels, confirmed breaks, and higher timeframe structure directly on the chart.
the indicator uses pivot points, wick or body anchors, atr-based validation, touch detection, duplicate filtering, forward projection, optional channels, and a dashboard for fast market reading.
it can be used for scalping, intraday trading, swing trading, and macro analysis depending on the selected settings.
---
inputs guide
degrees
live degree
enables live trendlines. this mode reacts faster to recent price action, but it can repaint because the pivots are still developing. it is useful for short-term market reading and early structure detection.
confirmed degree
enables confirmed trendlines. this mode is more stable because it uses confirmed pivots. it is recommended for cleaner analysis and more reliable structural levels.
htf degree
enables higher timeframe trendlines. this mode brings larger market structure into the current chart and helps identify major dynamic support and resistance levels.
anchor source
selects how the trendline anchors are calculated.
wick uses candle highs and lows.
body uses candle open and close extremes.
wick is more aggressive and reacts to full price extremes. body is cleaner and can reduce noise.
---
pivot strength
live pivot l/r
controls the strength of live pivots. a lower value creates more reactive trendlines. a higher value creates fewer but cleaner lines.
confirmed pivot l/r
controls the strength of confirmed pivots. a higher value makes the confirmed trendlines more selective and more structural.
htf pivot l/r
controls the pivot strength used on the higher timeframe. higher values create more macro-level lines.
---
htf source
htf timeframe
selects the higher timeframe used for htf trendlines. examples: 4h, 1d, 1w. higher timeframes provide stronger macro structure.
htf ath/atl window
defines the lookback window used to detect higher timeframe highs and lows. a larger value allows the indicator to anchor lines to more important historical extremes.
anchor htf line at ath / atl
allows htf lines to be anchored from the highest high or lowest low inside the selected htf window. this is useful for long-term trendlines and cycle analysis.
htf compute in log space
calculates htf trendlines using logarithmic logic. this is useful for assets with large percentage moves, such as crypto, because it gives a more balanced macro structure.
---
structure and validation
lines per side chart degrees
defines how many chart-degree lines are displayed per side. increasing this value shows more trendlines but can make the chart busier.
lines per side htf
defines how many higher timeframe lines are displayed per side. a lower value keeps the chart cleaner. a higher value gives more macro context.
new-anchor candidates
defines how many recent pivots are tested as possible new anchors. higher values test more combinations.
older-anchor window
defines how many older pivots can be used with a recent pivot to create a valid trendline.
min bars between anchors
defines the minimum distance between two trendline anchors. a low value creates shorter lines. a higher value creates more meaningful structural lines.
allowed pierces
defines how many times price is allowed to pierce a line during validation. zero means strict validation.
pierce tolerance atr
defines the atr-based tolerance used when checking if price has pierced a line. a lower value is stricter. a higher value allows more flexibility.
touch tolerance atr
defines the atr-based tolerance used to count touches on a trendline. a higher value detects more touches. a lower value keeps only precise touches.
dedupe distance atr
filters trendlines that are too close to each other. a higher value removes more duplicate lines.
max validation span
defines the maximum number of bars used when validating a trendline. this prevents the indicator from validating lines across an excessive historical distance.
---
channels, break and extension
show channels
enables channels around the dominant trendline. channels help visualize the reaction area around a trendline instead of focusing only on a single line.
break = n consecutive closes beyond
defines how many consecutive candle closes are required to confirm a break. a value of 1 is faster. a value of 2 or more is stricter.
forward projection bars
defines how far the trendlines are projected into the future.
infinite extension
extends the lines continuously to the right. this is useful when using trendlines as ongoing dynamic support and resistance.
---
display
price projection label
shows the projected price at the end of a trendline. this helps identify the current reaction level quickly.
show trendline labels
enables or disables labels on trendlines. keeping this off gives a cleaner chart.
strength rating
shows a visual strength rating based on the number of valid touches. more touches generally mean a more important line.
show dashboard
enables the dashboard. the dashboard summarizes confirmed support, confirmed resistance, htf support, htf resistance, htf extremes, and validation status.
dashboard position
selects the position of the dashboard on the chart.
---
aesthetics
support
sets the color of support trendlines.
resistance
sets the color of resistance trendlines.
htf glow / accent
sets the accent color used for higher timeframe emphasis.
broken
sets the color used when a trendline is broken.
atr length
defines the atr length used for tolerances, validation, touch detection, break detection, and duplicate filtering.
---
how to use the indicator
start by using confirmed degree and htf degree. these two modes give the cleanest structure.
live degree is useful for faster market reading, but beginners should understand that live pivots can repaint while they are forming.
support lines are usually below price and can act as dynamic reaction zones.
resistance lines are usually above price and can act as dynamic rejection zones.
when price approaches a confirmed or htf trendline, watch how it reacts. price can reject the line, break through it, or compress near it before a stronger move.
a break is cleaner when price closes beyond the line. this is why the break confirmation input is important.
---
beginner tutorial
1. choose your trading timeframe, such as 15m, 1h, 4h, or 1d.
2. enable confirmed degree to display stable trendlines.
3. enable htf degree to display higher timeframe structure.
4. keep live degree enabled only if you want more reactive lines.
5. wait for price to approach a support or resistance trendline.
6. observe the candle reaction near the line.
7. a rejection can indicate that the line is still respected.
8. a confirmed close beyond the line can indicate a structural break.
9. use the dashboard to monitor the main confirmed and htf levels.
10. never use a trendline alone as a full trade signal. combine it with market structure, volume, candles, liquidity, and risk management.
---
simple beginner setup
live degree: off
confirmed degree: on
htf degree: on
anchor source: wick
confirmed pivot l/r: 10
htf pivot l/r: 8
allowed pierces: 0
break = n consecutive closes beyond: 2
show channels: on
show trendline labels: off
show dashboard: on
this setup keeps the chart clean and focuses on confirmed structure.
---
scalping setup
live degree: on
confirmed degree: on
htf degree: on
live pivot l/r: 3 to 5
confirmed pivot l/r: 8 to 12
break = n consecutive closes beyond: 1 to 2
forward projection bars: 10 to 30
show trendline labels: off
this setup gives faster signals and more reactive structure, but it should be used with more caution.
---
swing trading setup
live degree: off
confirmed degree: on
htf degree: on
confirmed pivot l/r: 10 to 20
htf pivot l/r: 8 to 15
htf timeframe: 1d or 1w
htf compute in log space: on for crypto
break = n consecutive closes beyond: 2 or 3
infinite extension: on
this setup focuses on larger trendlines and reduces short-term noise.
---
dashboard guide
conf resist
shows the main confirmed resistance trendline level.
conf support
shows the main confirmed support trendline level.
htf resist
shows the main higher timeframe resistance trendline level.
htf support
shows the main higher timeframe support trendline level.
htf ath / atl
shows the higher timeframe extreme levels used for macro context.
validation
shows that the lines are built using structure and validation logic.
---
important notes
a trendline is not an automatic buy or sell signal.
a trendline is a decision zone.
the more clean touches a line has, the more important it becomes.
a close beyond a line is usually more important than a wick through the line.
higher timeframe lines should always be respected because they represent larger market structure.
this tool is designed to organize chart structure, but risk management remains essential.
Indicator

Indicator

Ultra TrendlinesThis indicator automatically draws trendlines based on every pivot point, helping traders visualize key support and resistance levels. It dynamically adjusts as new pivots are detected and validates the trendlines against price movement.
Introduction
The Ultra Trendlines indicator is designed to help traders identify and track significant trendlines on their charts. By automatically detecting pivot points (both highs and lows), it draws trendlines that highlight key market movements. These trendlines are valuable for understanding the broader trend and for making informed trading decisions.
Detailed Description
The indicator analyzes price data to find pivot points highs and lows over a user-defined lookback period. Once a pivot is detected, it draws trendlines between the pivot points.
.........
Accuracy
To ensure accuracy, the indicator only keeps trendlines that are confirmed by price action. It checks if the price crosses the trendline and deletes invalid lines.
Additionally, it checks if the trendlines stay within predefined price thresholds, filtering out irrelevant lines that are too far from current price action.
The indicator also has an option to only show "rising lows" and "falling highs" trendlines, offering further precision in trend direction.
As new pivots are detected, older trendlines that fall outside the lookback period are removed, ensuring the chart remains clean.
.....
Style
The trendlines can extend forward (infinite and userdefined), backward, both or none. The lines are drawn with a customizable style (solid, dotted, or dashed), color, and width.
.........
Summary of Key Points
The indicator automatically detects pivot points (highs and lows) and draws trendlines based on them. It allows you to customize the style, color, and width of the trendlines. The indicator filters out invalid trendlines by checking if they are still relevant based on price action and price thresholds. Additionally, you can choose to only display rising lows and falling highs for more accurate trend analysis. It also removes outdated trendlines to keep the chart clean. Indicator

[_ParkF]Linreg & Trendlines* The script has been uploaded again.
Linear regression and trendline not only facilitate trend identification,
but also identify support and resistance within it,
and linear regression and trendline departure can detect trend changes, which are useful in trading.
Linear regression and trend lines are shown in the chart.
It offers a variety of options, length, color, thickness, on/off switch, etc.
I hope it will help you with your trading.
hope you become rich!
---------------------------------------------------------------------------------------------------------------------------
* 스크립트가 다시 업로드 되었습니다.
선형 회귀(채널) 및 추세선은 추세 식별을 용이하게 할 뿐만 아니라,
또한 그 안에서 지지와 저항을 식별하고,
선형 회귀(채널) 및 추세선 이탈은 거래에 유용한 추세 변화를 감지할 수 있습니다.
선형 회귀(채널) 및 추세선이 차트에 표시됩니다.
길이, 색상, 두께, 온/오프 스위치 등 다양한 옵션을 제공합니다.
거래에 도움이 되셨으면 합니다.
부자되세요!
---------------------------------------------------------------------------------------------------------------------------
* I would like to express my gratitude to zdmre for revealing the linear regression source. Indicator

TrendLine ChannelsAbstract
This script provides a set of Trendline Channels which can be tighter than Donchian Channels.
This script computes the most suitable active upper and lower trendlines and updates them as soon as possible.
We can use it for breakout signals earlier than Donchian Channels.
Introduction
Channels are tools which can mark area of values of ranging markets.
Once the price leaves the original region, range traders may start admitting they are wrong and trigger trend.
Donchian Channels (misheard as Dungeon Channels) use the highest and the lowest price to define area of values.
When the price breakouts, it just like it got released from a dungeon.
However, waiting for the price making even higher or lower may be too late and risk reward ratio may be lower.
Trendlines can make the channels tighter and we can find earlier breakout signals.
Computing Trendline Channels
(1) Find the most active trendlines
In this script, a valid trendline connects two high values or two low values.
A high value means the highest value in a trading day.
A low value means the lowest value in a trading day.
In this script, every trendline does not crossover any bar but can exactly touch them.
The most flat trendline is taken. (one for upper and one for lower)
(2) Continue to use or Change a trendline
If there is a tighter trendline available, this script changes to use it.
If the previous active trendline is broken, this script re-computes the trendline available.
When this case happens, this script display with an another color.
Otherwise, this script continues using the previous trendline.
(3) Middle line
The middle line indicates the middle value between the upper and the lower.
Parameters
Length : how many days are used for computation. The default value is 16 just because 16=4*4, using binary characteristic.
x_go_on : If the previous trendline is not breakout and there are no tighter trendlines available, we continue use it.
Color Options
(1) Upper trendline (no update or tighter)
(2) Upper trendline (changed due to breakout)
(3) Middle line
(4) Lower trendline (no update or tighter)
(5) Lower trendline (changed due to breakout)
Conclusion
Trendline Channels can be tighter than Donchian Channels and evaluate earlier breakout signals.
Comparing to known auto trendline scripts, Trendline Channels is continuous.
Once a trendline is broken, Trendline Channels can instantly point out the next available one.
If you think the price movement is boring or you cannot have good risk reward ratio, you can go to an another timeframe.
Reference
How to trade with Donchian Channels
How to trade with Trendlines Indicator

Indicator

Indicator

Indicator
