# Dragonfly Doji

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

Flags the T-shaped dragonfly doji with quantified filters: body at most 5% of the bar range, upper shadow capped at 10%, and a lower shadow at least twice the body and one ATR long. A prior decline is required by default, and each bullish signal is tracked through a three-bar confirmation window with trigger and stop levels drawn at the body top and shadow low.

- Indicator in the LuxAlgo Library, by LuxAlgo, published May 31, 2026.
- Access: free.
- Concepts: [Dragonfly Doji](https://www.luxalgo.com/library/concept/dragonfly-doji/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=xwz4q8kd7zk254jjdvkkwv0j
- Page: https://www.luxalgo.com/library/indicator/dragonfly-doji/

**Dragonfly Doji** turns the T-shaped candle into a testable rule set. A bar qualifies as a [dragonfly doji](https://www.luxalgo.com/library/concept/dragonfly-doji/) when its body is a small fraction of the range, its upper shadow negligible and its lower shadow long against both the body and recent ATR. By default only dragonflies below the trend average are flagged, and this first Library implementation tracks each one through an explicit confirmation window.

## How to Trade the Dragonfly Doji?

- **Dragonfly label**: the pattern printed after a decline. Wait for the confirming close rather than act.
- **Confirmation triangle**: a close above the body within the window confirms the bullish reading, with an alert.
- **Invalidation cross**: a close back below the shadow low voids the pattern. The rejected prices were accepted after all.
- **Trigger and stop levels**: dashed lines mark the trigger at the body top and the stop at the shadow low while a signal pends.
- **Advance warning** (optional): dragonflies above the trend average mark probing trade near a possible top.

## Dragonfly Doji Settings

- **Maximum Body Size %** (default 5) and **Maximum Upper Shadow %** (default 10): body and upper-shadow caps as percentages of the bar range.
- **Minimum Shadow / Body Ratio** (default 2) and **Minimum Shadow Length** (default 1) **x ATR** (default 14): the lower shadow must dwarf the body and stand out against recent bars.
- **Require Prior Decline** (default enabled) with **Trend SMA Length** (default 50): flag only dragonflies closing below the trend average.
- **Flag Dragonflies After An Advance** (default disabled): adds the top-warning variant.
- **Require Elevated Volume** (default disabled) with **Minimum Volume** (default 1.5) **x SMA** (default 20): optional activity filter.
- **Confirmation Window (Bars)** (default 3): bars allowed for the confirming close.
- **Trigger & Stop Levels** (default enabled): draws the pending levels.

## Frequently Asked Questions

### How does a dragonfly differ from a gravestone doji?
They are mirror images. The [gravestone doji](https://www.luxalgo.com/library/indicator/gravestone-doji/) puts open, close and low at the bottom, leaving a long upper shadow (a failed push higher), so gravestones are watched after advances, dragonflies after declines.

### Why does the indicator wait for confirmation?
A long lower shadow proves sellers failed for one session; it says nothing about who wins the next. Requiring a close above the body filters dragonflies that print mid-collapse; the invalidation rule closes the loop when lower prices get accepted.

### Can I use it without volume data?
Yes. The volume filter is disabled by default so the logic runs on any symbol. Enable it only where reliable volume exists; an active session supports the demand reading.

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