Pin Bar (Pinocchio Bar)

The pin bar is a single-candle reversal pattern characterised by a long wick (or shadow) that 'probes' beyond a key level before price snaps back. It signals rejection of a price level and is one of the most popular patterns among price action traders.

What Makes a Valid Pin Bar

A high-quality pin bar has three components:

  • A long tail (shadow) that protrudes clearly beyond surrounding price action
  • A small real body positioned at the opposite end of the tail
  • The tail should ideally be 2–3× the length of the body

A bullish pin bar has its long tail pointing downward (rejection of lower prices). A bearish pin bar has its tail pointing upward (rejection of higher prices).

The pin bar is arguably the single most traded price action pattern. Its power comes from the story it tells: price moved aggressively in one direction, was rejected, and closed back near where it opened. That rejection narrative is what gives the pattern its edge.

Trading Pin Bars Effectively

The highest-probability pin bar setups share common traits:

  • They form at a confluent level — a zone where multiple factors align (e.g. a horizontal level + a moving average + a Fibonacci level)
  • The tail pierces through the level, trapping breakout traders on the wrong side
  • Volume is elevated during the formation, confirming active participation

Entry can be placed at the close of the pin bar or on a 50% retracement of the pin bar's range (a more aggressive approach that offers a tighter stop). The stop goes beyond the tail of the pin bar.

Pin Bars vs Hammers

While hammers and pin bars overlap conceptually, pin bar traders tend to place more emphasis on the location relative to a level and the protrusion of the tail beyond nearby candles. A hammer is defined by its shape; a pin bar is defined by both shape and context. In practice, many of the best setups qualify as both.

Measurement rules (detector-friendly)

For a pin bar to be mechanically tradable you need numeric rules, not just visual ones. A working definition used in most systematic pin bar detectors:

  • `tail_length >= body_size * 2.0` — tail at least twice the body
  • `body_position_ratio <= 0.35` — the body sits in the top 35% of the range (bullish pin) or bottom 35% (bearish pin), not in the middle
  • `opposite_wick <= tail_length * 0.25` — the wick on the opposite side is relatively small (this distinguishes a pin bar from a long-legged doji or spinning top)

Below is a minimal Pine Script detector that produces clean, signal-only marks on valid pin bars.

//@version=6
indicator("Pin Bar Detector", overlay=true)

tailMult   = input.float(2.0,  "Tail must be this many × body", minval=1.0, step=0.1)
bodyPos    = input.float(0.35, "Body within top/bottom fraction of range", minval=0.1, maxval=0.5, step=0.05)
oppWickMax = input.float(0.25, "Opposite wick ≤ this × tail",   minval=0.05, maxval=0.5, step=0.05)

bodySize   = math.abs(close - open)
rangeSize  = high - low
upperWick  = high - math.max(close, open)
lowerWick  = math.min(close, open) - low

// Bullish pin: long lower tail, body near top
bullTail   = lowerWick >= bodySize * tailMult
bullBody   = (math.min(close, open) - low) >= rangeSize * (1 - bodyPos)  // body sits in upper portion
bullOpp    = upperWick <= lowerWick * oppWickMax
bullishPin = bullTail and bullBody and bullOpp and barstate.isconfirmed

// Bearish pin: long upper tail, body near bottom
bearTail   = upperWick >= bodySize * tailMult
bearBody   = (high - math.max(close, open)) >= rangeSize * (1 - bodyPos)
bearOpp    = lowerWick <= upperWick * oppWickMax
bearishPin = bearTail and bearBody and bearOpp and barstate.isconfirmed

plotshape(bullishPin, title="Bullish Pin", style=shape.triangleup,   location=location.belowbar, color=color.green, size=size.small)
plotshape(bearishPin, title="Bearish Pin", style=shape.triangledown, location=location.abovebar, color=color.red,   size=size.small)