# Diamond Top/bottom

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

Scans alternating swings for expansion into a widest point followed by contraction, verifying touch counts on all four boundary edges before drawing a diamond top or bottom. Completed patterns get a measure-rule target and a breakout-failure watch, an optional sharp-prior-move filter grades the setting, and a dotted preview shows confirmed but unresolved diamonds.

- Indicator in the LuxAlgo Library, by LuxAlgo, published May 28, 2026.
- Access: free.
- Concepts: [Diamond Top/bottom](https://www.luxalgo.com/library/concept/diamond-top-bottom/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=juzohqjz6fhs81498d904dyf
- Page: https://www.luxalgo.com/library/indicator/diamond-top-bottom/

**Diamond Top/bottom** detects the four-sided reversal shape of a [diamond top and bottom](https://www.luxalgo.com/library/concept/diamond-top-bottom/): alternating swings that broaden into a widest point, then contract, with verified touches on every edge. Its first Library build classifies each find by the prior move (advance means top, decline means bottom) and completes it when a close pushes decisively beyond a contracting edge, drawing edges, fill and a label.

## How to Trade the Diamond Top/bottom?

- **Forming preview**: dotted boundaries appear once expansion-then-contraction confirms on all four edges, the earliest honest look.
- **Decisive break**: a close through a converging edge completes the pattern; trade the actual break direction.
- **Measure-rule target**: the widest-point height projected from the break, tracked as a dotted line until reached.
- **Failure watch**: acceptance back inside the broken boundary negates the pattern, marked with a cross.

Diamonds are among the rarer members of the [chart pattern family](https://www.luxalgo.com/library/family/patterns/), so the touch requirements are strict by design.

## Diamond Top/bottom Settings

- **Swing Length** (default 6) and **Maximum Swings** (default 12): swing confirmation span, and the scan cap for one pattern.
- **Touches per Edge** (default 2): swing touches per edge.
- **Decisive Break Buffer (ATR)** (default 0): extra ATR a close must clear.
- **Require Sharp Prior Move** (default enabled), **Prior Move Window (bars)** (default 20), **Minimum Prior Move (x ATR)** (default 2) and **Volatility Baseline Length** (default 50): the ATR-normalized steep move that classical diamonds follow.
- **Volume Fade Filter** (default disabled): require volume to fade from the broadening half into the contracting half.
- **Measure-Rule Target** (default enabled) and **Failure Watch (bars)** (default 12): objective tracking and the post-break negation window.
- **Style toggles**: forming preview, pattern fill and the bullish/bearish colors.

## Frequently Asked Questions

### How does a diamond differ from a head and shoulders?
A [head and shoulders](https://www.luxalgo.com/library/indicator/head-and-shoulders/) is built from three distinct peaks against a neckline. A diamond is defined by its swing envelope: higher highs and lower lows into the widest point, then the reverse after it.

### Why is the volume fade filter off by default?
Fading contraction-half volume is a common diamond signature but not universal, so requiring it would discard valid patterns. Enable it to keep only textbook cases.

### What if price breaks upward out of a diamond top?
The build resolves with the actual break: an upside exit from a diamond top fires a continuation alert instead of a forced reversal read. The failure watch applies the same acceptance test either way.

## Related indicators

- [N Bar Reversal Detector](https://www.luxalgo.com/library/indicator/n-bar-reversal-detector/) (Key Reversal): markdown at https://www.luxalgo.com/library/indicator/n-bar-reversal-detector.md
- [Bart Pattern](https://www.luxalgo.com/library/indicator/bart-pattern/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/bart-pattern.md
- [Head & Shoulders](https://www.luxalgo.com/library/indicator/head-and-shoulders/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/head-and-shoulders.md
- [Wolfe Wave Detector](https://www.luxalgo.com/library/indicator/wolfe-wave-detector/) (Wolfe Waves): markdown at https://www.luxalgo.com/library/indicator/wolfe-wave-detector.md
- [Island Reversal](https://www.luxalgo.com/library/indicator/island-reversal/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/island-reversal.md
- [McDonald's Pattern](https://www.luxalgo.com/library/indicator/mcdonalds-pattern/) (Double Top/bottom): markdown at https://www.luxalgo.com/library/indicator/mcdonalds-pattern.md
- [Horns Pattern Identifier](https://www.luxalgo.com/library/indicator/horns-pattern-identifier/) (Rare Reversal Patterns): markdown at https://www.luxalgo.com/library/indicator/horns-pattern-identifier.md
- [Half Cup](https://www.luxalgo.com/library/indicator/half-cup/) (Rounding Top/bottom): markdown at https://www.luxalgo.com/library/indicator/half-cup.md

---

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