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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。