OPEN-SOURCE SCRIPT
Pin Bar Detector [SSFX]

Pin Bar Detector [SSFX] is an indicator designed to automatically identify Bullish Pin Bars and Bearish Pin Bars directly on the chart based on candle structure and wick proportions. It is built for price action traders who want a fast and objective way to spot rejection candles without manually checking every bar.
The script evaluates each candle using three main components:
For a Bullish Pin Bar, the indicator looks for candles with:
For a Bearish Pin Bar, the indicator looks for candles with:
One of the main strengths of this script is its flexibility. Users can adjust how strict the pin bar definition should be through the available inputs:
In addition to wick and body structure, the indicator also includes an optional candle color filter for stricter confirmation:
This helps filter out candles that visually resemble pin bars but close with weaker confirmation.
For visualization, the indicator supports:
This indicator can be useful in many price action situations, such as:
Disclaimer: This indicator is for educational and research purposes only. It does not provide financial advice or guarantee trading performance.
The script evaluates each candle using three main components:
- Body size relative to the full candle range
- Main wick size
- Opposite wick size
For a Bullish Pin Bar, the indicator looks for candles with:
- a small body
- a long lower wick
- a small upper wick
For a Bearish Pin Bar, the indicator looks for candles with:
- a small body
- a long upper wick
- a small lower wick
One of the main strengths of this script is its flexibility. Users can adjust how strict the pin bar definition should be through the available inputs:
- Max body % of candle range: sets the maximum body size allowed relative to the full candle range
- Min long wick % of candle range: requires the main wick to represent at least a certain percentage of the full candle range
- Max opposite wick % of candle range: limits the size of the opposite wick so the candle keeps a clean pin bar structure
In addition to wick and body structure, the indicator also includes an optional candle color filter for stricter confirmation:
- Bullish Pin Bar must close bullish
- Bearish Pin Bar must close bearish
This helps filter out candles that visually resemble pin bars but close with weaker confirmation.
For visualization, the indicator supports:
- bullish markers below bullish pin bars
- bearish markers above bearish pin bars
- optional text labels
- optional candle coloring for detected pin bars
- built-in alert conditions for TradingView alerts
This indicator can be useful in many price action situations, such as:
- spotting reversal candles at support and resistance
- identifying rejection candles in trending markets
- combining with market structure, supply and demand, trendlines, or moving averages
- scanning for price action setups across multiple timeframes
Disclaimer: This indicator is for educational and research purposes only. It does not provide financial advice or guarantee trading performance.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.