Trendlines Oscillator
By LuxAlgoAug 20, 2025
Trendlines Oscillator is an indicator on Vela, our next-generation charting platform, written in Pine Script®.
Trendlines Oscillator measures momentum from market structure instead of price averages. It builds bullish and bearish support and resistance trendlines 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, 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
Free to use
Run it on Vela. Go further with a paid plan.
- Up to 500 Custom Alerts, with webhook automation
- Up to 10× the chart history of Free
- Orderflow lookback up to full history
- More Quant usage to customize it, plus extra usage when you need it
- Futures data alongside crypto, stocks, forex and commodities
Also works on
Related indicators
All 10 Trendline indicatorsRun it on Vela. Make it yours with Quant.
Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.





