DovCaspi

Hammer, Hanging man, Shooting star, Inverted hammer Indicators

This script creates Hammer , Hanging man , Shooting star , Inverted hammer chart indicators.
RED + CROSS = Sell
GREEN + DOT = Buy
Remove from Favorite Scripts Add to Favorite Scripts
study("Hammer and Hanging man", overlay=true)

high_h = high[1]
low_h = low[1]
open_h = open[1]
close_h = close[1]

shadow_h = high_h - low_h
body_h = abs(open_h - close_h)
bodyMid_h = 0.5 * (open_h + close_h) - low_h


shadow = high - low
body = abs(open - close)
bodyMid = 0.5 * (open + close) - low
bodyRed = open > close and body > (0.3 * shadow)
bodyGreen = close > open and body > (0.3 * shadow)

bodyTop =  bodyMid_h > (0.7 * shadow_h)
bodyBottom =  bodyMid_h < (0.3 * shadow_h)
hammerShape = body_h < (0.5 * shadow_h)

hangingMan = bodyRed and hammerShape and bodyTop ? high_h : na
hammer = bodyGreen and hammerShape and bodyTop ? high_h : na

shootingStar = bodyRed and hammerShape and bodyBottom ? low_h : na
invertedHammer = bodyGreen and hammerShape and bodyBottom ? low_h : na

plot( hangingMan  , title="Hanging man", style=cross, linewidth=10,color=red, transp=95, offset = -1)
plot( hammer  , title="Hammer", style=circles, linewidth=10,color=green, transp=95, offset = -1)


plot( shootingStar  , title="Shooting star", style=cross, linewidth=10,color=red, transp=95, offset = -1)
plot( invertedHammer  , title="Inverted hammer", style=circles, linewidth=10,color=green, transp=95, offset = -1)
@DovCaspi isnt there a mistake here : shadow_h = high_h - low_h ?

I think shadow should be define in two ways : upper shadow = high_h - max(open_h,close_h) and lower shadow = min(open_h,close_h)-low_h

I tweak the indicator and I see much better hammers ;)
+1 Reply
It lags because it uses confirmation. if bearish signal, indicator checkout that next candle is red. if bullish signal ( eg hammer ) indicators checks for next candle = green ;)
Reply
Does it lag thru the eod. Basically, Could you place and AA trade on the indicator or does it not show up until the next morning?
+1 Reply
Thanks for the indicator. The only negative is that it's lagging (1 day). How would you tweak it so that it's showing real-time info on the candle that is being formed? TIA
Reply
Thanks for sharing. Very good indicator.
Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out