TradingView candlestick patterns

Gap three methods patterns: upward and downward variants

Downside gap three methods is a three-candle formation: two bearish candles gap downward, then a bullish candle opens inside the second body and closes inside the first body, filling the gap. Upside gap three methods reverses those directions. Both have a traditional continuation interpretation, but the third candle only establishes the shape; continuation requires a separate observation. State whether your gap test uses bodies or full high-low ranges.

See the decision guide

Choose a gap definition before comparing detectors

The sources use different tests. Thomas Bulkowski describes gaps between the shadows of the first two candles. TA-Lib's CDLXSIDEGAP3METHODS implementation compares real bodies and requires the third open inside the second body and third close inside the first. Its condition does not test a prior trend or a minimum body length. A match in one implementation can therefore be absent in another.

  • Number the completed candles 1, 2 and 3, oldest first. O, H, L and C mean ordinary open, high, low and close.
  • The worked specification below combines full-range separation with strict body containment. Its extra trend, body-size and tick thresholds are research choices, not a reproduction of TA-Lib or a TradingView built-in default.
Gap measureDownsideUpside
Real bodies, assuming the stated colorsC1 - O2 > 0O2 - C1 > 0
Full high-low rangesL1 - H2 > 0L2 - H1 > 0
Gap interval for the full-range versionH2 to L1H1 to L2

A complete rule sheet with explicit tolerances

Use a positive minimum tick t. Require the five closes immediately before candle 1 to fall strictly for the downside version or rise strictly for the upside version. Define a long body as at least 1.5 times the mean absolute body over the 20 bars before candle 1. Require both first bodies to meet that threshold and reject a zero baseline. These filters make the example reproducible; they are not optimized settings.

  • A wick touch gives a zero gap and fails. A third close exactly on a first-body endpoint also fails the one-tick-inside rule, even when it has crossed the entire high-low gap.
  • Use prices on the instrument's tick grid. Do not round a failing observation into a match. Reject missing data, insufficient reference history and invalid OHLC where H < max(O, C), L > min(O, C), or H < L.
  • Keep full-range and body-gap results in separate samples. Relaxing the wick test changes the detector, rather than fixing an error in the stricter version.
ConditionDownside gap three methodsUpside gap three methods
First two directionsC1 < O1 and C2 < O2C1 > O1 and C2 > O2
Full-range gap of at least one tickL1 - H2 >= tL2 - H1 >= t
Third directionC3 > O3C3 < O3
Third open, at least one tick inside body 2C2 + t <= O3 <= O2 - tO2 + t <= O3 <= C2 - t
Third close, at least one tick inside body 1C1 + t <= C3 <= O1 - tO1 + t <= C3 <= C1 - t
When to record the shapeAfter candle 3 closesAfter candle 3 closes

Recalculate a downside example and its upside mirror

These hypothetical prices use t = 0.01 and a prior 20-bar mean body of 3, so the long-body threshold is 4.5. The first two bodies are both 5. Assume five preceding closes of 116, 115, 114, 113 and 112 for downside, and 84, 85, 86, 87 and 88 for upside. Each tuple is (open, high, low, close).

  • For downside, close-based fill = 100 × clamp((C3 - H2) / G, 0, 1). For upside, it is 100 × clamp((L2 - C3) / G, 0, 1). Clamp limits the ratio to the interval 0 to 1. Calculate it only when G > 0.
  • Both examples fill 100%: the raw ratio is 4 / 2 = 2, capped at 1. The third close travels two price units beyond the far edge of the full-range gap and ends inside body 1.
  • In the downside example, change only C3 to 103. The close has filled (103 - 102) / 2 = 50%, while H3 = 107 shows an intrabar fill. It fails the required close inside body 1. A wick fill and a closing fill must be recorded separately.
  • Change downside C3 to 104: the full-range gap is 100% filled, but C3 remains below body 1, which starts at 105. The complete pattern still fails. At C3 = 105.00 it touches the body endpoint and fails; at 105.01 it passes that boundary.
  • Change downside H2 to 104: the bodies remain separated by 4, but the full-range gap is zero. The strict version fails, and its fill ratio is undefined. Change H2 to 105 to create overlapping wicks; the body-gap condition remains true.
