All indicators

Support Resistance Diagonal

Jan 18, 2021

Static chart image
Support and ResistanceSignalsPatternsPivot Based (Retrospective)

The Support Resistance Diagonal indicator automatically identifies and projects diagonal trendlines based on historical pivot points to highlight potential market structures. It helps traders visualize emerging patterns such as triangles, wedges, and channels by connecting significant swing highs and lows in real-time.

Usage

The tool can be used to identify trend direction and potential breakout or reversal points. Support lines are drawn by connecting swing lows, while resistance lines connect swing highs.

  • Pattern Recognition: Use the intersecting or converging diagonal lines to spot classic chart patterns like wedges or flags.
  • Breakout Alerts: The indicator includes built-in alert functionality that triggers when price closes above a diagonal resistance or below a diagonal support.
  • Price Projections: Each line includes a price label at the current bar, providing the exact tick value of the diagonal level for precise entry or stop-loss placement.

Details

The script uses a pivot-based detection algorithm to locate local minimums and maximums over a user-defined lookback period. It then iterates through these points to construct valid trendlines that have not been significantly violated by price action between the anchors. The logic ensures that only relevant, uncrossed diagonals remain visible on the chart. The calculations are optimized for performance and support real-time updates down to the 1-second timeframe.

Settings

  • History bars back: Determines how far back in the price history the script searches for pivot points to construct trendlines.
  • Resolution (bars): Sets the sensitivity of the pivot point detection. Higher values filter out minor fluctuations to find more significant long-term trendlines, while lower values capture shorter-term diagonals.

FAQ

How do I use the alerts?

You can configure alerts by clicking the "More" (three dots) icon on the indicator name and selecting "Add alert". Choose between "Diagonal Support Alert" or "Diagonal Resistance Alert" to be notified of trendline breaches.

Why do some lines disappear?

The indicator dynamically updates and removes diagonal lines if the price action invalidates the trendline by crossing it, ensuring only active market structures are displayed.

How can I access 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.