TradingView candlestick patterns

Tasuki gap patterns: gap rules and confirmation

A Tasuki gap is a three-candle continuation candidate. Two candles move with the trend and their real bodies gap apart; the third candle moves against them and closes inside that gap without filling it. Upside Tasuki follows an advance and downside Tasuki follows a decline. A completed shape does not establish that the trend will resume.

See the decision guide

Compare the bullish and bearish gap rules

TradingView describes a long first candle, a smaller second candle of the same color and an opposing third close inside the gap. Number the candles 1, 2 and 3, oldest first; O, H, L and C mean ordinary open, high, low and close. Under the stated candle colors, the body-gap boundaries reduce to C1 and O2.

  • The third-open containment test is explicit in TA-Lib. Its Tasuki implementation also compares bodies 2 and 3 for similar size using a configurable Near setting. TradingView documentation and TA-Lib are not interchangeable detector specifications.
  • A body gap permits overlapping shadows. A separate full-range test would require L2 > H1 for upside or H2 < L1 for downside. TradingView's Gaps indicator uses full high-low separation, so its gap boxes need not match a body-based Tasuki detector.
  • A wick that crosses the far edge is an intrabar fill even when the close stays inside. This page classifies the close-based shape and records wick fills separately; it does not claim the gap remained untouched throughout candle 3.
ConditionUpside TasukiDownside Tasuki
BackgroundPrior advancePrior decline
First two candlesC1 > O1 and C2 > O2C1 < O1 and C2 < O2
Body gap GO2 - C1 > 0C1 - O2 > 0
Third candleC3 < O3C3 > O3
Third open inside body 2O2 < O3 < C2C2 < O3 < O2
Third close inside gapC1 < C3 < O2O2 < C3 < C1
Close-based fill fraction F(O2 - C3) / G(C3 - O2) / G
Partial fill0 < F < 10 < F < 1

Fix the thresholds before scanning a chart

For a reproducible research variant, require three strictly rising closes immediately before candle 1 for upside, or three strictly falling closes for downside. Define B = abs(C - O). Require B1 >= 1.5 times the mean body of the preceding 20 completed bars, and 0 < B2 < B1. Apply every directional, opening and closing test in the table above.

  • These trend and body thresholds are chosen examples, not optimized values or TradingView defaults. This variant has no extra body-2/body-3 similarity filter and does not reproduce TA-Lib exactly. Save that distinction with your results.
  • Use a positive instrument tick t and tick-aligned prices. Strict inside means at least one tick away from each boundary: upside C1 + t <= C3 <= O2 - t; downside O2 + t <= C3 <= C1 - t. A one-tick gap cannot contain a tick-aligned close strictly inside it; a two-tick gap can.
  • Apply the same one-tick-inside logic to O3 within body 2. Do not widen the gap or round a boundary touch into a valid partial fill. Reject missing history, a nonpositive mean body, H < max(O, C), L > min(O, C), or H < L.
  • Evaluate the candidate only after candle 3 closes. TradingView offers SMA50, SMA50 with SMA200, and no trend detection for its built-in pattern studies. Record that selection when comparing built-in labels with a custom detector.

Recalculate a Tasuki gap in both directions

The following hypothetical examples use tick t = 0.01 and prior mean body = 2, making the long-body threshold 3. Assume preceding closes 97, 98, 99 for upside and 113, 112, 111 for downside. Tuples are (open, high, low, close). These are arithmetic examples, not observed trades.

  • Both pass the stated body-based research variant. Their overlapping shadows deliberately show why a separate full-range gap indicator can report no gap.
  • Upside: change only C3 to 104.50 and the closing fill becomes 75%. Downside: change only C3 to 105.50 and the closing fill also becomes 75%. Both remain partial fills with valid OHLC.
  • Upside: setting L3 = 103.50 while keeping C3 = 105 preserves the close-based candidate but creates an intrabar full fill. A stricter no-wick-fill variant would reject it. The downside mirror changes H3 to 106.50.
MeasurementUpside exampleDownside example
Candle 1(100, 105, 99, 104)(110, 111, 105, 106)
Candle 2(106, 109.50, 103.50, 109)(104, 106.50, 100.50, 101)
Candle 3(108, 109, 104.50, 105)(102, 105.50, 101, 105)
Bodies 1, 2 and 34, 3, 34, 3, 3
Body gap106 - 104 = 2106 - 104 = 2
Third open106 < 108 < 109101 < 102 < 104
Third close104 < 105 < 106104 < 105 < 106
Closing fill(106 - 105) / 2 = 50%(105 - 104) / 2 = 50%
Gap remaining at close105 - 104 = 1106 - 105 = 1
Full-range gap?No: L2 = 103.50 is below H1 = 105No: H2 = 106.50 is above L1 = 105

