Concept

Doji

Doji, also known as long-legged, four-price variants, is a Chart & Candlestick Patterns concept. The Library holds 9 implementations, each one a working definition you can pull into Quant.

Top Doji indicators

9 total

What is a Doji?

A doji is a candlestick whose open and close land at, or almost at, the same price, collapsing the real body to a thin line while the shadows record the session's full travel. In candlestick vocabulary it is the indecision candle: both sides moved price during the period, but neither side held the gain by the close. Wick structure defines the variants. A long-legged doji has long shadows on both sides; a dragonfly doji opens and closes near the high above a long lower shadow; a gravestone doji opens and closes near the low beneath a long upper shadow; the rare four-price doji prints when all four prices are equal, usually on very thin trading.

A doji carries little information on its own; its weight comes from location. After a sustained advance or decline it shows the trend failed to extend into the close, which is why candlestick tradition treats it as an early trend exhaustion warning rather than a reversal signal in itself. Inside a quiet range, near-zero bodies are routine and mean little. 'Nearly equal' is also a judgment call: coded detectors typically require the body to be a small fraction of the high-low range, and the exact threshold is a convention that varies by source, so two scanners can disagree about the same candle.

How to identify a Doji

Recognition reduces to a body-to-range comparison plus context.

  1. 1Compare open and close. The real body should be a small fraction of the candle's total high-low range; exact thresholds are conventions, so make yours explicit and consistent if you code it.
  2. 2Classify the variant from the shadows: long on both sides (long-legged), lower shadow dominant with the body at the top (dragonfly), upper shadow dominant with the body at the bottom (gravestone).
  3. 3Weigh the location. A doji after an extended leg or at a tested S/R zone is a meaningful stall; a doji in the middle of a quiet range is noise.
  4. 4Wait for the next candle. Direction comes from the confirmation bar, not the doji itself: a decisive close away from the doji's range is the usual trigger.

How traders use it

  • As a stall warning inside trends: a doji after a directional leg says the last push found no acceptance, prompting tighter stops or partial profit-taking rather than an immediate counter-trend entry.
  • As the hinge of multi-candle reversal patterns: the morning star and evening star build around a small-bodied middle candle, a doji in their 'doji star' variants, and a doji as the second candle of a harami is read as a 'harami cross'.
  • At levels: a doji forming at support, resistance, or a prior swing extreme frames a contested auction, and traders commonly set triggers beyond the doji's high and low so the market picks the direction.
  • In scanners and scoring systems: because the definition reduces to a body-to-range ratio, doji detection is cheap to code and usually serves as one confluence input among several rather than a standalone signal.

Doji vs similar patterns

Spinning Top: A spinning top has a small but clearly visible real body between two shadows; a doji's open and close are essentially equal. Both read as indecision, with the doji the more extreme statement of it.

Hammer: A hammer keeps a real body at the top of the range above a long lower shadow and appears after a decline; the dragonfly doji is its no-body cousin. Both describe rejection of lower prices, but the hammer's definition requires the downtrend context.

Harami: A harami is a two-candle containment pattern: a small real body inside the prior candle's body. A doji is a single candle; when the contained second candle is a doji, the combination is called a harami cross.

More Doji implementations

Related concepts · Candlestick catalog

Concept family

Chart & Candlestick Patterns

84 concepts mapped · 46 in the Library

Doji FAQ

Is a doji bullish or bearish?

Neither on its own. A doji records a session that closed where it opened, which is indecision, not direction. The lean comes from context: after a long advance it hints the uptrend stalled, after a decline it hints selling pressure faded. Most candlestick practice requires the next candle to confirm before acting on it.

What are the types of doji?

Four are commonly named. The long-legged doji has long shadows on both sides, maximum indecision. The dragonfly closes near its high above a long lower shadow and leans bullish at lows. The gravestone closes near its low beneath a long upper shadow and leans bearish at highs. The four-price doji, where open, high, low, and close all match, mostly appears on illiquid symbols.

How small does the body have to be for a doji?

There is no universal number. Candlestick literature says the open and close should be virtually equal, and coded detectors translate that into a maximum body-to-range ratio. The threshold is a convention that varies across sources and platforms, which is why different scanners can label the same candle differently. Whatever cutoff you choose, apply it consistently.

Build Doji your way.

Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.