ObservationDownside exampleUpside example
Candle 1(110, 111, 104, 105)(90, 96, 89, 95)
Candle 2(101, 102, 95, 96)(99, 105, 98, 104)
Candle 3(99, 107, 98, 106)(101, 102, 93, 94)
Full-range gap G104 - 102 = 298 - 96 = 2
Body gap105 - 101 = 499 - 95 = 4
Third open inside body 296.01 <= 99 <= 100.9999.01 <= 101 <= 103.99
Third close inside body 1105.01 <= 106 <= 109.9990.01 <= 94 <= 94.99

Compare Tasuki, five-candle methods and gapping plays

Use the position of the third close to separate a Tasuki gap from gap three methods. TradingView describes Tasuki as a three-candle continuation pattern whose opposing third candle closes within the gap without filling it completely. A partial fill alone is not enough to establish every Tasuki condition; compare the trend, body directions and opening relationships too.

  • Steve Nison's Candlecharts describes high-price and low-price gapping plays around a consolidation. Those are related gap structures, not alternate names for this three-candle fill pattern.
  • The word three in rising or falling three methods refers to the middle consolidation group in the standard five-candle description. Do not substitute that detector for gap three methods.
Pattern familyStructureDistinguishing observation
Upside or downside gap three methodsThree candles; first two share a direction and gap apartThe opposing third body crosses the gap and closes inside body 1 in the specification here
Upside or downside Tasuki gapThree candles with an opposing third candleThe third close remains within the gap; it does not fully close it
Rising or falling three methodsFive candles in the TradingView definitionThree small opposing bodies sit within candle 1 range; candle 5 resumes the original direction and closes beyond candle 1 close
High price gapping playAdvance, small-body consolidation near the highs, then a gap above itThe gap follows the consolidation; a third-candle fill is not its defining test
Low price gapping playDecline, small-body consolidation near the lows, then a gap below itThe downside counterpart of the high-price consolidation breakout

Separate completion, confirmation and later failure

Bulkowski reports outcomes that conflict with the traditional continuation labels, so treat continuation as a hypothesis. For a reproducible audit, save the high U and low D across all three candles at candle 3 close. Inspect the next five completed bars. The first close at least one tick above U is an upward outcome; the first close at least one tick below D is a downward outcome. This is an illustrative classification rule, not a tested trading system.

  • A downside close of 94.99 followed by 111.01 within five further bars is a confirmed continuation followed by a failure under this audit rule. Keep both timestamps; do not erase the original match.
  • An intrabar boundary breach does not satisfy a closing rule. If the chart ends before the observation window does, mark the outcome incomplete instead of classifying it as unconfirmed.
  • The gap itself gives no profit target or position size. Orders, stop execution, fees and slippage require a separate strategy specification. A later gap can prevent execution at the intended threshold.
Outcome within the next five barsDownside exampleUpside example
ContinuationClose <= 94.99, below D = 95Close >= 105.01, above U = 105
Opposite-direction breakoutClose >= 111.01, above U = 111Close <= 88.99, below D = 89
No eligible closeRecord unconfirmed at the end of bar 8Record unconfirmed at the end of bar 8

Review the exact bars before generating a detector

Use ordinary TradingView candles and preserve the exchange-qualified symbol, timeframe, session and adjustment settings with each example. Heikin-Ashi OHLC is synthetic. If adjacent bars open exactly at the preceding close, their full ranges share a price and cannot satisfy a strict gap. Missing bars or a change in chart settings can also change what appears separated.

  • Give Pine Script AI Coding Agent the complete rule sheet, reference window, tick buffer and confirmation timing. Ask for separate rejection reasons and shape versus outcome markers. Inspect the generated source, run syntax validation and compare it with every accepted and rejected example above.
  • Upload a readable screenshot to AI Chart Analysis to review the visible trend and candle structure. Include failed examples as well as matches. Check exact OHLC in chart data because an image cannot reliably settle a one-tick boundary or reveal off-screen history.
  • Record body gap, full-range gap, closing fill percentage and classification separately. This page provides a written specification and hypothetical cases; it has not executed a detector or measured a trading advantage.
Where Pineify fits

Pine Script AI Coding Agent

Turn explicit OHLC rules into a draft detector, then inspect its source and compare matches with the numerical cases before adding orders or alerts.

Also useful: AI Chart Analysis. Review visible candle structure in uploaded chart screenshots. Verify exact gap boundaries in OHLC data separately.

Draft my gap three methods detector

Frequently asked questions

Educational information, not investment advice. All prices, thresholds and outcome paths here are hypothetical. Pattern completion, AI analysis and code generation do not establish a trading advantage or guarantee execution 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.