A doji has equal or very close opening and closing prices under a stated tolerance. It records where a period ended relative to its start, not participants’ intentions or a promised reversal. Measure the body, range and shadows first. The hypothetical examples below show how the same body, rounded prices or a different quote side can change the classification.

What a doji is and what a zero body actually signals

Let O, H, L and C denote open, high, low and close. Body = |C−O|; range = H−L; upper shadow = H−max(O,C); lower shadow = min(O,C)−L. Equal or nearby O and C can resemble a horizontal line, but a fixed one- or two-pip allowance is not a universal definition. Check the detector’s denominator and tolerance rather than classify from the image scale.

OHLC does not reveal the complete intrabar sequence. O → H → L → C and O → L → H → C can produce the same candle. Its shape cannot identify which side “attacked first,” how many times price returned to a level or how many trades occurred. “Indecision” is an interpretive label rather than a direct emotional or order-flow measurement.

Separate a geometric definition from a trading interpretation. A strategy can test a candle shape, context or a later-bar condition, but must specify each rule and when it becomes available. Neither a familiar pattern name nor a book attribution establishes a universal profitable entry or a required stop distance.

Record the measurement convention
Open and closeMeasure their absolute difference; state the allowed tolerance.
Range or another referenceA fraction of this candle’s range and a fraction of earlier average bodies are different rules.
ShadowsMeasure their lengths and the body’s position; “long” needs a reference.
Zero rangeO = H = L = C makes body/range = 0/0, which is undefined and needs separate handling.
SourceUse the quote side, precision and closed-bar data expected by the detector.

Same session, different Bid and Ask bodies

The spread widens at the close in four model ticks. A Bid-chart doji need not mean equal Ask open and close.

Scroll sideways to see the full diagram

Same session, different Bid and Ask bodiesFour Bid ticks: 1.1000, 1.1020, 1.0980, 1.1000. Spreads: 0.0002, 0.0002, 0.0002, 0.0008. Ask: 1.1002, 1.1022, 1.0982, 1.1008. Bid has zero body; Ask has a 6-pip body over a 40-pip range, or 15%.Variable spread gives different Bid and Ask candles1.09801.10001.1020Bid: body 0Ask: 6 pipsBid: 0/40 = 0%Ask: 6/40 = 15%Same period, different quote side.

Hypothetical model: only four ticks in the period, EUR/USD, pip 0.0001. Ask = Bid + assumed spread. With an illustrative 5% threshold, Bid qualifies and Ask does not. No forecast or order outcome is implied. MT5 — price data describes standard OTC Bid candles; Ask is drawn here for a model comparison.

Classify the price side used by the data and detector.

What types of doji exist and how do they differ

Doji names describe body position and shadow proportions. A cross-like form places its small body between shadows; long-legged doji has extended shadows on both sides, relative to a chosen comparison. Four equal prices give a zero-range case. Do not infer when or how often it occurs, market-wide liquidity or a future direction from the name alone.

A cross-like doji places near-equal opening and closing prices between the shadows. Symmetry is a geometric feature, not evidence that buyers and sellers had equal intentions or that both sides were exhausted.

A long-legged doji has extended upper and lower shadows. Specify what makes them long relative to other bars or a chosen scale. A large range and small body describe different quantities; neither implies a coin-toss advantage or establishes an FX performance result from an equity study.

A dragonfly doji has opening and closing prices near the high and a dominant lower shadow, producing a T-like silhouette. This locates O and C relative to the range; it does not reconstruct the order of intrabar prices or prove that buyers reclaimed territory. A bullish interpretation is a hypothesis to test.

A gravestone doji has O and C near the low and a dominant upper shadow, producing an inverted-T silhouette. It is the geometric counterpart of the dragonfly. Calling it bearish does not guarantee a subsequent decline or prove who traded at the high.

The same body can give a different measurement

Cases A and B below have the same 0.2-pip body but different ranges. Only A meets the illustrative rule. C has a larger body, and D has no range at all. A fixed pip allowance cannot reproduce this ratio, and replacing range with an average of earlier bodies creates a different classifier.

Hypothetical EUR/USD body/range comparison
A: qualifiesO/C 1.10000/1.10002; H/L 1.10050/1.09950. Body 0.2 pip / range 10 pips = 2%.
B: failsSame O/C; H/L 1.10005/1.09995. Body 0.2 pip / range 1 pip = 20%.
C: failsO/C 1.10000/1.10010; H/L 1.10050/1.09950. Body 1 pip / range 10 pips = 10%.
D: handle separatelyO = C = H = L = 1.10000. The ratio is 0/0, not 0%.
InterpretationPassing a geometric threshold does not establish the next price or a trade outcome.

A small but visible body with two shadows is often called a spinning top; the boundary depends on the tool’s definition. Do not turn the names into an efficacy ranking. Any empirical result needs its actual instrument, timeframe, rules, data and costs. An equity-pattern result cannot simply be treated as a global FX probability.

A rounded image can conceal a threshold crossing

Suppose a hypothetical display shows O = 1.10000, C = 1.10004, H = 1.10050 and L = 1.09950. From those displayed values the ratio is 4%, so our 5% rule passes. Assume, only for this test, that each higher-precision input was rounded to the nearest 0.00001. Different original inputs can produce this same display.

