TradingView candlestick patterns

Stick sandwich candlestick: matching closes and context

A stick sandwich candlestick pattern has three candles: bearish, bullish, then bearish, with the first and third closing at the same or nearly the same price. It is traditionally considered a bullish reversal candidate after a decline. Matching closes identify a price level to investigate; they do not prove support or establish that a reversal has begun.

See the decision guide

Choose which stick sandwich definition you are testing

The thinkorswim reference requires a bearish first candle in a downtrend, a bullish second candle opening above the first close, and a bearish third candle closing at the first close. TA-Lib uses a stricter middle-candle location: its low must exceed the first close. TA-Lib permits a configurable equality tolerance and does not test the preceding downtrend.

  • A middle candle can open above the first close and still dip below it. That passes the stated opening comparison but fails the stricter low comparison.
  • The specification below uses the stricter location, an explicit prior-decline filter and a tick-based equality rule. It is a custom research definition, not a claim to reproduce TradingView, thinkorswim or TA-Lib defaults.
  • Candle color is determined by close versus open. A hollow or green chart display alone is insufficient if the chart uses a different color convention.

Define the OHLC and close-tolerance rules

Number the three completed ordinary candles 1, 2 and 3, oldest first. O, H, L and C mean open, high, low and close. Let q be the symbol minimum tick and N be a nonnegative integer tolerance in ticks. This example sets N = 2; the allowed price difference is T = N × q.

  • TradingView exposes the chart dataset minimum tick as syminfo.mintick. It is a price increment, not a pip or the cash value of a futures tick. Read it for the actual exchange-qualified symbol.
  • For tick-aligned OHLC, compare the integer tick coordinates of the two closes. This prevents decimal floating-point noise from rejecting an exact boundary. Verify alignment first; do not silently round malformed or differently adjusted data into a match.
  • Reject missing history, a nonpositive tick, invalid OHLC ranges or open/close values outside their high-low range. This definition adds no body-length ratio, shadow-length limit or third-candle opening gap.
  • A two-tick rule has no universal market significance. On a coarse-price grid it may be wide relative to the candle body. Record the tolerance and inspect that scale before testing; changing it changes the population of candidates.
TestRule
Prior declineThe three closes immediately before candle 1 decrease strictly
Outer bodiesC1 < O1 and C3 < O3
Middle bodyC2 > O2; a doji is excluded
Middle locationL2 > C1; equality fails
Close matchabs(C3 - C1) <= N × q; equality at the boundary passes
Strict modeN = 0 requires C3 = C1

Two ticks mean different price distances

These hypothetical examples isolate the close-match test. Assume valid tick-aligned prices and that every other pattern rule passes. Price units are arbitrary; these rows are not quotes for particular instruments.

  • The tolerance is symmetric. With q = 0.25, closes from 99.50 through 100.50 qualify in quarter-point steps; 99.25 fails. With N = 0, only 100.00 qualifies.
  • Using a fixed 0.02 allowance on all three grids changes the rule: it is two ticks on the first, less than one tick on the second, and 200 ticks on the third. Decimal places alone do not define comparable tolerance.
Minimum tick qFirst close C1T at N = 2At the included upper edgeOne tick beyond
0.01100.000.02C3 = 100.02: passC3 = 100.03: fail
0.25100.000.50C3 = 100.50: passC3 = 100.75: fail
0.00011.10000.0002C3 = 1.1002: passC3 = 1.1003: fail

Walk through a candidate and rejected near matches

Assume q = 0.25, N = 2 and prior closes of 105, 104.50 and 104 in chronological order. The hypothetical candles below form a candidate at candle 3 close. The matching distance is abs(100.25 - 100) = 0.25, or one tick, within the two-tick limit of 0.50.

  • The middle candle has a positive 2.00 body and L2 = 100.25 > C1 = 100. Changing only L2 to 100 makes the strict location test fail, even though its open remains above C1.
  • Changing only C3 to 100.50 still passes; 100.75 fails. Changing only C2 to 100.50 creates a doji and fails the middle-body rule.
  • Changing the preceding closes to 104, 104 and 103.50 fails the strict decline filter. The three-candle shape can still exist without qualifying as this reversal candidate.
  • The first and third lows differ, and both are below their closes. The close match therefore says nothing about an exact match of the lower extremes.
CandleOpenHighLowClose
1: bearish103.00103.2599.75100.00
2: bullish100.50102.75100.25102.50
3: bearish103.00103.5099.50100.25

Separate confirmation, expiry and failed support

For a declared follow-through test, freeze U = max(H1, H2, H3) and D = min(L1, L2, L3). Watch the next three completed bars. The first close above U confirms the upward hypothesis; the first close below D invalidates it. If neither occurs, expire the pending candidate after the third close. These thresholds and the three-bar window are example research choices.

  • Keep the original candidate time separate from the confirmation time. Later information cannot justify placing a confirmed historical signal on candle 1 or candle 3.
  • This is a close-based event test, not an intrabar stop system. A bar may trade below D and recover before closing; that excursion does not invalidate this particular rule. A different rule using lows will produce different results.
  • A confirmation does not establish a profitable trade. Entry timing, position size, costs, stop execution and exit rules remain separate; a gap can prevent a fill at the intended price.
Independent path after the example: U = 103.50, D = 99.50Outcome
A later high is 103.75, but its close is 103.25Pending: a wick above U is insufficient
A later close equals 103.50 or 99.50Pending: the boundary tests are strict
The next close is 103.75Confirmed at that close
The next close is 99.25Invalidated; the matched closes did not hold
The next three closes are 101.00, 102.00 and 103.50Expired without confirmation
A close of 103.75 confirms, then price later closes at 99.25Record later failure without deleting the earlier confirmation

Stick sandwich versus tweezer bottom

TradingView describes a tweezer bottom as two candles with nearly identical lows, with bearish then bullish bodies after a decline. Stick sandwich uses three candles and matches the first and third closes. Substituting lows for closes changes which pattern is being measured.

FeatureStick sandwichTweezer bottom
Number of candlesThreeTwo
Body sequenceBearish, bullish, bearishBearish, bullish
Matched priceFirst and third closeFirst and second low
What the match establishesA measured close-level relationshipA measured low-level relationship

Review the detector before testing a strategy

Give Pine Script AI Coding Agent the OHLC rules, tick tolerance, prior-close filter and follow-through window to draft a detector. Request separate candidate, confirmed, invalidated and expired events, evaluated on completed bars. Review the generated source and request syntax checking before comparing its output with these cases.

  • Record the symbol, timeframe, session, adjustment settings, timestamps and raw OHLC values for both matches and rejected near matches. Keep ordinary candles and the price feed consistent across the review.
  • Use AI Chart Analysis to review a screenshot of the visible trend and candle sequence. Compare a hit with a failure sample. Retain the numeric OHLC alongside the image: pixels cannot certify a one-tick difference or recover off-screen history.
  • Only after the detector matches the declared rules should you specify strategy orders and test outcomes. Compilation, image agreement and pattern counts do not establish a trading advantage.
Where Pineify fits

Pine Script AI Coding Agent

Draft a detector from the close-tolerance and confirmation rules, then review its conditions against the accepted and rejected cases.

Also useful: AI Chart Analysis. Upload chart screenshots to review visible candle context. Use numeric OHLC values to verify exact tick tolerances.

Draft my stick sandwich detector

Frequently asked questions

Educational information, not investment advice. Prices, tolerance and follow-through rules are hypothetical research examples. No measured success rate or profitability is claimed. Pattern candidates and confirmed events can fail, and trading can lose money.

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.