# Diagonals

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

Detects five-wave wedges from confirmed swing pivots and classifies each as a leading or ending diagonal, drawing the wave 1-3 and 2-4 boundary lines with wave labels, an invalidation level and an origin target for ending patterns. The most recent confirmed wedge stays monitored for throw-over, the 2-4 line reversal trigger and invalidation until a newer one replaces it, with momentum divergence noted per pattern.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jun 19, 2026.
- Access: free.
- Concepts: [Diagonals](https://www.luxalgo.com/library/concept/diagonals/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=ywul32adrl3loierzamol8hh
- Page: https://www.luxalgo.com/library/indicator/diagonals/

**Diagonals** scans confirmed swing pivots for the five-wave wedge geometry that defines a [diagonal](https://www.luxalgo.com/library/concept/diagonals/), checking motive order, wave 4/wave 1 overlap and boundary convergence. Position decides the meaning: swings falling into the origin mark a leading diagonal opening a move, swings rising into it an ending diagonal closing one. Each detection's tooltip reports wedge type, throw-over, momentum divergence and invalidation.

## How to Trade the Diagonals?

- **Ending diagonal**: wave 5 or C position. The origin target line marks the full-retrace tendency, with an alert when reached.
- **Leading diagonal**: wave 1 or A position. Expect a deep second-wave pullback; the origin is the invalidation.
- **Throw-over**: a push through the wave 1-3 boundary is classic terminal behavior, marked on the chart.
- **2-4 break**: a close back through the wave 2-4 boundary is the reversal trigger.

Diagonals are among the most specific structures in the [Elliott and harmonics family](https://www.luxalgo.com/library/family/elliott-harmonics/), so this first dedicated build errs toward strict geometry over frequent detections.

## Diagonals Settings

- **Pivot Length** (default 6): swing confirmation span, setting the wedge scale.
- **Minimum Bars Per Wave** (default 3): filters degenerate one-bar legs.
- **Require Wave 4 / Wave 1 Overlap** (default enabled): the trait separating diagonals from impulses.
- **Detect Expanding Diagonals** (default disabled): also finds the rare diverging variant.
- **Convergence Ratio** (default 0.9): maximum wedge-width ratio at wave 4 versus wave 2.
- **Wave 5 Completion %** (default 60): how far wave 5 must travel across the wedge.
- **Momentum Length** (default 14): RSI length for the divergence check.
- **Pattern Expiry (Bars)** (default 200): the monitoring window after confirmation.
- **Style toggles**: wave labels, invalidation and target levels, and throw-over/2-4 break markers.

## Frequently Asked Questions

### What separates a leading from an ending diagonal?
Position and implication. A leading diagonal opens a move and points with the wedge after a deep pullback; an ending diagonal closes one and points against it, tending to return to its own origin.

### How is a diagonal different from a symmetrical triangle?
A [symmetrical triangle](https://www.luxalgo.com/library/indicator/ascending-descending-symmetrical-triangle/) is a sideways consolidation that resolves by breakout. A diagonal is a directional five-wave sequence making new extremes inside converging boundaries: wave logic, not just shape.

### Why did a detected diagonal stop being monitored?
Tracking ends on invalidation (a close beyond the wave 5 extreme for ending types, beyond the origin for leading ones), when the origin target is reached, after the Pattern Expiry window, or when a newer diagonal is detected, since only the most recent one is tracked.

## Related indicators

- [Elliott Wave](https://www.luxalgo.com/library/indicator/elliott-wave/) (Impulse): markdown at https://www.luxalgo.com/library/indicator/elliott-wave.md
- [Truncation](https://www.luxalgo.com/library/indicator/truncation/) (Elliott & Harmonics): markdown at https://www.luxalgo.com/library/indicator/truncation.md
- [Elliott Hard Rules](https://www.luxalgo.com/library/indicator/elliott-hard-rules/) (Elliott & Harmonics): markdown at https://www.luxalgo.com/library/indicator/elliott-hard-rules.md
- [Triangle](https://www.luxalgo.com/library/indicator/triangle/) (Elliott & Harmonics): markdown at https://www.luxalgo.com/library/indicator/triangle.md
- [Wave Degree Hierarchy](https://www.luxalgo.com/library/indicator/wave-degree-hierarchy/) (Elliott & Harmonics): markdown at https://www.luxalgo.com/library/indicator/wave-degree-hierarchy.md
- [Motive Wave](https://www.luxalgo.com/library/indicator/motive-wave/) (Elliott & Harmonics): markdown at https://www.luxalgo.com/library/indicator/motive-wave.md
- [Wave Extension](https://www.luxalgo.com/library/indicator/wave-extension/) (Elliott & Harmonics): markdown at https://www.luxalgo.com/library/indicator/wave-extension.md
- [NeoWave Logic](https://www.luxalgo.com/library/indicator/neowave-logic/) (Elliott & Harmonics): markdown at https://www.luxalgo.com/library/indicator/neowave-logic.md

---

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