TradingView candlestick patterns

Gravestone doji candlestick: shape, confirmation and failure

A gravestone doji candlestick has nearly equal opening and closing prices near the low, with a long upper shadow. It records an advance that was largely given back within the bar. After a rise, it can support a bearish reversal hypothesis; the shape alone does not confirm a top or predict the next close.

See the decision guide

Define how close the body must be to the low

TradingView describes a doji near the low with a long upper shadow, but its support article does not specify a universal percentage cutoff. The following is a custom, illustrative definition for ordinary OHLC candles. Let O, H, L and C mean open, high, low and close, and let R = H - L. Reject a zero-range candle before dividing by R.

  • All conditions must pass. The endpoint rule already implies an upper shadow of at least 90%; the 80% rule is retained as an independent input if the endpoint tolerance is later widened.
  • Example: O = 100.10, H = 104.00, L = 100.00 and C = 100.05. R is 4.00; the body is 1.25%, the highest body endpoint is 2.5% above the low, the upper shadow is 97.5%, and the lower shadow is 1.25%.
  • These percentages are assumptions, not TradingView defaults or tested optimal settings. A candle with a 7% body fails this example even if it looks like a doji on a compressed chart.
  • For instruments with coarse ticks, a one-tick change can cross a percentage boundary. Record the tick size and avoid silently rounding a failed candle into a match.
MeasurementCalculationIllustrative requirement
Small bodyAbsolute difference between C and O, divided by RAt most 5%
Both endpoints near the low(max(O, C) - L) / RAt most 10%
Long upper shadow(H - max(O, C)) / RAt least 80%
Lower shadow(min(O, C) - L) / RAt most 5%

Gravestone doji versus shooting star

Both shapes place the body near the bottom of a long upper shadow. The gravestone adds the doji requirement: the open and close are nearly the same. A shooting star can have a small but visible body. TradingView describes the shooting star in an uptrend; neither name establishes that a reversal has happened.

  • A green gravestone can still satisfy the geometry. In the numerical example, swapping O and C changes body color but leaves all four ratios unchanged.
  • A long upper wick without a sufficiently small, low-positioned body is not enough. Keep rejected candles in a review sample so the boundary remains visible.
FeatureGravestone dojiShooting star
BodyNear-zero body under a declared doji toleranceSmall body that need not meet the doji tolerance
Upper shadowDominates the candle rangeLong relative to the small body
ContextBearish reversal hypothesis after a riseBearish reversal hypothesis after a rise
Classification boundaryThe example accepts body / range up to 5%A larger body may fit a separate shooting-star rule; it is not automatically one

Define the prior rise and the next-bar decision

For this illustrative reversal test, require the close immediately before the candidate to be above its own 20-bar simple moving average, with that average higher than five bars earlier. Skip candidates without enough history. This is a reproducible trend filter, not proof that the market is at a top.

  • At the candidate close, save its high and low. Geometry and the prior-rise filter create a candidate, not a confirmed short signal.
  • With confirmation enabled, inspect only the immediately following completed bar. Require its close below the saved low and its high at or below the saved high.
  • If the next bar trades above the saved high, invalidate the candidate even if it later closes below the saved low. This stated precedence avoids guessing the intrabar price path.
  • Otherwise, a next-bar close at or above the saved low expires the candidate without confirmation. Do not extend the window after seeing later prices.
  • With confirmation disabled, label the event as a shape candidate at its own close. Keep that sample separate from next-bar-confirmed events when comparing results.

Follow an unconfirmed candle and a false reversal

Use the hypothetical candidate above, with a saved low of 100 and high of 104, after a prior rise that passes the filter. Each row below is an alternative path, not a sequence of historical trades. All prices use the same arbitrary price units.

  • If the same candle appears in a sideways range and fails the prior-rise filter, it remains a shape match outside this reversal setup.
  • A confirmation adds information and costs time. Price may already have moved away from the candidate low when the condition becomes knowable.
  • The later 104.50 close does not erase the earlier signal. A failure label is an evaluation rule, not a stop order or an assumption that a trade can exit at that close.
  • A detector is not a complete strategy. Entry timing, stop execution, position size, exit horizon, commissions and slippage still need separate rules. No win rate follows from these examples.
Following price actionClassificationReason
Next bar: high 103.00, low 99.60, close 100.30Expired without confirmationA wick below 100 does not meet the closing condition
Next bar: high 103.00, low 99.40, close 99.70Confirmed at the next bar closeClose is below 100 and high does not exceed 104
Next bar: high 104.20, low 99.40, close 99.70Invalidated before confirmationThe high breach takes precedence over the bearish close
After the valid 99.70 confirmation, a later bar closes at 104.50Confirmed signal followed by failureFor this review, a later close above 104 invalidates the reversal hypothesis

Check the chart before turning the rules into a script

In TradingView, open Indicators, metrics, and strategies, then Technicals → Patterns to find the built-in candlestick indicators. Compare their labels with your written rules; different tolerances and trend filters can legitimately produce different matches. The custom thresholds on this page do not reproduce the built-in detector.

  • Wait for the candidate candle to close before evaluating its final shape. An open candle can gain a larger body or a new low and stop qualifying.
  • Next-bar confirmation becomes knowable one completed bar later. A marker placed on the original candle must not imply that the later information was available then.
  • Use ordinary candles for this OHLC definition. TradingView documents Heikin-Ashi prices as synthetic; a gravestone-like shape there describes transformed values.
  • To draft a custom detector, give Pineify the four tolerances, the prior-rise filter, and independent switches for trend and next-bar confirmation. Request separate markers for shape candidates, confirmations and invalidations.
  • Review the generated conditions, run syntax validation, and check the hypothetical cases bar by bar. Closing-bar logic addresses changing intrabar values; it is not a blanket guarantee against every source of repainting.
Where Pineify fits

Pine Script AI Coding Agent

Turn the written tolerances and confirmation choices into a Pine Script draft. Inspect the generated logic and chart behavior before using alerts. This educational page does not scan symbols or provide live signals.

Draft gravestone doji rules

Frequently asked questions

Educational information, not investment advice. Prices, thresholds and event paths are hypothetical and do not report trading results. A pattern or confirmation does not guarantee a reversal, an executable price or profit.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.