Candle Type (The Strat) + F2U/F2D (Prev Close Rule) [v6]📌 Candle Type (STRAT) + Failed 2 Detection (Pine Script v6)
This indicator is an updated version of the commonly used Candle Type (STRAT) script, rewritten in Pine Script v6 and enhanced with strict Failed 2 (F2U / F2D) detection and expanded visual customization options.
The goal of this update is to remove ambiguity and reduce human error when identifying Failed 2 candles, especially in fast-moving markets.
🔍 Candle Type Logic
The script identifies standard STRAT candle types:
Type 1 – Inside bar
Type 2 Up (2U) – Breaks the previous candle’s high
Type 2 Down (2D) – Breaks the previous candle’s low
Type 3 – Outside bar (breaks both high and low)
Each candle is optionally labeled with 1 / 2 / 3 beneath the bar.
⚠️ Failed 2 Definition (Strict Rule)
This script uses a strict, objective definition of Failed 2 candles:
Failed 2 Up (F2U)
→ A 2U candle that closes below the previous candle’s close
Failed 2 Down (F2D)
→ A 2D candle that closes above the previous candle’s close
This approach avoids subjective interpretation (such as “looks weak” or “inside the body”) and ensures Failed 2s are identified consistently and in real time.
Failed 2 candles are clearly marked above the bar with labeled F2U / F2D markers.
🎨 Customization Options (Settings Panel)
Candle Coloring
Turn candle coloring off
Color only Failed 2 candles
Color all STRAT candle types (1 / 2U / 2D / 3)
Number Labels (1 / 2 / 3)
Adjustable font size
Adjustable color
Failed 2 Markers
Adjustable marker size
Adjustable marker colors
Adjustable text colors
These options allow the indicator to scale cleanly across different timeframes and chart styles.
🎯 Why Failed 2 Detection Matters
Failed 2 candles often act as entry traps.
Misidentifying them can lead to early entries, poor risk placement, and unnecessary drawdown.
This script does not change the STRAT methodology — it simply helps remove human error from identifying a very specific and important candle condition.
⚠️ Disclaimer
This indicator is for educational and analytical purposes only.
It does not provide trade signals or financial advice. Always apply proper risk management and confirm with your broader trading plan.
Chỉ báo Pine Script®






















