# Triangle

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

Detects completed Elliott triangles from the last six swing points, classifying contracting, barrier, expanding and running variants and checking that every leg subdivides into threes. Draws the A-C and B-D boundaries with apex extensions, previews forming structures, and manages the thrust with a widest-part target and invalidation depth, plus eleven alerts.

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

**Triangle** reads the five-legged sideways structure as a wave analyst counts it. Six alternating swing points become A through E, boundaries fit through A-C and B-D, and the shape must satisfy the grammar of the [Elliott triangle](https://www.luxalgo.com/library/concept/triangle/): converging boundaries with shrinking legs (contracting), one flat boundary (barrier), diverging legs (expanding), or a wave B exceeding the start of A (running).

## How to Trade the Triangle?

- **Forming preview**: with A through D in place, dotted boundaries and a "triangle forming" tag warn against premature breakout entries while E completes.
- **Thrust**: a close through the B-D boundary after E prints the label and projects the target, the widest part times the projection factor, conventionally where profits are taken.
- **Invalidation**: a close returning past the invalidation depth, or wave E closing beyond the A-C line past tolerance, marks the count suspect.

## Triangle Settings

- **Swing Length** (default 8): pivot length for legs A through E; larger values search higher degrees.
- **Sub-Wave Length** (default 3): smaller pivot counting each leg's sub-swings.
- **Sub-Wave Validation** (default Loose): Loose rejects clear fives, Strict requires three-consistent counts, Off trusts geometry alone.
- **Barrier Flatness %** (default 15): slope budget for a boundary to read as flat.
- **Detect Expanding Triangles** (default on): include the rare diverging variant.
- **Require Fading Volume & Volatility** (default off): demand a lighter, quieter second half.
- **Wave E Overshoot Tolerance** (default 0.25): closing overshoot of the A-C line (fraction of the widest part) voiding the triangle.
- **Thrust Projection** (default 1) with **Project Thrust Target** (on) and **Invalidation Depth** (default 0.5): thrust management.
- Style: **Wave Labels** (on) and **Show Swings** (on).

## Frequently Asked Questions

### How is this different from the classical triangle pattern?

The [Ascending/descending/symmetrical Triangle](https://www.luxalgo.com/library/indicator/ascending-descending-symmetrical-triangle/) build accepts any coil whose closes respect two fitted boundaries. The Elliott definition is stricter (five three-wave legs in an allowed position) and earns a positional message: the thrust is typically the last wave of its sequence.

### Which variant matters most in practice?

Contracting triangles are the common form; barrier triangles behave the same with one flat side. Running triangles often read as trend strength; expanding ones resist practical trading.

### Where can a triangle legitimately appear in a count?

An impulse's fourth wave, a correction's wave B, or a combination's final structure, never wave 2 on its own. Each pattern's tooltip restates these positions beside the E-to-A ratio.

## 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
- [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
- [Diagonals](https://www.luxalgo.com/library/indicator/diagonals/) (Elliott & Harmonics): markdown at https://www.luxalgo.com/library/indicator/diagonals.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/triangle/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
