Retired Tools

Doji candle detector and classifier

Doji candle detector and classifier

A doji is the candle that says "neither side won." Open and close land at almost the same price — the body is a hairline — but the wicks tell you the bar's range. The shape carries information: the market tried to move, fought itself, and finished where it started. That's why doji candles get singled out from the regular noise of small-body bars. They mean something different.

The trouble is that "doji" gets used loosely. Any small-body candle gets called one in casual writing, and the distinct shapes — standard, long-legged, dragonfly, gravestone — get blurred together even though each one tells a specific story. Drop the four OHLC numbers from a candle into the box below and the tool tells you whether it qualifies as a doji at all, and if so which of the four subtypes it is, with the exact thresholds it used.

Doji classifier · one candle

Candle OHLC
A single candle drawn to scale, with the body shown as a thin gold rectangle when the open and close are nearly identical, and the upper and lower wicks shown as a vertical line. HIGH LOW H L
Verdict
Body-to-range ·
Drop a candle's four OHLC values to see if it qualifies as a doji and which of the four subtypes it falls into.
·
Body ≤ 10% of range. A doji's defining property — open and close land within a hair of each other.
·
Upper wick ratio. How much of the range sits above the body.
·
Lower wick ratio. How much of the range sits below the body.
Subtype thresholds: dragonfly = upper ≤ 10% AND lower ≥ 65%. Gravestone = lower ≤ 10% AND upper ≥ 65%. Long-legged = both wicks ≥ 30%. Anything else qualifying as a doji is a standard doji.

What the four subtypes actually mean

A doji's body is the giveaway — when open and close land within ~10% of the bar's full range, the candle says "we tried, it didn't stick, we ended where we started." That alone is just noise. The wicks are where the meaning lives. They show where price actually went during the bar before being pulled back to the close.

A standard doji has balanced wicks above and below a tiny body. It's the classical "cross" shape in the candlestick literature. The interpretation is straightforward indecision: roughly equal pressure from both sides, no resolution. Standard dojis at the top of a strong uptrend or the bottom of a strong downtrend are textbook reversal candidates. Mid-range, in a quiet session, they're just bars.

A long-legged doji is a standard doji on steroids — both wicks are long. The market ranged hard in both directions during the bar before tying out. This is heightened indecision, and it usually shows up after a strong directional move when the prevailing trend's traders are starting to take profit and counter-trend traders are finding it worth their while to fight back. Long-legged dojis tend to mark the moments where conviction shifts even when the trend doesn't immediately reverse.

A dragonfly doji has open, close, and high stacked at the top of the bar, with a long lower wick reaching down toward what would normally be a low. The narrative: sellers pushed price down sharply during the bar, but buyers absorbed it and dragged the close all the way back to the high. That's a buying response at scale. At a confirmed support level after a downtrend, dragonflies are one of the cleaner bullish reversal patterns. At intraday inflection points they're common, but the higher the timeframe, the more weight the pattern carries.

A gravestone doji is the mirror — open, close, and low at the bottom, long upper wick. Buyers ran price up, sellers slammed it back down to the open. At resistance after a rally, gravestones often print right before the turn. The pattern's name is morbidly literal: it tends to appear at the end of attempts to break through.

Why context matters more than the pattern

Doji candles get over-credited by retail traders because they're easy to spot, easy to name, and they appear constantly. On a typical liquid pair you'll see several daily dojis per month and dozens on the 1-hour. The pattern is information, not a signal. What separates a meaningful doji from chart-noise is location — the candle has to print at a level where reversal makes structural sense.

The cheap version of "context" is just trend direction: a dragonfly during a strong uptrend doesn't mean much (the move was already going up), but a dragonfly at the bottom of a multi-day downtrend at a prior support level is a different conversation. The same pattern at different locations carries entirely different weight. The magnetic levels post walks through the levels worth pre-marking — they're the candle's frame of reference.

The expensive version is volume and follow-through. A reversal doji on above-average volume that gets confirmed by the next bar moving in the new direction is the rare clean trigger. A reversal doji on dead volume that's followed by another doji is the market telling you the indecision is just lethargy, not a turn.

What the tool isn't doing

It isn't checking confirmation. The next bar's behaviour determines whether the doji actually marked a reversal, and there's no algorithmic substitute for waiting and seeing. It also isn't applying timeframe weighting — a daily doji on BTC counts for far more than a 5-minute one, and the tool doesn't know which timeframe you're feeding it. The classification math is the same regardless, but the actionability isn't.

The 10% body-to-range threshold is the most common one in the literature, but you'll find practitioners who use 5% (stricter, fewer matches) or 15% (looser, more matches). The tool sticks with 10% for the same reason most do — it catches the textbook patterns without flagging every small-body bar. If you want a stricter check, just compare the body % the tool prints against your own rule.

For a related candle-by-candle question — how to tell whether two adjacent bars form a real engulfing pattern — the engulfing pattern checker runs the same kind of structural test on pairs. And for the broader thread on why traders read more into chart shapes than the shapes deserve, the confirmation bias on charts post covers the cognitive pattern that makes pattern-recognition harder than it looks.

FAQ

Why 10% as the doji body cutoff?

It's the most common threshold in the candlestick literature — Steve Nison's Japanese Candlestick Charting Techniques uses roughly this range, and most modern charting platforms default to similar values. Stricter (5%) catches only the cleanest cases and misses borderline patterns that traders treat as dojis anyway. Looser (15-20%) starts pulling in regular small-body candles and dilutes the signal. 10% is the well-trodden middle.

Should the open and close be identical for a "real" doji?

In the textbook diagrams, yes. In real markets, almost never — a one-tick difference between open and close is enough to give you a body, but the candle is still functionally a doji. The body-to-range ratio is the practical version of "are open and close basically the same." If the body is under 10% of the bar's full range, the candle reads as a doji to most participants regardless of whether the body is technically zero.

What's the difference between a hammer and a dragonfly doji?

A hammer has a small (but non-zero) body at the top and a long lower wick — it's a directional candle pretending to be indecision. A dragonfly is the same shape but with body essentially zero. Both signal buyers stepped in after a sell-off. Dragonflies are rarer and read as "more decisive indecision" because the body never actually formed. Some traders treat them as the same pattern; the literature distinguishes them.

How rare are dojis on liquid markets?

On a 1-hour BTC chart, you'll see a handful of qualifying dojis per week. On the daily, several per month. The pattern frequency is part of why it's not a standalone trade trigger — if every doji marked a reversal, every chart-reader would be retired. The signal is conditional on location, trend, volume, and the confirmation bar; the doji is one input.

Does the tool work for any asset class?

Yes. The math is asset-agnostic — it's just OHLC arithmetic. Crypto, equities, futures, FX, anything that prints candlestick data. The interpretive guidance (where dragonflies are common, what timeframes carry weight) is most calibrated for liquid 24/7 markets like crypto and major FX pairs; thinly traded names print uglier candles overall.

Sibling tools

More tools like this one

You're in — go browse

A growing set of small interactive tools for traders and savers. No fluff, no popups.

Signed in. Plenty more tools and posts to dig into.

← All tools