Reject boundary touches and distinguish full-gap patterns

A close at either gap endpoint fails the strict inside rule. The near edge means no closing penetration; the far edge means complete closing fill. The following boundary tests use the same gap from 104 to 106 and tick 0.01. When changing a close, extend its high or low if necessary so the OHLC remains valid.

  • Passing this table proves only the gap-close condition. Trend, colors, body size and the third open must still pass. An O3 exactly at an endpoint of body 2 fails the opening test.
  • Gap three methods requires the third close to travel through the gap and finish inside body 1 in TA-Lib. Merely touching the far gap edge fails Tasuki but does not automatically complete gap three methods.
  • Piercing is a two-candle bullish reversal candidate after a decline. TradingView requires the second candle to open below the first low and close above the first body midpoint. Tasuki uses three candles, two same-direction bodies and a remaining gap; it has no piercing midpoint-recovery requirement.
Third closeUpside gap testDownside gap test
104.00Reject: 100% filledReject: 0% filled
104.01Pass gap test: 99.5% filledPass gap test: 0.5% filled
105.99Pass gap test: 0.5% filledPass gap test: 99.5% filled
106.00Reject: 0% filledReject: 100% filled
G = 0Reject before dividing by GReject before dividing by G

Record confirmation and gap failure separately

One possible follow-up rule watches the next three completed candles. Confirm upside on a close above H2, or downside on a close below L2. Invalidate the pending gap hypothesis on an upside close at or below C1, or a downside close at or above C1. If neither event occurs, expire the candidate after three bars. This is a research rule, not part of the pattern name.

  • Freeze the original levels and end the pending state at the first qualifying close. A wick beyond H2 or L2 does not meet this closing confirmation rule.
  • Keep the original three-candle match if its later outcome fails. If confirmation occurs first and the gap fills later, record a confirmed candidate followed by failure, with both timestamps. Do not relabel the original candle history.
  • An unfinished observation window is incomplete, not expired. None of these labels specifies an entry fill, stop order, position size or expected return.
Event using the examplesUpsideDownside
First confirming close on the tick grid109.51100.49
Threshold touch, still pending109.50100.50
Gap invalidation boundary, inclusive104.00 or below106.00 or above
Three bars without either eventExpiredExpired

Know when an intraday chart cannot form the gap

If each new bar opens exactly at the preceding close, then O2 = C1 and the same-direction body gap is zero. That pair cannot form Tasuki under these rules. Frequent trading or a continuous session can leave few qualifying openings; the pattern name is not a reason to accept a no-gap substitute.

  • Check the actual OHLC rather than declaring an entire asset class ineligible. Session breaks, price jumps and sparse trading can produce discontinuities; a 24-hour label alone does not prove every adjacent open equals the prior close.
  • Keep symbol, exchange, timeframe, regular or extended session, and adjustment settings fixed. Missing bars or data-feed interruptions need investigation before a visual gap is treated as a market event.
  • Use ordinary candles for this price specification. TradingView documents Heikin-Ashi OHLC as synthetic. A gap between synthetic bodies does not establish the same gap in traded prices.

Build a detector from the rule sheet, then review the hits

Give Pine Script AI Coding Agent the body-gap definition, tick boundaries, chosen trend filter and follow-up window to draft a detector. Request separate candidate, confirmed, invalidated and expired markers. Compare the generated source and its output with the accepted and rejected numerical cases before adding strategy orders.

  • Ask explicitly for syntax checking, then verify detection behavior against OHLC. Compilation cannot prove that the intended pattern or its timing was implemented correctly.
  • Use AI Chart Analysis to review screenshots of matches and failures for visible candle structure and trend context. Keep numerical OHLC beside each image: screenshots cannot reliably resolve a one-tick boundary or supply off-screen reference history.
  • Save the rule version, candle timestamps, gap width, fill fraction and later outcome. Only then define entry, exit, fees and slippage for a separate strategy test. This page does not report a completed detector backtest.
Where Pineify fits

Pine Script AI Coding Agent

Draft a Tasuki detector from explicit OHLC and confirmation rules, then inspect the code and test its boundary cases.

Also useful: AI Chart Analysis. Review chart screenshots for visible pattern context and compare matches with failed examples. Check exact price boundaries in numeric data.

Draft my Tasuki gap detector

Frequently asked questions

Educational information, not investment advice. Prices and research thresholds are hypothetical. Pattern labels, AI interpretation and generated code do not establish predictive accuracy or guarantee profitable trades.

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.