Indicator · Pine Script v6 · On the chart

Hammer & Inverted Hammer Detector (with ATR and Table)

by gabriel-klettur

This indicator identifies Hammer and Inverted Hammer candlestick patterns overlaid directly on the price chart.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code79
Settings6inputs
LicenceNone stated
Last update7 months ago27 Mar 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Hammer & Inverted Hammer Detector (with ATR and Table) evaluates body proportions, upper wick lengths, and lower wick ratios against user-defined thresholds. To filter out low-volatility noise, candles are evaluated against an ATR multiplier requirement. When a valid pattern is identified, shape markers plot above or below the bar, normalized ATR lines plot on the main chart, and an on-screen table tracks the cumulative count of detected patterns.

Details

Published by

gabriel-klettur on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Candlestick patterns, Volatility & bands, Screeners & dashboards

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Body proportion (0.1 to 1)float0.2body_ratio
Lower wick proportion (0.1 to 1)float0.5lower_wick_ratio
Upper wick proportion (0.1 to 1)float0.5upper_wick_ratio
Maximum opposite wick proportion (0.1 to 1)float0.2small_wick_ratio
ATR periodint14atr_period
ATR multiplier for relevancefloat1.5atr_multiplier
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

This indicator plots buy and sell labels on the price chart. A buy appears when a short stochastic crosses up from below 20 while a slow MACD histogram is positive and a faster MACD histogram is negative. A sell uses the opposite stochastic and MACD alignment.

Indicator v5 Oscillators & momentumCandlestick patterns
Updated 5 months ago · None stated GitHub repository of Heikin Ashi with MACD Signals
1 stars

This indicator overlays rolling cost anchors, volatility-derived GetDelta bands, and liquidity provider ranges onto the price chart alongside pinbar candlestick detection. It calculates market valuation zones, shading discount and premium areas while tracking

Indicator v6 Candlestick patternsVolatility & bands
Updated today · AGPL-3.0 GitHub repository of BL-ESW Pinbar Market Lab Pro
575 stars

The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr

Indicator v6 SMC / ICT / price actionCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Displacement Candles Indicator
330 stars

This multi-symbol indicator evaluates a combined trading condition across up to 40 user-defined symbols. It processes MACD bullish crossovers, RSI thresholds, Bollinger Band boundaries, and DMI/ADX trend filters using security calls. When buy or sell criteria

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of Multi MACD + BB + RSI [Alorse]

Pricing Table

by namuan
318 stars

This indicator calculates theoretical options contract values and in-the-money probabilities using historical realized volatility across multiple standard deviations. It displays these metrics in a table overlay directly on the price chart. Users can adjust th

Indicator v4 Volatility & bandsScreeners & dashboards
Updated 2 months ago · MIT GitHub repository of Pricing Table

Body Mass Indicator

by harryguiacorn
219 stars

The Body Mass Indicator highlights candles with exceptionally large body ranges relative to recent price movement. It calculates the absolute distance between open and close prices. When enabled, it identifies bars where the body range achieves a new high over

Indicator v5 Volatility & bandsCandlestick patterns
Updated 1 year ago · None stated GitHub repository of Body Mass Indicator

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers