indicator · on price · open source

Hammer

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Hammer: small body at the top of the candle with a long lower wick (≥ 60% of range) and a tiny upper wick. Bullish reversal signal at the bottom of a downtrend.

  • Triangle marker below the bar + green bar colour.
  • Most reliable when it forms after a sharp decline and the next candle confirms upward.

Source code

//@version=5
indicator("Hammer", overlay=true)
bodyMax = input.float(0.3, "Body max % of range", minval=0.05, step=0.05)
lowerMin = input.float(0.6, "Lower wick min %", minval=0.3, step=0.05)
upperMax = input.float(0.2, "Upper wick max %", minval=0.05, step=0.05)
hlRange = high - low
smallBody = hlRange > 0 and math.abs(close - open) < hlRange * bodyMax
longLower = math.min(close, open) - low > hlRange * lowerMin
tinyUpper = hlRange > 0 and high - math.max(close, open) < hlRange * upperMax
hammer = smallBody and longLower and tinyUpper
barcolor(hammer ? color.green : na)
plotshape(hammer, "Hammer", style=shape.triangleup, location=location.belowbar, color=color.green, text="H")
alertcondition(hammer, "Hammer", "Hammer candle printed")

Comments

No comments yet.

Sign in to comment.