All indicators

Trendlines 2x +

Oct 26, 2019

Static chart image
Support and ResistanceSignalsChannelsPivot Based (Retrospective)

The Trendlines 2x + indicator provides a dual-layer trendline analysis system that automatically identifies and projects market structures from pivot points across two distinct lookback periods.

Usage

The Usage section describes how the script can be used to identify multi-period market structures. By default, the tool plots two sets of trendlines:

  • Primary Trendlines: These use a higher lookback length (default 20) and are designed to capture major market swings. They are typically used to identify long-term support and resistance levels.
  • Secondary Trendlines: These use a lower lookback length (default 7) and provide a more granular view of price action, capturing shorter-term trends.

The indicator is most effective when aligning these two layers to find "confluence zones" where primary and secondary lines overlap. Users can also enable Trend Candles, which color the price bars based on momentum to help filter out noise during trendline tests.

Details

The script is a refactored and expanded version of the "Trendlines - JD" script, doubling the visual output to allow for simultaneous multi-timeframe perspective on a single chart.

  • Pivot Point Detection: The script identifies "High" and "Low" pivot points based on the user-defined lookback length. Trendlines are then drawn by connecting these consecutive pivots.
  • Logarithmic Support: When "Log Chart" is enabled, the script calculates the slope using logarithmic differences, ensuring the projections remain accurate on charts with significant price scale variance.
  • Extensions: Unlike standard trendlines that may extend infinitely, this script offers simplified extension options (e.g., 25 to 1000 bars) to keep the chart clean and relevant to recent price action.
  • Break Detection: The indicator includes logic to detect when price crosses a trendline. It can display these as bar colors or triangle signals.

Settings

General Settings

  • Trend Candles: Enables bar coloring based on UCS momentum logic.
  • Support/Resistance Zones: Toggles the display of S/R zones derived from two different timeframes.
  • Log Chart: Adjusts slope calculations for logarithmic price scales.

Primary & Secondary Trendlines (Separate groups)

  • Lookback Length: Sets the number of bars required to confirm a pivot point. Higher values result in broader, more significant trendlines.
  • Draw lines from: Determines if pivots are calculated using Wicks (High/Low) or Real Bodies (Open/Close).
  • Trendline Extensions: Defines how far the line projects into the future (or "Infinite").
  • Line Type/Width: Customizes the visual style (Solid, Dashed, Dotted) and thickness.
  • Rising Upper and Falling Lower: Toggles the visibility of specific trendline directions.
  • Trendline Breaks: Selects the visual signal for when price violates a trendline (Triangles or Barcolor).

FAQ

How do I adjust the sensitivity of the trendlines? You can modify the "Lookback Length" in the settings for either the Primary or Secondary trendlines. A smaller number will create more frequent, sensitive lines, while a larger number will focus on major market structure.

Why are some trendlines different colors? By default, the "Colored" scheme uses green for lines connecting lows (support) and red for lines connecting highs (resistance). This can be changed to "Monochrome" in the settings for a more neutral look.

How can I get access to this tool? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.