# Harami

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

Detects bullish and bearish harami patterns on real bodies, filtered for a wide first candle versus its 14-bar average body, a maximum inner body of 50%, and a directional leg gauged by a 50-length moving average. Doji inside candles upgrade labels to Harami Cross, and dashed trigger and void levels resolve each pattern by close, with alerts for detection, confirmation and cancellation.

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

**Harami** is the definitive clean detector for the [harami](https://www.luxalgo.com/library/concept/harami/): a wide-bodied candle followed by one whose real body holds entirely inside it. Containment is measured on real bodies (wicks may protrude) and quality filters demand a wide first body, a capped inner body and a directional leg feeding the pattern. Each pattern draws two dashed levels: the trigger a close must beat to confirm the reversal, and the void level whose closing break cancels it as continuation.

## How to Trade the Harami?

- **Harami label prints**: hesitation, not a completed reversal. The wide move met a candle that failed to extend it.
- **Close beyond the trigger level**: the pattern confirms in the reversal direction, marked with a check and alerted.
- **Close through the void level**: hesitation resolved as continuation, cancelling the pattern.

A doji inside candle prints as Harami Cross, the limit case of the contraction; label tooltips grade each pattern's contraction and containment.

## Harami Settings

- **Wide First Body** (default enabled) with **Multiple** (default 1.0) and **Length** (default 14): the first body must exceed the trailing average body.
- **Max Inner Body %** (default 50): largest inside body allowed relative to the first.
- **Doji Body % of Range** (default 5): the body limit that counts as a doji.
- **Harami Cross Only** (default disabled): keep only doji-inside patterns.
- **Trend Context Filter** (default enabled) with **Trend Basis** (default SMA) and **Length** (default 50): bullish patterns only below the average, bearish only above.
- **Resolution Range** (default First Candle Body): resolve on the first body or the full two-candle range.
- **Trigger & Void Levels** (default enabled), **Levels Extension** (default 10), **Resolution Markers** (default enabled).
- **Style toggles**: labels and candle coloring on by default; the trend MA plot off.

## Frequently Asked Questions

### How does the Harami differ from the Engulfing Bar?
They are geometric opposites: an [Engulfing Bar](https://www.luxalgo.com/library/indicator/engulfing-bar/) expands over the prior candle's body, while a harami contracts inside it. One shows the counter-side seizing control; the other, participation drying up.

### Why do some body-inside-body candles go unlabeled?
The filters are working: the first candle may be too narrow against its 14-bar average, the inside body too large, or the trend filter found no leg into the pattern. Disable individual filters to flag the raw geometry anywhere.

### Which Resolution Range should I use?
First Candle Body is the conventional read: the pattern resolves once a close clears the first candle's body. Full Pattern Range demands the close clear the two-candle extremes: fewer, later resolutions for stricter proof.

## 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
- [Hanging Man](https://www.luxalgo.com/library/indicator/hanging-man/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/hanging-man.md
- [Candlestick Channels](https://www.luxalgo.com/library/indicator/candlestick-channels/) (Hammer): markdown at https://www.luxalgo.com/library/indicator/candlestick-channels.md

---

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