INDICATOR MANUAL
Automatic trend channel indicatorAuto Trend Channels [AFD] · full manual · published to TradingView
Read parallel channels built from three confirmed swing pivots, find the bar each one became usable, and follow it through the break, retouch and return that came after.
Start here
What the indicator does, the questions it can help answer, and its fresh-install defaults.
Auto Trend Channels [AFD], shown as ATCH [AFD] on the chart, joins three confirmed swing pivots into exact parallel geometry. A rising channel runs its lower boundary through two rising swing lows and its upper boundary parallel through the swing high between them; a falling channel is the mirror. There is no regression fit and no approximate parallel.
Every bar between the first and last anchor is checked against the boundaries. A candidate is rejected if any bar pokes past one by more than the Containment allowance, or if the channel is narrower than Minimum width or wider than Maximum width. All three are multiples of an average true range frozen at construction, so a channel’s tolerances never move afterwards and never rescue a candidate that failed.
A validated candidate is not yet a channel. It waits up to twenty bars for a confirmed close between its raw boundaries. That close is the acceptance bar, and a dotted vertical Known line marks it on the drawing. Left of the marker is where the geometry came from; right of it is the part that was available.
The script is free and open-source on TradingView under MPL-2.0. It reads only the chart’s own bars — no higher-timeframe request, no volume, no external data.
Fresh-install defaults9 documented defaults
Swipe or scroll horizontally to see every column.
| Area | Default | Result |
|---|---|---|
| Swing length / Longer swing channel | 8 / off | One layer on the chart timeframe. A pivot confirms eight bars after it prints. |
| Pivots searched / Search and age horizon | 10 / 600 | Ten recent pivots per side per construction; a channel is retired once its first anchor passes 600 bars. |
| Volatility window / Containment allowance | 14 / 0.10 | A fourteen-bar average true range, frozen per channel, sizes every allowance. Bars may poke a tenth of it past a boundary. |
| Minimum / Maximum width | 0.50 / 8.0 | In frozen ranges. Minimum above Maximum is an invalid setting and draws a corner warning. |
| Close allowance / Return watch | 0.0 / 20 | Any confirmed close beyond a boundary starts the watch, which runs twenty bars for a close back inside. |
| Retained channels | 3 | Finished and watching channels kept drawn across both layers. Hidden channels keep running their watch and still alert. |
| Midpoint / Quarter lines / Channel labels / Channel fill | on / off / on / on | A dotted halfway line, every label the script draws, and shading inside the active channel only. |
| Corner table / Status panel / Panel position | on / Off / Top right | The standing disclosure alone. The table is a chart overlay; Top left covers the chart’s own legends. |
| Colour theme / Label position / Label size | Signature / On line / Tiny | Nine themes set the rising, falling and history colors together. Custom frees the three pickers. |
How it works
How the indicator turns chart data into the states and drawings you see.
How a channel is built
A swing high is strictly above every high within Swing length bars on both sides; a swing low is the mirror. Equal highs or lows do not qualify, and a bar that is both is excluded. The last anchor must sit at least twice the swing length after the first. Where several opposite pivots lie between them, the one furthest from the line joining them becomes the parallel’s anchor.
Acceptance, and the Known marker
A channel is drawn only after a confirmed close lands between its raw boundaries. If no close lands inside within twenty bars, or thirty-two newer candidates on the same layer displace it, the candidate is discarded and nothing is drawn. One layer holds one active channel at a time, and an intact active channel is never replaced by a newer candidate however good the newer geometry looks.
Break, watch and return
The first confirmed close beyond a boundary by more than the Close allowance starts a return watch. The channel goes dashed, takes the history color, loses its shading and keeps extending. A close exactly on a boundary is inside. The break frees the layer’s active slot at once, so a new channel can be accepted while the old one is watched. A confirmed close back between the boundaries within the window finishes it as Returned inside; a channel that returns never becomes active again.
Boundary retouch
During the watch, the first later bar whose high or low reaches the broken boundary while its close stays outside receives a one-time mark. It is recorded once per channel, never counted, compared or rated, and it changes nothing about the channel’s state. A channel with no retouch mark is not saying anything.
Ageing out
Once a channel’s first anchor passes the Search and age horizon it is retired and leaves the chart, in whatever state it was. Ageing is not a break and produces no event. A finished or watching channel that has not aged stays drawn up to the Retained channels count, newest first; retention is display only.
Reading the drawing
Color says whether a channel is live and stroke style says whether it is broken. The endpoint label sits at the channel’s midpoint price in both label positions, never on a boundary, and reads the direction and the state. Event labels sit at the bar that produced them, offset by a fixed fraction of the channel’s frozen volatility from whichever is further out, the boundary or that bar’s own high or low, so none is drawn over its own candle.
The corner table
One table sits in the chosen corner and carries the standing disclosure over two lines. It is a chart overlay, so it covers whatever is in that corner: Top left sits under the chart’s own symbol and indicator legends and leaves them hard to read. Status panel widens it to a per-layer row with the state, the live upper, mid and lower prices, the watch count and an inventory of drawn sets. Corner table off removes the whole table; two blocking warnings still draw alone, because they explain an otherwise blank chart.
The optional second layer
Longer swing channel adds a second layer on the same chart timeframe, using Swing length multiplied by Longer swing multiple. It draws one width step heavier and slightly fainter so the two stay tellable apart. A channel already accepted on one layer is not accepted again on the other. It ships off and has not been observed running on the published build.
Output and state reference6 documented states
Swipe or scroll horizontally to see every column.
| Output or state | When it appears | Meaning |
|---|---|---|
| Active | A confirmed close landed inside the validated geometry | Solid, shaded and extending to the current bar. A description of geometry price has respected, not a call on the next bar. |
| Watching above / below | A confirmed close cleared a boundary by more than the Close allowance | Dashed and in the history color, still extending while the watch runs. |
| Boundary retouch | The first later bar to reach the broken boundary with its close still outside | A one-time mark on that channel. Never counted, compared or rated. |
| Returned inside | A confirmed close back between the boundaries within the watch window | The channel is finished with its right edge frozen at the return bar. |
| Watch ended | The watch window passed with no close back inside | The channel is finished with its right edge frozen where it ended. |
| Known marker | The acceptance bar | A dotted vertical line stating where the usable part of the drawing starts. |
Settings
All 33 inputs are listed below in their four source groups. Every input carries a tooltip in the settings dialog, and each tooltip ends with a concrete example of what changing that input does. Greyed-out controls are inactive because the switch that governs them is off.
Detection9 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Swing lengthswingInput | Whole number | 8 | Min 2 · Max 30 |
| Longer swing channellongerInput | Toggle | Off | — |
| Longer swing multiplemultipleInput | Whole number | 3 | Min 2 · Max 4 | Conditional |
| Pivots searchedpoolInput | Whole number | 10 | Min 3 · Max 12 |
| Search and age horizonhorizonInput | Whole number | 600 | Min 100 · Max 2000 |
| Volatility windowvolatilityInput | Whole number | 14 | Min 5 · Max 100 |
| Containment allowancecontainmentInput | Decimal | 0.10 | Min 0.0 · Max 0.50 · Step 0.05 |
| Minimum widthminWidthInput | Decimal | 0.50 | Min 0.10 · Max 5.0 · Step 0.10 |
| Maximum widthmaxWidthInput | Decimal | 8.0 | Min 1.0 · Max 20.0 · Step 0.50 |
Lifecycle2 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Close allowancecloseInput | Decimal | 0.0 | Min 0.0 · Max 1.0 · Step 0.05 |
| Return watchwatchInput | Whole number | 20 | Min 1 · Max 50 |
Display18 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Retained channelsretainedInput | Whole number | 3 | Min 0 · Max 10 |
| MidpointmidpointInput | Toggle | On | — |
| Quarter linesquartersInput | Toggle | Off | — |
| Channel labelslabelsInput | Toggle | On | — |
| Anchor markersanchorsInput | Toggle | Off | Conditional |
| Forming channelformingInput | Toggle | Off | — |
| Corner tabletableInput | Toggle | On | — |
| Status panelpanelInput | Choice / text | Off | Full · Disclosure only · Off | Conditional |
| Panel positionpositionInput | Choice / text | Top right | Top right · Top left · Bottom right · Bottom left | Conditional |
| Boundary widthboundaryInput | Whole number | 2 | Min 1 · Max 4 |
| Channel fillfillInput | Toggle | On | — |
| Fill transparencytransparencyInput | Whole number | 80 | Min 0 · Max 100 | Conditional |
| Colour themethemeInput | Choice / text | Signature | Signature · High contrast · Paper (light chart) · Muted · Colourblind safe · Monochrome · Warm · Cool · Custom |
| RisingrisingInput | Color | #26A69A | Conditional |
| FallingfallingInput | Color | #EF5350 | Conditional |
| HistoryhistoryInput | Color | #9AA0A6 | Conditional |
| Label positionlabelPosInput | Choice / text | On line | On line · Right of line | Conditional |
| Label sizelabelSizeInput | Choice / text | Tiny | Tiny · Small · Normal | Conditional |
Alerts4 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| FormationformationAlertInput | Toggle | On | — |
| Close outsideoutsideAlertInput | Toggle | On | — |
| Boundary retouchretestAlertInput | Toggle | On | — |
| Return insidereturnAlertInput | Toggle | On | — |
Alerts and limitations
What can notify you, what can change the output, and what the indicator cannot establish.
Named alert conditions
A channel on that layer was accepted at the confirmed close.
A confirmed close cleared a boundary past the Close allowance and started the watch.
The one-time retouch mark was placed on a watched channel.
A confirmed close landed back between the boundaries inside the watch window.
One message listing every enabled event on the confirmed bar with its layer, the channel’s three anchor timestamps and the raw boundary prices.
Limits to keep visible
- Channels appear late by design. A pivot confirms Swing length bars after it prints and a channel is drawn only after a close lands inside, so a new channel first appears drawn back over earlier anchors. The Known marker states where the usable part begins.
- Linear-price geometry. Boundaries are parallel in price per bar, they are not log-space parallels on a logarithmic axis, and the script cannot detect the axis setting. Slope is per bar, so a channel keeps its slope straight across a weekend gap.
- Standard time-based charts only. Renko, Kagi, Range, Point and Figure and tick charts are refused with a corner warning and draw nothing.
- Reconstruction can change with the loaded history, the session, the data adjustment or any input. Whether this build repaints has not been observed on a replay and is not claimed either way; check the bar-replay tool on your own symbol and timeframe.
- The corner table is a chart overlay and covers its corner. Top left sits under the chart’s own symbol and indicator legends.
- Every verification row that turns on seeing the chart is unrun on the published build, and so are bar replay, realtime, alert delivery, the Longer swing layer, the Forming view and the eight non-default themes.
- It is not a signal tool. No entries, exits, stops or targets, no channel graded or ranked against another, and no count converted into odds. A retouch is marked, never counted.
Troubleshooting
Start with what you see on the chart. Each answer explains the likely cause and the first setting, timeframe, or data condition to check.
Why are there no channels on my chart?
Check the corner table. It names the reason: too few confirmed pivots in the loaded history, no candidate that survived validation, or a nonstandard chart type. Minimum width set above Maximum width also draws its own warning and accepts nothing.
Why did a channel appear drawn back over old bars?
That is the confirmation delay, and it is disclosed rather than hidden. The pivots confirm Swing length bars late and acceptance waits for a close inside. The dotted Known line marks the bar the channel became usable; nothing left of it was available at the time.
Why was a good-looking channel never drawn?
A validated candidate still has to see a confirmed close land between its boundaries within twenty bars. A wick entering the channel accepts nothing. The candidate is also discarded if thirty-two newer candidates on the same layer displace it first.
Why did the whole channel disappear instead of turning grey?
It aged out. Once the first anchor passes the Search and age horizon the record is retired and leaves the chart in whatever state it was, with no event and no color change. Raise the horizon to keep older channels.
Why do the boundaries look wrong on my chart?
Switch the price axis to linear. The geometry is parallel in price per bar and the script cannot detect a logarithmic axis, so the boundaries are drawn correctly and displayed on a scale they were not built for.
Why is the corner table covering my symbol name?
The table is a chart overlay and Top left is where TradingView puts its own symbol and indicator legends. Move Panel position to one of the other three corners, or switch Corner table off; the two blocking warnings still draw.