Doji Candlestick: What It Is and How to Trade It
A doji candlestick forms when a bar opens and closes at almost exactly the same price, leaving a tiny body pinched between its shadows. Buyers pushed. Sellers pushed back just as hard. When the dust settled, price ended the session right where it began — a standoff drawn as a single candle.
That standoff is the whole point. A doji is the market saying "I'm not sure," and it shows up most often right where a trend is starting to tire. Read on its own it means little; read in context it can be an early warning that momentum is about to change hands.
What a doji means
Every candle has a body and two shadows. The body is the distance between the open and the close; the shadows are how far price stretched above and below before returning. A doji is the case where that body nearly vanishes.
Because the open and close finished level, neither side won the session. That is why traders treat the doji as a candle of indecision rather than direction. After a long push in one direction, a sudden burst of indecision matters — it is the first sign the crowd driving the move has started to hesitate.
Those shadows still carry information. Long wicks on both sides mean a volatile, undecided fight. A wick mostly on one side hints which way pressure is leaking. But the defining feature is always the same: a body so small it reads as a line.
How to identify a doji: the exact rule
batch_doji flags it when the body is ≤ 10% of the 10-bar average body.Plenty of guides say "the open and close are equal" and leave it there. Real charts are messier — the two prices are rarely identical to the cent, so you need a threshold. Vike's engine uses a precise one, and you can apply it by eye.
To count as a doji, a bar's body must be 10% or less of the recent average body — specifically the average over the last 10 candles — while still keeping a genuine high-to-low range. In plain terms: this candle's body is at least ten times smaller than what's been normal lately.
How Vike computes it. The detector invike-indicators(batch_doji) flags a bar whenbody ≤ 0.1 × the 10-bar average body, with a real range. Measuring the body against the recent average is what stops a quiet, low-volatility day from being mislabeled — a doji has to be tiny next to its neighbors, not merely small.
That relative test is the detail most explanations miss. It's also the reason a genuine doji jumps off the chart instead of blending into a run of quiet, small-bodied candles that only look similar at a glance.
The types of doji
Not every doji looks alike, and the shape changes the message. Four are worth knowing:
- Standard doji — small body, roughly balanced upper and lower shadows. Pure indecision.
- Long-legged doji — the same body with very long shadows on both sides. Violent indecision; a big range that resolved nowhere.
- Dragonfly doji — open and close sit near the high, with a long lower shadow and almost none on top. Buyers rejected lower prices; often read as bullish after a decline.
- Gravestone doji — the mirror: open and close near the low, a long upper shadow. Sellers rejected higher prices; often read as bearish after a rally.
Same core rule — tiny body — but the shadow placement tells you where the rejection happened, and rejection is what you actually trade.
Dragonfly deserves a second look, because it is the hammer shape pushed to its limit — and the two detectors disagree in a way worth knowing.
Remember that a doji is judged relative to its neighbors. batch_hammer does the opposite: it weighs a candle's body against that same candle's range, wants a tail at least twice that body, and allows almost nothing on top. No context required. One consequence falls straight out of that difference — an identical bar is a hammer on any chart you put it on, but only earns the dragonfly label when the candles around it run big enough to make its body look tiny by comparison.
Both labels can land on one bar; a sliver of a body above a long tail satisfies each. At the extreme they split. batch_hammer discards zero-body candles before it tests anything else, so a bar that opens and closes at precisely the same price is a dragonfly and nothing else.
Is a doji bullish or bearish?
By itself, neither. This is the question new traders ask most, and the honest answer is that a doji has no built-in direction — it is a pause, not a signal.
Its meaning comes entirely from the trend it interrupts and the candle that follows. A doji after a strong rally, followed by a red day, is a warning the uptrend may be stalling. The identical doji in the middle of a choppy range is noise. Dragonfly and gravestone shapes lean bullish and bearish respectively, but even those need context and confirmation before they're worth acting on.
How to trade a doji candlestick
Treat a doji as a "pay attention" flag, not an entry. On its own it fires far too often to trade blindly — which is the mistake I made for a long time, buying or selling the doji itself and getting whipsawed.
Demand a trend first. A doji only carries weight where it interrupts something. After an extended move, it's a potential turning point; inside a flat range, ignore it. The context is doing most of the work.
Wait for the next candle. Let the bar after the doji resolve the standoff. A doji at the top of a rally that's followed by a strong red close is your evidence sellers took control. Trade the confirmation, not the pause.
Anchor risk to the doji's range. Its high and low are natural stop levels — if price closes back through the far side, the indecision resolved against you and the idea is done.
Stack it with a second read. I trust a doji far more when momentum agrees. A doji printing while RSI is stretched into overbought or oversold is a much stronger tell than one in neutral territory — the candle says the crowd hesitated, and the oscillator says it hesitated somewhere extreme.
Where dojis mislead
The honesty section. Dojis are common — far more common than beginners expect — and most of them lead nowhere.
Quiet, sideways markets print them constantly, and every one is meaningless. Low-volume sessions manufacture them out of thin trading rather than real balance. And a doji that never gets a confirmation candle is just a pause the market forgets by the next morning. The pattern flags hesitation; it does not promise a reversal, and treating every doji as a turning point is a fast way to overtrade.
Doji vs spinning top
These two get confused because both signal indecision. The difference is the body. A doji's body is effectively nonexistent — open and close level. A spinning top shows a small but clearly visible body with wicks on both sides. A doji is the sharper, more extreme version of the same idea: a spinning top squeezed until its body disappears.
Frequently asked questions
What does a doji candlestick mean? It signals indecision — buyers and sellers finished the session in a dead heat, so neither side took control. After a strong trend, that stall can be an early sign momentum is fading.
Is a doji bullish or bearish? Neither on its own. Direction comes from the surrounding trend plus whatever the next candle does. Dragonfly dojis lean bullish and gravestone dojis lean bearish, yet each one still needs confirmation.
How small does the body have to be? Small relative to recent candles — Vike flags one once its real body shrinks under a tenth of the typical body from the prior 10 bars.
What separates a doji from a spinning top? A doji shows essentially no body; a spinning top keeps a small but visible one. Both mark hesitation, with the doji being the more extreme form.
Educational content, not financial advice. Trading carries real risk of loss, and past pattern behavior does not guarantee future results. Check any setup against your own plan before you risk capital.