KS Candle Patterns Detector
- Indicadores
- Kulvinder Singh
- Versão: 1.30
What this indicator detects
It recognizes two main groups of classical technical analysis patterns:
A. Candlestick patterns (controlled by input ShowCandlestick = true)
| Pattern | Direction | Typical meaning | Alert text |
|---|---|---|---|
| Doji | Neutral | Indecision | "Doji" |
| Bullish Engulfing | Bullish | Potential reversal up | "Bullish Engulfing" |
| Bearish Engulfing | Bearish | Potential reversal down | "Bearish Engulfing" |
| Hammer | Bullish | Potential bottom reversal | "Hammer" |
| Shooting Star | Bearish | Potential top reversal | "Shooting Star" |
| Morning Star | Bullish | Strong bullish reversal | "Morning Star" |
| Evening Star | Bearish | Strong bearish reversal | "Evening Star" |
B. Chart (price action) patterns (controlled by input ShowChartPat = true)
| Pattern | Direction | Typical meaning | Alert text |
|---|---|---|---|
| Head & Shoulders | Bearish | Reversal top | "Head & Shoulders" |
| Inverse Head & Shoulders | Bullish | Reversal bottom | "Inv. Head & Shoulders" |
| Double Top | Bearish | Reversal top | "Double Top" |
| Double Bottom | Bullish | Reversal bottom | "Double Bottom" |
| Bull Flag | Bullish | Continuation (up) | "Bull Flag" |
| Symmetrical Triangle | Neutral | Continuation or breakout either way | "Symmetrical Triangle" |
Key Features & Behavior
- LookbackBars = 100 (default) → only scans recent ~100 bars
- SwingStrength = 5 (default) → pivot detection looks 5 bars left + 5 bars right
- Draws text labels directly on chart (▼ pattern name above candle / ▲ below candle)
- Uses color coding:
- Bullish patterns → DodgerBlue
- Bearish patterns → OrangeRed
- Neutral → Gold
- Prevents label overlap with automatic vertical staggering
Alert system (the main addition in v1.3)
Can send alerts through four channels (all configurable):
- Push notifications (to MT5 mobile app)
- On-screen popup (Alert() function)
- Sound file playback
- Email (requires MT5 email settings configured)
Important alert logic:
- By default (AlertOnlyNew = true) alerts only fire once — when the pattern completes on the most recently closed bar
- Deduplication prevents repeated alerts during chart refresh / timeframe change
Most common use-cases
- Reversal hunting on higher timeframes (H4, D1) → Head & Shoulders, Double Top/Bottom, Morning/Evening Star, Hammer/Shooting Star
- Continuation trading → Bull Flags, Symmetrical Triangles
- Quick candlestick confirmation on lower timeframes (M15–H1) → Engulfing, Doji, Stars
- Semi-automated monitoring via push/email alerts when away from screen
Typical weaknesses / things to keep in mind
- No volume confirmation
- No neckline / breakout confirmation for chart patterns (only pivot structure)
- Flag detection is quite basic (only bullish version implemented)
- Symmetrical triangle logic is very simple (just decreasing highs + increasing lows)
- Many false signals in ranging / choppy markets
- Pivot-based patterns (H&S, Double Top/Bottom) are sensitive to SwingStrength setting
