Trendline Trading

A trendline is a straight line drawn across a sequence of price extremes — rising lows in an uptrend, falling highs in a downtrend — and extended forward so that it produces a reference price on every future bar. Trendline trading is the family of strategies that turn that line into a decision rule. Because the line carries both a direction (its slope) and a location (its value on the current bar), one object can serve as entry trigger, trend filter and invalidation level at once.

## How it works

Every implementation, manual or coded, answers three questions: which points anchor the line, when the line counts as valid, and what interaction with price is a signal.

Anchoring usually comes from swing pivots — a high or low with a defined number of bars on each side — or from a statistical fit such as a linear regression over a fixed window. Validation covers how many touches are required, whether wicks or bodies count, and how much tolerance around the line still counts as a touch. Interaction is the signal itself, and it splits into two opposite readings: price returning to the line and holding is a continuation entry; price closing through it is a break entry.

What separates a trendline from horizontal support and resistance is that the trigger price moves every bar. The same setup gives a different entry depending on how long price took to arrive, and a line that is far from price today can be at market in ten bars without price having moved. Any implementation therefore has to state how the level is recomputed and when in the bar it is read.

## Main variants

**Continuation (bounce).** Enter with the trend as price returns to the line, with the stop beyond the line or beyond the pivot that anchored it.

**Break and retest.** Enter when price closes through the line, either immediately or after a return to the broken level.

**Channels.** A parallel line across the opposite extremes turns the trend into a band: entries at one boundary, targets at the other — mean reversion inside a directional frame.

**Regression-based.** The drawn line is replaced by a fitted line with standard-deviation bands. Fully mechanical, but it updates every bar.

**Anchored to a reference.** Lines start from a defined structure — a session range, the prior day's extremes — instead of arbitrary pivots, which makes anchor selection reproducible.

**Confluence systems.** The trendline is one condition among several (an oscillator, volume, a moving average, higher-timeframe bias) and rarely fires alone.

## What usually differs between implementations

Two strategies described with the same words can behave very differently. The pivot lookback decides how many lines exist and how quickly they form. The redraw policy decides whether a line, once drawn, is fixed or recomputed each bar — the main source of repainting. The break definition (body or wick, an ATR buffer, N consecutive closes) changes both signal count and entry price. Then there is timeframe, whether the line triggers trades or only filters them, how many lines can be active at once and what happens when they conflict, and the risk model: fixed stop, structural stop, or a stop trailed along the line itself.

## Common mistakes

The recurring one is hindsight: a line drawn after the move looks clean because the points that would have invalidated it were never selected. Related failures include treating touch count as evidence when it is largely survivorship; backtesting a repainting auto-trendline without checking that the line's value on each bar used only prior data; placing the stop exactly at the line, inside the band where overshoots are normal; never defining when a line expires, so old lines accumulate until every chart has one near price; and reading a steep slope as strength, when it only means the trend must keep accelerating to hold.

## How to evaluate and backtest a version

Start with whether the rules are mechanical enough to code without judgement calls. If anchor selection is discretionary, a backtest measures your drawing, not the strategy. Once the pivot rule, tolerance, break rule and line expiry are fixed, confirm signals on bar close and verify there is no lookahead in how the line is built.

The remaining checks are the usual ones, with one addition. Test across instruments, timeframes and distinct regimes — trendline systems are directional by construction and can look excellent through a single sustained trend. Check parameter sensitivity and prefer a plateau to a spike. Watch the trade count, since higher-timeframe break systems produce few signals. Include spread, slippage and commissions, which weigh disproportionately on break entries. Then run the ablation: compare the full system against the same system with the trendline removed, and against a plain baseline such as a moving-average cross or a channel breakout. If removing the line changes little, the strategy is really its filters.

The versions linked from this page resolve these choices differently — some fully automated, some anchored to a session, some using the line only as a filter. Each decoded page states its own rules, which is what makes them comparable.

Strategies in this concept (34)

Frequently asked questions

What is a trendline, exactly?

It is a straight line fitted to a sequence of price extremes — successive higher lows in an uptrend, successive lower highs in a downtrend — and projected forward. Its practical output is a price level that changes on every bar, which strategies use as an entry trigger, a directional filter, or the level that invalidates a trade.

Can trendline trading be automated, or is it inherently discretionary?

It can be automated, but only once anchor selection is made explicit. A coded version replaces the trader's eye with a pivot rule (for example, a swing high with N bars on each side) or a regression fit, plus fixed tolerance and break definitions. Without those specifications the method stays discretionary, and any backtest of it is really a test of how the lines were drawn.

Should a strategy trade bounces off the line or breaks through it?

They are opposite trades on the same object and behave differently. Bounce entries assume the trend continues and generally offer a tight stop but face the risk that the line eventually fails. Break entries assume the trend structure has ended and usually enter after price has already moved, which raises cost sensitivity. Most implementations pick one and define the other as an exit condition.

What does 'repainting' mean for automatic trendline indicators?

Repainting means the line drawn on historical bars is not the line that existed in real time — typically because pivots are only confirmed some bars after they form, or because the fit is recomputed from scratch each bar. It matters for backtesting: if the line's value at bar t was influenced by data after t, the results include information that was not available at the moment of the trade.

When does a trendline stop being valid?

That is a design decision the strategy has to make, not a property of the market. Common definitions are a close beyond the line by some buffer, a set number of bars since the last touch, a break of the pivot that anchored it, or a fixed expiry. Leaving it undefined is a frequent source of overfitting, because old lines are retained only when they later look relevant.

Do trendlines work the same across timeframes and markets?

The construction is identical, but the statistics are not. Lower timeframes generate many more lines and more false breaks; higher timeframes produce few signals, so samples take years to build. Instruments with strong session structure often make anchored variants more reproducible than free pivot selection. Any version worth trusting should be tested across several instruments, timeframes and market regimes rather than on the one chart it was designed on.

All strategy concepts · Explore all strategies