Charts See the terminal

Premium script

Auto Trendlines

The support and resistance trendlines that the most recent pivots agree on, scored by touches and removed the moment price closes through them.

Levels & Trendlines Sign up for Altrady $7 one-time

Live Auto Trendlines preview · BTC/USDT on Binance · 1h, history up to a day ago

What is Auto Trendlines?

Auto Trendlines searches the recent swing lows for the line most of them agree on, and does the same for the swing highs. The best line through the lows is drawn as support and the best line through the highs as resistance, each with its touch count printed at the right-hand end.

It holds at most two lines, one per side. A better fit on one side replaces that side's line, and a line is removed as soon as price closes through it.

This is a closed-source premium script. It runs on Altrady's servers, so only its output reaches your chart and its code is not published.

How to use Auto Trendlines

  • Touch count. The number of pivots on or near the line. Three is the first count that means anything, since any two points make a line.
  • A rising support line. Higher lows sitting on one line describe an uptrend. Pullbacks to the line are where traders watch for it to hold.
  • A close through the line. The line is gone once a bar closes through it on the side it was holding. A break of a well-touched line is often read as a change in the trend's character.
  • Two lines converging. A falling resistance line above a rising support line describes a narrowing market, which often resolves with a larger move.

Settings

Swings

SettingDefaultRangeWhat it changes
TimeframeChart Chart, 15m, 30m, 1h, 4h, 1DFit the lines on a higher timeframe while trading a lower one. The chart's own period must divide it exactly.
Swing Length5 1 or moreBars either side of a pivot. It is also the lag: a line can only use pivots that are confirmed.
Significance (ATR x)1 0 to 10A swing is ignored unless the leg into it covered this much ATR. Lower than the suite's usual 1.5, because a trendline is drawn through minor pivots as readily as major ones.

Fit

SettingDefaultRangeWhat it changes
Lookback Swings10 2 to 30How many recent swings of each side the pairing reaches back over. Ten offers 45 candidate pairs per side. Raising it finds older and longer lines and lowers the chance any of them is still current; it is also quadratic, so it is capped.
Min Touches3 2 to 10How many pivots must agree. The two anchors count by construction, so 3 means the pair plus one more, the first value that says anything, since any two points define a line.
Touch Within (ATR x)0.3 0.01 to 5How close a pivot must come to the line to count as touching it, in ATR. The line itself needs no scaling (its slope is whatever two chart points imply), but this does, or it would count everything on a volatile instrument and nothing on a quiet one.

Display

SettingDefaultRangeWhat it changes
Show Touch CountOn The number of touches, printed at the line's right-hand end.
Extend RightOn Run each line to the right edge, which is where a trendline is read. With this off it stops at its newest anchor and only describes the past.
Line StyleSolid Solid, Dashed, Dotted
Label SizeTiny Tiny, Small, Normal, Large, Huge
Show State PaneOff A sub-pane counting live lines and the touch count of the newest, pulsing when one is fitted and again when one dies. The tool's internal state, and what the automated checks read.

Colours

SettingDefaultRangeWhat it changes
Support #089981 A line fitted through swing LOWS, holding price up.
Resistance #f23645 A line fitted through swing HIGHS.

Alerts: trendline_fitted, trendline_broken.

How it works

The script looks back over a limited number of recent confirmed swings on each side, ten by default, and considers every pair of them as a possible line. For each candidate it counts how many other pivots of the same side sit close to the line, with closeness measured in multiples of the average true range.

A candidate is thrown out if a swing of its own side sits clearly beyond it anywhere between the anchors, because a support line with a low under it was never support. Of what survives, the line with the most touches wins, provided it reaches Min Touches, three by default. Single bars poking through between pivots are allowed; the line is a fit through pivots, not an envelope around every candle.

A line ends on a close beyond it, judged at the line's own sloped value at that bar. It is then erased.

Limitations

  • Confirmation lag. A line can only use confirmed pivots, so it appears Swing Length bars after its newest pivot.
  • Lookback changes the answer. Raising Lookback Swings finds older, longer lines, which are less likely to still be relevant. Lowering it keeps lines recent but may miss a long trend.
  • One line per side. You will not see nested channels or a secondary trendline. Only the best fit on each side is shown.
  • Close based breaks. A wick through the line does not remove it. A line can look broken on the chart and still be live.
  • Fits are not forecasts. A well-touched line describes how pivots lined up. It does not guarantee the next touch holds.

Get Auto Trendlines

Premium scripts are a one-time purchase in the Altrady marketplace and need a paid Altrady plan to run.

  • Auto Trendlines $7 This script on its own.
  • Levels & Trendlines bundle $19 5 premium scripts, Auto Trendlines included.
  • Altrady Complete Suite $109 All 36 premium scripts.
Sign up for Altrady

Frequently asked questions

It scores every pair of recent swings on one side by how many other pivots touch the line through them, rejects any line with a same-side swing clearly beyond it, and keeps the one with the most touches if it meets Min Touches.

The tool's claim is one best line through the lows and one through the highs. A new fit replaces its side's previous line.

When a bar closes through it on the side it was holding, below a support line or above a resistance line.

Two. trendline_fitted fires when a new support or resistance line is drawn, and trendline_broken fires when price closes through a line.

Yes. Auto Trendlines is a closed-source premium script. It runs on Altrady's servers, so only its output reaches your chart and the code is never shared. You buy it once in the Altrady marketplace, on its own, in the Levels & Trendlines bundle or in the Altrady Complete Suite, and it needs a paid Altrady plan to run. It is also included with your first annual Premium subscription.

Use the Get it in Altrady button on this page to open its listing in the Altrady marketplace. Once it is in your account, open the indicator picker on any chart in Altrady Charts and add Auto Trendlines like any other indicator. Its settings are in the indicator's settings panel.

Sign up for Altrady