# Trendlines Oscillator

Trendlines Oscillator is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Turns trendline structure into momentum: it measures how far price sits from recent bullish support and bearish resistance trendlines, normalizes both distances to a 0-100 scale, and plots dueling momentum lines with a signal line and crossing dots. A structure-driven alternative to averaging oscillators for reading whether buyers or sellers hold control.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Aug 20, 2025.
- Access: free.
- Concepts: [Trendline](https://www.luxalgo.com/library/concept/trendline/) (primary), [Swing High/low](https://www.luxalgo.com/library/concept/swing-high-low/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn6ovo009gvhsg81vtu14o
- Page: https://www.luxalgo.com/library/indicator/trendlines-oscillator/

**Trendlines Oscillator** measures momentum from market structure instead of price averages. It builds bullish and bearish [support and resistance trendlines](https://www.luxalgo.com/library/concept/trendline/) from pivot swings, measures how far price has pulled away from each side, and normalizes those distances into two dueling momentum plots scaled 0 to 100. The green line tracks buyer strength over support; the red line tracks seller pressure under resistance; a signal line with crossing dots times the handoffs between them.

## How to Trade the Trendlines Oscillator?

- **Green above red**: buyers dominate. Price is holding well clear of its support trendlines.
- **Red above green**: sellers control the tape, with price held below its resistance trendlines.
- **Dots at signal-line crossings**: momentum has just shifted; use them as entry or exit confirmation within your plan.

Under the hood the pipeline is systematic: detect [pivot highs and lows](https://www.luxalgo.com/library/concept/swing-high-low/), connect them into trendlines, take the price-to-line distances, normalize between 0 and 100, then smooth. Because structure feeds the math directly, the reading reflects the actual battle between support and resistance rather than an average of closes.

## Trendlines Oscillator Settings

- **Length**: the size of market structure used for trendline detection; larger values capture broader trends, smaller ones react to short-term moves.
- **Memory**: how many trendlines stay in the calculation; higher smooths signals for longer-term analysis, lower quickens reactions.
- **Source** (default close): the price input.
- **Data Smoothing and Signal Smoothing**: method and length for the momentum values and the signal line, with up to 10 smoothing methods available.

## Frequently Asked Questions

### Can I tune the Trendlines Oscillator for scalping?

Yes. Lowering Length and Memory makes it respond to smaller structures and fresher trendlines, which suits intraday work. Swing traders usually go the other way, letting higher Memory values iron out the noise.

### How does it differ from the Trendlines with Breaks Oscillator?

They quantify different events. The [Trendlines with Breaks Oscillator](https://www.luxalgo.com/library/indicator/trendlines-with-breaks-oscillator/) builds its reading from how far price travels beyond broken trendlines, while this oscillator reads the standing distance between price and the lines. One scores the breaks, the other the ongoing balance.

### How do I get the Trendlines Oscillator?

The oscillator is free on the LuxAlgo Library, no subscription required. This page also lets you run it in Quant, our coding agent, if you want to backtest crossover rules before trading them. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Trendlines with Breaks](https://www.luxalgo.com/library/indicator/trendlines-with-breaks/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/trendlines-with-breaks.md
- [Trendline Breakout Navigator](https://www.luxalgo.com/library/indicator/trendline-breakout-navigator/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/trendline-breakout-navigator.md
- [Trendlines with Breaks Oscillator](https://www.luxalgo.com/library/indicator/trendlines-with-breaks-oscillator/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/trendlines-with-breaks-oscillator.md
- [Rolling Trendline](https://www.luxalgo.com/library/indicator/rolling-trendline/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/rolling-trendline.md
- [Power Hour Trendlines](https://www.luxalgo.com/library/indicator/power-hour-trendlines/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/power-hour-trendlines.md
- [Machine Learning Trendlines Cluster](https://www.luxalgo.com/library/indicator/machine-learning-trendlines-cluster/) (Trendline): markdown at https://www.luxalgo.com/library/indicator/machine-learning-trendlines-cluster.md
- [Swing Highs/Lows & Candle Patterns](https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns/) (Swing High/low): markdown at https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns.md
- [Unreached Highs/Lows Oscillator](https://www.luxalgo.com/library/indicator/unreached-highs-lows-oscillator/) (Swing High/low): markdown at https://www.luxalgo.com/library/indicator/unreached-highs-lows-oscillator.md

---

Source: https://www.luxalgo.com/library/indicator/trendlines-oscillator/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