Higher-precision hypothetical candles with the same rounded display
VariantExact O / CExact H / LBody/range
A1.1000000 / 1.10004001.1005000 / 1.09950004.00%
B1.0999951 / 1.10004491.1004951 / 1.0995049About 5.03%

A passes and B fails. With each rounding error at most half a step, a conservative ratio interval is 0.00003/0.00101 to 0.00005/0.00099, about 2.97–5.05%. The image alone cannot determine whether an unknown higher-precision input passes.

This bound comes from rounding, not statistical market uncertainty. If the source file actually supplies only five decimal places, classify those data; do not invent hidden digits. Require finer inputs only when comparing with a detector that uses them. Check invalid OHLC and zero-range cases explicitly rather than infer inactivity from a small candle.

Available information and execution prices

A forming candle has no final C yet. If a rule requires a closed doji and then the next close outside its range, those conditions are available only after both periods finish. Do not use the second close in a decision assigned to the first bar. A final weekly candle is likewise unavailable in the middle of that week. Extra confirmation can change entries, distances, costs and trade count; test its combined effect rather than presume it improves reliability.

In a separate hypothetical execution model, sell 10,000 EUR at Bid 1.09880 and assume closing at Ask 1.10120. The 24-pip adverse difference gives a USD 24 loss; a USD 2 round-trip commission makes it USD 26. Spread is already included in the given execution prices, so do not subtract it again. If an ordinary stop instead fills at Ask 1.10170, the loss is USD 29 plus USD 2 = USD 31. A fixed 5–10-pip buffer does not guarantee a maximum loss.

  • Distances are not outcomes. In another hypothetical GBP/USD arithmetic model, a short fill at 1.2398 and planned exit at 1.2493 are 95 pips apart. Closing instead at 1.2280 or 1.2200 gives favorable distances of 118 or 198 pips, about 1.24 or 2.08 times 95, before costs.
  • Keep currency explicit. At 10,000 GBP, one GBP/USD pip is USD 1, so those gross amounts are USD 95, USD 118 and USD 198. An EUR account requires a stated conversion rate; USD 1 is not automatically EUR 1.
  • State the order rule. A target, trailing stop or stop-to-entry adjustment is a candidate for testing, not an instruction supplied by a candle name.
  • Check size constraints. Apply the provider’s minimum and step and the complete planned cost allowance. A smaller budget can require skipping a trade rather than rounding volume upward.

The candle name does not determine a stop or target, and there is no universal ordering in which average doji stops must exceed pin-bar stops. A greater planned distance reduces a distance-based reward/risk ratio only if the target distance is held fixed. Fill prices, fees, changing spreads and conversion can change the actual outcome.

Data, quote side and conditions to test

Check the feed, quote side and period boundaries. MT5 documents OTC candles based on Bid and exchange-instrument candles based on Last; a displayed candle is not automatically the Ask price of a buy. The diagram shows how a changing spread can give different Bid and Ask bodies over the same four ticks.

Tick volume and real deal volume are different fields. In MT5, tick volume counts received ticks during bar formation, while deal volume may be unavailable for OTC markets. Check what the instrument and provider supply. A candle’s geometry alone does not measure global turnover or identify a lack of trading.

For any contextual filter, define trend, level construction or timeframe alignment before inspecting future outcomes. Current-bar values can change; using a completed weekly shape in an earlier daily decision introduces information unavailable then. There is no universal H1 minimum, H4 optimum or fixed annual frequency implied by doji.

Additional price-derived indicators are not automatically independent evidence. Compare a fixed baseline with a specified extra condition, keeping all accepted and rejected cases, available fill assumptions and costs. Parameter changes need separate evaluation on unused data. Agreement between several drawings does not establish a profitable rule.

Practical takeaway: A doji uses a stated open-to-close tolerance and quote side. Those choices can change whether a candle meets the definition.

Errors that can change the calculation

Check these concrete errors before interpreting a chart or detector output. They affect reproducibility rather than establish a hierarchy of candles or timeframes.

  • Using a different denominator. Current range and earlier average bodies define different thresholds.
  • Treating zero range as 0%. The ratio 0/0 is undefined; handle it separately.
  • Ignoring precision. Identical rounded values can hide different higher-precision classifications.
  • Using the final shape too early. Record when the candle and any subsequent condition close.
  • Mixing price sides and costs. Bid and Ask can have different bodies; execution prices that already contain spread must not be charged spread again.

What to do when you close this page

Near-equal O and C summarize a period’s endpoints, without recovering its entire price path or the next direction. Cross-like, long-legged, dragonfly and gravestone forms describe geometry. Use the measurement exercises before assessing a separate trading rule.

  1. Recalculate the four cases. Confirm the 2%, 20%, 10% and undefined ratios; record why a fixed pip allowance differs.
  2. Recalculate the precision test. Verify that A and B round to the same displayed OHLC, then compare their exact ratios with 5%.
  3. Recalculate the quote-side model. Build Ask from the four Bid ticks and spreads, then measure its 6-pip body and 40-pip range. If testing trades, separately specify available order times, execution prices, size and all costs.

Related reading: Japanese candlesticks — the basics for the broader family of candlestick patterns; pin bar reversal trading for a comparison with another geometric pattern whose trading interpretation needs separate testing; most important candlestick patterns — the full survey that complements the doji family.