OPEN-SOURCE SCRIPT
LETHINH Pinbar

📌 PinBar Minimal Detector — Description (English)
PinBar Minimal Detector is a clean and efficient tool designed to detect high-quality pin bars based purely on candle geometry.
This script focuses on the core characteristics of a true pin bar: a long rejection wick and a small candle body, without adding unnecessary complexity. It is ideal for traders who want fast, reliable signal detection without noise.
⸻
✨ Key Features
• Detects both bullish and bearish pin bars.
• Fully configurable wick/body ratio.
• Optional filter for maximum opposite wick size.
• Option to ignore candles with extremely small bodies.
• Clean chart display with simple labels (“PIN”).
• Includes alert conditions for automated notifications (webhook, popup, email, etc.).
• Lightweight and optimized for fast execution on any timeframe.
⸻
🔍 Detection Logic
A candle qualifies as a bullish pin bar when:
• The lower wick is at least X times larger than the body.
• The upper wick is relatively small (optional filter).
• The body is above the minimum body threshold.
A candle qualifies as a bearish pin bar when:
• The upper wick is at least X times larger than the body.
• The lower wick is relatively small.
• The body meets the minimum size requirement.
This ensures that only candles showing strong rejection are highlighted.
⸻
⚙️ Input Parameters
1. wick/body ratio
Defines how many times longer the main wick must be compared to the candle body.
For example:
• 3.0 → wick must be at least 3× the body
• 4.0–5.0 → only very strong pin bars
2. opposite wick max (factor)
The maximum allowed size of the wick on the opposite side, relative to the body.
Example:
• 0.5 → opposite wick ≤ 50% of body
• Lower values = stricter filtering
3. min body px
Filters out candles with bodies that are too small (low volatility candles).
4. show labels
Enable or disable the “PIN” labels on the chart.
⸻
🚨 Alerts
The script includes two built-in alert conditions:
• Bullish PinBar Detected
• Bearish PinBar Detected
These alerts can be paired with:
• TradingView notifications
• Webhooks (for bots / automation)
• Email or SMS alerts
⸻
🎯 Use Cases
• Identify high-probability reversal points
• Enhance price action strategies
• Combine with S/R zones, supply & demand, trendlines, or order blocks
• Filter entries on lower timeframes while following higher-timeframe trend bias
⸻
📘 Notes
This is a minimalistic version by design.
If you want a more advanced version (confirmation candle, volume filter, multi-timeframe filtering, trend direction filtering, etc.), this script can be expanded easily
PinBar Minimal Detector is a clean and efficient tool designed to detect high-quality pin bars based purely on candle geometry.
This script focuses on the core characteristics of a true pin bar: a long rejection wick and a small candle body, without adding unnecessary complexity. It is ideal for traders who want fast, reliable signal detection without noise.
⸻
✨ Key Features
• Detects both bullish and bearish pin bars.
• Fully configurable wick/body ratio.
• Optional filter for maximum opposite wick size.
• Option to ignore candles with extremely small bodies.
• Clean chart display with simple labels (“PIN”).
• Includes alert conditions for automated notifications (webhook, popup, email, etc.).
• Lightweight and optimized for fast execution on any timeframe.
⸻
🔍 Detection Logic
A candle qualifies as a bullish pin bar when:
• The lower wick is at least X times larger than the body.
• The upper wick is relatively small (optional filter).
• The body is above the minimum body threshold.
A candle qualifies as a bearish pin bar when:
• The upper wick is at least X times larger than the body.
• The lower wick is relatively small.
• The body meets the minimum size requirement.
This ensures that only candles showing strong rejection are highlighted.
⸻
⚙️ Input Parameters
1. wick/body ratio
Defines how many times longer the main wick must be compared to the candle body.
For example:
• 3.0 → wick must be at least 3× the body
• 4.0–5.0 → only very strong pin bars
2. opposite wick max (factor)
The maximum allowed size of the wick on the opposite side, relative to the body.
Example:
• 0.5 → opposite wick ≤ 50% of body
• Lower values = stricter filtering
3. min body px
Filters out candles with bodies that are too small (low volatility candles).
4. show labels
Enable or disable the “PIN” labels on the chart.
⸻
🚨 Alerts
The script includes two built-in alert conditions:
• Bullish PinBar Detected
• Bearish PinBar Detected
These alerts can be paired with:
• TradingView notifications
• Webhooks (for bots / automation)
• Email or SMS alerts
⸻
🎯 Use Cases
• Identify high-probability reversal points
• Enhance price action strategies
• Combine with S/R zones, supply & demand, trendlines, or order blocks
• Filter entries on lower timeframes while following higher-timeframe trend bias
⸻
📘 Notes
This is a minimalistic version by design.
If you want a more advanced version (confirmation candle, volume filter, multi-timeframe filtering, trend direction filtering, etc.), this script can be expanded easily
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.