indicator · on price · open source
Hanging Man
Running…
Loading chart…
About
Hanging Man: hammer shape (small body, long lower wick) that appears at the top of an uptrend instead of a downtrend. Bearish reversal warning.
- Only flagged when the prior close is above its 20-SMA (uptrend context).
- Red bar colour highlights the warning; confirmation candle is still required.
Source code
//@version=5
indicator("Hanging Man", overlay=true)
hlRange = high - low
smallBody = hlRange > 0 and math.abs(close - open) < hlRange * 0.3
longLower = math.min(close, open) - low > hlRange * 0.6
tinyUpper = hlRange > 0 and high - math.max(close, open) < hlRange * 0.2
uptrend = close[1] > ta.sma(close, 20)
hm = smallBody and longLower and tinyUpper and uptrend
barcolor(hm ? color.red : na)
plotshape(hm, "Hanging Man", style=shape.triangledown, location=location.abovebar, color=color.red, text="HM")
alertcondition(hm, "Hanging Man", "Hanging Man pattern printed in uptrend")
No comments yet.
Sign in to comment.