◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Learn / The Doji Candlestick
Candlestick Patterns

The Doji Candlestick

A doji is a candlestick whose open and close are at or very near the same price, producing a tiny or non-existent body. It reflects a session where buyers and sellers ended in rough balance. This guide explains how traders identify dojis, the common variations, how they are typically interpreted in context, and why a doji on its own is not a signal to act. Educational content only; nothing here is trading advice and trading carries risk of loss.

What a doji is

A doji is a single candlestick where the opening price and the closing price are at, or extremely close to, the same level. Because the body is the distance between open and close, a doji has a very thin body or none at all, often appearing as a cross, plus sign, or thin horizontal line with wicks (shadows) extending above and/or below.

In practical charting, an exact match between open and close is uncommon. Most platforms and traders treat a candle as a doji when the body is negligibly small relative to the candle's full high-to-low range. There is no single universal threshold; some traders use a fixed percentage of the range, others judge it visually. Because the definition is partly subjective, two traders can disagree on whether a given candle 'counts' as a doji.

What the shape describes is balance: over that period, price moved around but returned to where it started, so buyers and sellers finished roughly even. That is a description of what already happened, not a forecast of what happens next.

Common variations

Dojis are usually grouped by where the wicks sit relative to the shared open/close level:

  • Standard (neutral) doji: a very small body with upper and lower wicks of roughly similar length. Often described as general indecision.
  • Long-legged doji: long wicks on both sides, showing a wide trading range that still closed near the open. Reflects a session of large back-and-forth that ended roughly where it began.
  • Dragonfly doji: open and close sit near the high, with a long lower wick and little or no upper wick. Price fell during the session but returned to close back near where it opened.
  • Gravestone doji: open and close sit near the low, with a long upper wick and little or no lower wick. Price rose during the session but gave the move back by the close.
  • Four-price doji: open, high, low, and close are all (or nearly all) the same, appearing as a single horizontal dash. This often reflects very low liquidity or a thin trading period rather than a meaningful struggle between buyers and sellers.

These labels describe geometry only. The same shape can appear in many different market situations, so the variation alone does not tell you what will follow.

How traders interpret a doji in context

Most experienced traders treat a doji as a piece of context rather than a standalone trigger. A common framing is that a doji reflects indecision after a period of directional movement, which some read as a possible pause or loss of momentum. Importantly, indecision can resolve in either direction or simply continue, so a doji does not point anywhere by itself.

Factors traders often weigh alongside a doji include:

  • Location: a doji after an extended up- or down-move is read differently from one in the middle of a choppy, sideways range.
  • Prior trend: a dragonfly after a decline or a gravestone after a rally is sometimes discussed as a sign that the prevailing move met opposition, but this is interpretation, not certainty.
  • Confirmation: many traders wait for the next candle (or several) before drawing any conclusion, since the doji only describes the period that already closed.
  • Volume and timeframe: a doji on a 1-minute chart during quiet hours can carry different weight than one on a daily chart, and low volume can produce dojis that mean little.

The consistent theme is that a doji is information about balance, and any possible meaning depends entirely on what surrounds it. None of these readings is predictive.

Marking dojis on a chart with Pine v6

Below is a short, valid Pine v6 example that flags candles whose body is small relative to their full range, using a configurable threshold. It is for educational illustration of how a doji-style condition can be expressed in code; it is not a strategy, a signal, or advice, and the chosen threshold is arbitrary.

//@version=6 indicator("Doji Marker (educational)", overlay = true)

// Body as a fraction of the full high-low range maxBodyPct = input.float(5.0, "Max body % of range", minval = 0.1, maxval = 50.0)

bodySize = math.abs(close - open) barRange = high - low

// Avoid division by zero on zero-range bars isDoji = barRange > 0 and (bodySize / barRange) * 100 <= maxBodyPct

plotshape(isDoji, title = "Doji", style = shape.cross, location = location.abovebar, color = color.gray, size = size.tiny)

This script only highlights bars that meet a body-to-range condition. It does not predict direction and does not generate buy or sell instructions. You would still have to interpret each marked candle in its own context.

Limitations and risk

A doji is descriptive, not predictive. It tells you that one period closed near where it opened; it does not tell you what the next period will do. Dojis appear frequently, including during quiet or low-volume conditions where they carry little meaning, so treating every doji as significant tends to produce a lot of noise.

The partly subjective definition is another limitation: whether a candle is 'a doji' can change with your threshold, your timeframe, and your charting tool. Patterns that look clean in hindsight are also easy to over-read going forward.

Nothing in this article is a recommendation to buy or sell, a signal to act on, or a claim about win rates or outcomes. Candlestick shapes do not guarantee what markets do next, and trading carries a real risk of loss. Use any pattern only as one input within your own research and risk management, and consider seeking independent advice for your specific situation.

Key takeaways

Educational only — not financial advice. Trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro