# Hanging Man

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

Detects small-bodied candles near their session high with a lower shadow at least twice the body, printing only after the prior bar closes above a 50-bar advance average. Each detection draws a trigger at the body bottom and a stop at the pattern high, waits up to 3 bars for a confirming close, then keeps tracking the stop for 20 more, with alerts at every stage.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jul 19, 2026.
- Access: free.
- Concepts: [Hanging Man](https://www.luxalgo.com/library/concept/hanging-man/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=tjjoaru7ppiast7s5oyrxn5q
- Page: https://www.luxalgo.com/library/indicator/hanging-man/

**Hanging Man** finds the uptrend's uneasy candle (a small body near the session high over a long lower shadow) and runs it through the full classical lifecycle, the library's first complete treatment of the [hanging man](https://www.luxalgo.com/library/concept/hanging-man/). Detection demands a preceding advance, so the identical shape at the bottom of a decline is never mislabeled. Each pattern draws a dashed trigger at the body bottom and a dashed stop at the pattern high.

## How to Trade the Hanging Man?

- **Label prints**: the session broke sharply lower before the close was hauled back. After an advance, the first hint that supply can move this market. An alert fires, but the pattern is not yet active.
- **Confirmation triangle**: a close below the pattern body within the window activates the bearish reading; the pattern high becomes the working stop.
- **Invalidation x-cross**: any new high above the pattern high restores the uptrend reading, before or after confirmation.

The invalidation check runs first on a bar that does both, so a poke to new highs voids the pattern even if that same bar later breaks down.

## Hanging Man Settings

- **Minimum Lower Shadow / Body Ratio** (default 2): how deep the intraday break must run versus the body.
- **Maximum Body Size %** (default 30) and **Maximum Upper Shadow %** (default 10): keep the body compact and pinned near the high.
- **Body Color** (default Any): switch to Down-Close Only for the marginally more bearish variant.
- **Advance SMA Length** (default 50): the prior bar must close above this average.
- **Require Elevated Volume** (default disabled) with **Minimum Volume** (default 1.5) x **SMA** (default 20).
- **Confirmation Window (Bars)** (default 3) and **Post-Confirmation Stop Tracking (Bars)** (default 20).
- Display toggles: **Show Pattern Labels** and **Trigger & Stop Levels** (default enabled), **Highlight Pattern Candles** and **Show Trend Basis** (default disabled).

## Frequently Asked Questions

### Is a hanging man just a hammer at the top?

Shape-wise, yes. The label changes with location. After a decline the candle reads bullish; after an advance it warns instead. The advance requirement means this build only ever reports the bearish case.

### How does it compare with the Gravestone Doji?

Both are topping alerts after advances, but the rejection sits on opposite sides. The [Gravestone Doji build](https://www.luxalgo.com/library/indicator/gravestone-doji/) records higher prices offered and refused through its upper shadow; the hanging man records a deep break lower that was bought back.

### Does the candle's color matter?

Only marginally. Both closes qualify classically, a down-close keeping slightly more of the sellers' intraday gains, which is why Any is the default and confirmation carries the real weight.

## Related indicators

- [On-neck / In-neck / Thrusting](https://www.luxalgo.com/library/indicator/on-neck-in-neck-thrusting/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/on-neck-in-neck-thrusting.md
- [Rising/falling Three Methods](https://www.luxalgo.com/library/indicator/rising-falling-three-methods/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/rising-falling-three-methods.md
- [Swing Highs/Lows & Candle Patterns](https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns/) (Hammer): markdown at https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns.md
- [Reversal Candlestick Structure](https://www.luxalgo.com/library/indicator/reversal-candlestick-structure/) (Hammer): markdown at https://www.luxalgo.com/library/indicator/reversal-candlestick-structure.md
- [Candlestick Structure](https://www.luxalgo.com/library/indicator/candlestick-structure/) (Doji): markdown at https://www.luxalgo.com/library/indicator/candlestick-structure.md
- [Evening Star](https://www.luxalgo.com/library/indicator/evening-star/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/evening-star.md
- [Candlestick Channels](https://www.luxalgo.com/library/indicator/candlestick-channels/) (Hammer): markdown at https://www.luxalgo.com/library/indicator/candlestick-channels.md
- [Belt Hold](https://www.luxalgo.com/library/indicator/belt-hold/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/belt-hold.md

---

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