Hammer and inverted Hammer

The "Hammer and Inverted Hammer" indicator is straightforward and effective. It automatically spots key candlestick patterns for you, making it easier to see potential market turns. You can also adjust a few settings to fit your trading style. Simple, yet quite handy for traders!

Alerts for Hammer Pattern: When the script identifies a Hammer pattern, it can trigger an alert. This is particularly useful if you're looking for potential bullish reversal signals and don't want to miss them.

Alerts for Inverted Hammer Pattern: Similarly, when an Inverted Hammer pattern is detected, the script can also trigger an alert. This is helpful for spotting potential bearish reversal signals.


Minimum Lower Tail Length (%): This setting allows you to define what percentage of the total candle size should be considered a significant lower tail. This is important for identifying the Hammer pattern.

Number of Consecutive Candles (for Lower Tails): This input lets you choose how many consecutive candles with significant lower tails must be present to identify a pattern.

Percentage of Candle Below Previous Low: This setting determines what percentage of the candle's range must extend below the lowest low of a specified number of previous candles. It's used to assess the significance of a Hammer pattern.

Number of Previous Candles for Lowest Low: This decides how many previous candles the script should look at to calculate the lowest low, which is then used in the Hammer pattern analysis.

Minimum Upper Tail Length (%): Similar to the lower tail setting, this defines the significant length of an upper tail, used for identifying the Inverted Hammer pattern.

Number of Consecutive Candles (for Upper Tails): This input is for setting how many consecutive candles with significant upper tails are required to confirm an Inverted Hammer pattern.

Percentage of Candle Above Previous High: This setting is used to determine how much of the candle's range must be above the highest high of a set number of previous candles, aiding in the identification of the Inverted Hammer pattern.

Number of Previous Candles for Highest High: It specifies the number of past candles to consider for calculating the highest high, which is important for the analysis of Inverted Hammer patterns.

These settings allow you to customize how the script identifies Hammer and Inverted Hammer patterns, making it adaptable to different trading strategies and market conditions.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?