The shape of the candle is the same, but depending on where it appears it receives one name or another. In both cases, it usually marks the end of the preceding trend. For the same reason, for a candle with these characteristics to be considered as a hammer or a hanging man, it is essential that it appear at the end of a trend. If it appears in the middle of a lateral movement, it loses its meaning:
Ideally, the upper shadow does not exist (the opening price coincides with the maximum of the session) but in practice, the figure is valid if the upper shadow is very small. The lower shadow should always belong and the body small, the smaller the better. The color of the body is indifferent, be it a hammer or hanged man.
The meaning of the hammer is more intuitive. During the session, prices have had a strong fall (as shown by the large lower shadow) which is a continuation of the downtrend that the price brought, but by the end of the session they have recovered and close near the highs. The market has quickly rejected prices so low that they have been reached in the middle of the session, showing that the downtrend is losing steam and at those prices, sellers are not willing to lower prices further and buyers find them attractive.
If the hammer is successful and works as such, prices should not fall below the low of the session in which the hammer is formed, although they may not go up immediately and even return to that low zone, without breaking it, in the following sessions: https://finmaxbo.com/en/strategy/498-trading-hammer-and-hanging-man.html.
For a hanging man to be considered as such, a confirmation must take place on the next candle. This confirmation consists of the next candle having a black body and its closure is below the body of the hanging man, as seen in the previous graph. This confirmation is due to the fact that the long shadow of the hanging man in principle has bullish implications since it assumes that the market has recovered from a sharp fall in the same session. That is why it is essential that the next candle shows that the market falls again and the prices that were rejected in the previous session are accepted in the next session.
Hammers are more common than hanged men. The hammers can appear in any type of minimum (main, secondary, etc.), and although the hanging men also, they are more typical of all-time highs.