# Tri-star

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

Detects strict tri-stars (three consecutive doji whose middle doji gaps beyond its neighbors after a trend qualified by a 50-bar SMA), plus an optional loose variant without the gap. Doji bodies must stay under 5% of the bar range and 0.25x the average body, and each pattern is tracked to a confirming close, timeout or invalidation, with eight alerts.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Apr 19, 2026.
- Access: free.
- Concepts: [Tri-star](https://www.luxalgo.com/library/concept/tri-star/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=orr09gytjo4d4l6f76o0paum
- Page: https://www.luxalgo.com/library/indicator/tri-star/

**Tri-star** hunts one of the rarest candlestick reversals with matching strictness. Three consecutive doji must each pass two body tests, the last candle before them must close on the trend side of a moving average, and the middle doji must gap beyond its neighbors, the defining feature of the [tri-star](https://www.luxalgo.com/library/concept/tri-star/), before a label, box and dashed stop line appear. Every strict pattern is then tracked forward to a confirming close, a timeout or an invalidation.

## How to Trade the Tri-star?

- **Pattern completes**: the third doji seals the signal (conviction has drained from the trend), a caution flag, not yet an entry.
- **Confirmation**: a decisive close beyond the third doji inside the confirmation window prints a triangle; the middle doji's extreme provides the stop.
- **Invalidation**: a close accepted beyond the middle doji extreme reinstates the prior trend and crosses the setup out, even after confirmation.
- **Loose variant**: optionally flags three doji stalling at an extreme without the clean gap, a milder note for confluence, drawn lighter and without stop tracking.

## Tri-star Settings

- **Maximum Doji Body %** (default 5): body ceiling as a share of the bar's range. Anything larger is a spinning top.
- **Maximum Body vs Average** (default 0.25) **x SMA** (default 14): each body must also stay under this multiple of the average real body.
- **Gap Basis** (default Real Bodies): the classical body-gap star rule; Full Candles (incl. Wicks) demands a shadow-inclusive gap.
- **Detect Loose Tri-Stars** (default off): adds the gapless variant.
- **Trend SMA Length** (default 50): average establishing the preceding advance or decline.
- **Confirmation Window (Bars)** (default 3): bars allowed for the confirming close.
- Style: **Highlight Pattern Candles** (on) and **Stop / Invalidation Level** (on).

## Frequently Asked Questions

### How does a tri-star differ from an Abandoned Baby?

The [Abandoned Baby](https://www.luxalgo.com/library/indicator/abandoned-baby/) strands one doji between two decisive candles that gap away on both sides, an indecisive bar inside a directional story. The tri-star is three indecisive bars with the gap in the middle, which is why the build insists on separate confirmation.

### Why do I almost never see a strict signal?

A strict tri-star needs three straight bars with near-equal opens and closes plus a gapping middle doji, a combination liquid markets rarely print. Loosening the doji or gap rules manufactures signals out of ordinary chop, which the loose variant contains.

### What happens if the confirmation window expires?

The tracked setup is dropped quietly (no triangle, no cross) and its stop line stops extending. A fresh strict tri-star in the same direction replaces whatever is still tracked.

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