Hammer to inverted Hammer
- This topic has 2 replies, 2 voices, and was last updated 7 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
Similar topics:
Forums › ProRealTime English forum › ProOrder support › Hammer to inverted Hammer
Hi everyone,
could someone please help me to change this code to an inverted hammer?
1 2 3 4 |
REM Hammer c31 = ABS(Min(Close,Open) - High) <= (AverageTrueRange[14](Close)/atrDoji) AND ABS(Max(Close,Open) - High) <= (AverageTrueRange[14](Close)/atrDoji) AND (ABS(Close - Open) < AverageTrueRange[14](Close)/atrDoji) AND (Min(Close,Open) - Low >= AverageTrueRange[14](Close)/atrLongue) RETURN c31 |
because this code for an inverted hammer, does not consider inverted hammers with a shadow:
1 2 3 4 5 6 7 8 9 10 11 |
REM Detection of "black gravestone" or "inverted hammer" candlestick formations. MarteauInverse = close>open AND low=open AND (high-close)>=3*(close-open) IF MarteauInverse THEN structure=1 ELSE structure=0 ENDIF RETURN structure AS"Gravestone or Inverted Hammer Detection" |
Thank you so much!:)
The Inverted Hammer is required to have an upper shadow at least twice the size of the real body (whose color does not matter), while there should be a little o no lower shadow, this is the code (for the lower shadow the percentage can be changed to your likings):
1 2 3 4 |
RealBody = abs(close - open) UpperShadow = high - max(open,close) LowerShadow = min(open,close) - low InvertedHammer = (RealBody <= (UpperShadow * 0.5)) AND (LowerShadow <= (RealBody * 0.05)) |
InvertedHammer will be set to 1 if true, 0 otherwise.
Find exclusive trading pro-tools on