# Three Inside Up/down

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

Detects three inside up and three inside down (the harami plus its confirming candle) under the strict rule by default: a long first body, a contained counter-trend second body, and a third close beyond the first candle's extreme. Trend context is checked at the first candle, dashed invalidation levels track each pattern's far extreme, and four alerts cover completions and failures.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jun 7, 2026.
- Access: free.
- Concepts: [Three Inside Up/down](https://www.luxalgo.com/library/concept/three-inside-up-down/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=l4z3l2vr3674krhb2acs9nof
- Page: https://www.luxalgo.com/library/indicator/three-inside-up-down/

**Three Inside Up/down** waits for the harami to prove itself. A long opening body in the trend direction, a smaller counter-colored body contained inside it, then the completion candle: by default a close beyond the first candle's extreme, the strict reading of [three inside up/down](https://www.luxalgo.com/library/concept/three-inside-up-down/), here given its first purpose-built detector. Each pattern prints a box, a label and a dashed invalidation level at its far extreme; a later close back through it marks the failed reversal with a cross.

## How to Trade the Three Inside Up/down?

- **3 Inside Up**: within a decline, a long dark candle, a contained white body, and a third close clearing the first candle's high, a confirmed bullish claim with invalidation at the pattern low.
- **3 Inside Down**: the mirror within an advance, invalidated at the pattern high.
- **Invalidation cross**: a close back through the level negates the confirmed reversal. The cross label and matching alerts make failures as explicit as completions.

## Three Inside Up/down Settings

- **Completion Rule** (default Strict: Close Beyond First Candle's Extreme): the loose option accepts a close beyond the second candle's close.
- **Second Candle Color** (default Opposite To First Candle): Any Contained Body drops the classical color requirement and accepts dojis.
- **Long Body Lookback** (default 14) and **Long Body Multiplier** (default 1.0): the long-first-candle test.
- **Decisive Third Candle** (default on) with **Min Body/Range %** (default 30): screens doji-like completion candles.
- **Trend Detection** (default Moving Average; also Net Price Change or None) with **Trend Length** (default 50).
- **Show Invalidation Level** (default on) with **Maximum Level Duration** (default 50), plus label and box toggles.

## Frequently Asked Questions

### How is this different from the plain Harami build?

A [Harami](https://www.luxalgo.com/library/indicator/harami/) build stops at the two-candle containment, which by itself proves only hesitation. This detector withholds the signal until a third close escapes the pattern toward the claimed reversal, so every label already carries the confirmation step a harami trader adds by hand.

### Strict or loose completion?

Strict demands the third close clear the first candle's extreme, filtering marginal pokes at the price of entering later. Loose fires on a close beyond the second candle's close: sooner, more often, less proven. The default is strict because confirmation is the pattern's entire point.

### Does the pattern repaint?

No. A printed signal is never revised: completion is judged on the third candle's close, and the invalidation level is fixed when the signal prints, then monitored for up to Maximum Level Duration bars.

## 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/three-inside-up-down/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
