Indicator Encyclopedia · Candlestick patterns
Doji candlestick: shape, context and strategy ideas
A doji is a candle whose open and close are almost the same, leaving little or no real body. Whatever happened during the bar, price finished close to where it began. Traders read it as indecision: neither buyers nor sellers ended the bar in control. This page covers how to read a doji, why its meaning depends heavily on where it appears, and how a strategy generator can test whether it helps on your contract.
What it describes
A doji is defined by its real body. The distance between open and close is very small compared with the typical range of recent bars, so the candle looks like a cross or a plus sign. The shadows can be long or short; what makes it a doji is that the close returned to the open.
The candle records a bar in which price moved but did not settle anywhere new. Buyers and sellers each had moments of control, and by the close they had cancelled each other out. On its own a doji does not point up or down. It marks a pause.
Because the body is measured against recent bars, a doji in a quiet market can be a very small candle, while in an active market a bar with a visible body may still count. Comparing with recent bars keeps the definition consistent as volatility changes.
How context changes the meaning
A doji in the middle of a sideways range adds little information, because indecision is already the normal state there. Traders pay more attention to a doji that appears after a strong run, where a pause in one-sided buying or selling can be the first sign that the move is tiring.
Dojis are frequent on low-activity bars, such as quiet overnight periods or the minutes before a scheduled announcement. These often reflect a lack of participation rather than a balance of strong opinions, and many traders filter them out by session or by range.
What comes next usually decides the meaning. A doji followed by a strong bar in the opposite direction of the prior move is read as a turn; a doji followed by continuation is just a rest. Many traders wait for that next bar before acting.
Pairing it with other indicator families
Because a doji has no direction of its own, it needs a partner that supplies one. A trend measure such as a moving average or ADX tells you what move the doji might be interrupting, and the following bar tells you whether the interruption becomes a turn.
Momentum oscillators help judge whether the pause matters. A doji while RSI is stretched describes a market that has already run far and is now hesitating; the same candle with a neutral oscillator is usually ordinary noise.
Volatility measures help filter quiet-market dojis. Requiring the bar's range to be at least normal relative to ATR separates a doji that came from a real tug of war from one that came from a market that barely moved.
In AlphaPrime
In the AlphaPrime strategy generator, the doji is one of the conditions in the built-in candlestick family. The generator can require it together with trend, momentum, volatility and session rules, use it as a trigger, or use its absence as a filter, and backtests these variations side by side.
Because a doji says nothing about direction by itself, its value depends heavily on what it is combined with. Testing many combinations at once shows which pairings, if any, add something on your contract and timeframe, and out-of-sample validation removes combinations that only worked in one stretch of history.
Combinations that pass validation can be exported as strategy code for your trading platform, with the doji condition written out alongside the other rules.
Common ways to use it
Doji after a strong run
After several bars in one direction, a doji can be used to tighten a stop or close part of the position rather than to reverse. Requiring the run to be stretched, for example far from a moving average, focuses on the pauses that matter.
Doji plus confirmation
Treat the doji as a setup and the next bar as the trigger: enter only if the following bar closes beyond the doji's range in the opposite direction of the prior move. This trades some of the move for fewer false turns.
Doji at a band edge
A doji that forms after price has reached the outer edge of Bollinger Bands or a Keltner Channel combines a stretched location with a bar where the push stalled.
FAQ
How small does the body have to be for a candle to count as a doji?
There is no universal number. Common definitions compare the body with the typical range of recent bars, so the threshold adapts to how active the market is. Exact settings differ between charting packages, which is one reason a doji on one platform may not appear on another.
Is a doji bullish or bearish?
Neither on its own. It marks indecision. Its meaning comes from the move before it and the bar after it, which is why it is almost always combined with a trend or confirmation condition.
Can a strategy that uses the doji run on my trading platform?
Yes. When a combination that includes the doji passes validation, it is exported as strategy code for your platform, with the pattern condition included, so you can review and simulate it.

