Skip to content
All library documents

Pivot-Based Trend Lines and Five-Point Regression Channels

Article TradingView scripts

Summary

This indicator presents two ways to draw price channels. The pivot-span method detects swing highs and lows after the configured left and right bar windows, keeps a limited number of recent pivots, then draws upper and lower lines through each side’s oldest and newest stored pivots. It can shade the space between those lines.

The five-point method divides a lookback window into five segments, selects each segment’s highest high and lowest low, and independently fits straight lines to those anchor points using ordinary least squares. A dashboard reports channel direction from the change in its midpoint and identifies breakouts by comparing the latest close with the channel boundaries. Inputs control lookback lengths, pivot count, styling, and the direction threshold.

The document describes indicator mechanics, not a tested trading strategy. Pivot confirmation depends on future bars relative to the pivot, and both methods depend on user-selected windows; the supplied text gives no performance evidence or rules for trading the displayed signals.

Key ideas

  • The pivot method stores recent confirmed highs and lows, then connects the oldest and newest points on each side.
  • The five-point channel fits separate linear regressions to segment highs and lows across a lookback window.
  • The dashboard classifies direction using the channel midpoint’s percentage change.
  • Breakout status is based on whether the latest close is outside the channel endpoints.
  • The indicator supplies visual analysis tools but no evidence that they produce profitable trades.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.