PROTECTED SOURCE SCRIPT
[TehThomas] - CandleStick Patterns

Script Overview
This script is designed to identify and highlight various candlestick patterns on a trading chart. It detects bullish, bearish, indecisive, and continuation patterns and visually represents them with color-coded bars. Additionally, it displays a table summarizing the detected patterns.
Key Features
Candlestick Pattern Detection
Identifies multiple candlestick patterns, including:
Customizable Visibility & Colors
Trend Identification
Pattern Highlighting
Pattern Dashboard (Table Display)
Function Breakdown
1. Input Parameters
2. Candlestick Measurements
3. Trend Determination
4. Candlestick Pattern Identification
Engulfing Patterns
Hammer & Related Patterns
Doji Patterns
Star Patterns
Continuation Patterns
5. Candlestick Coloring
6. Pattern Dashboard
How This Script is Useful for Trading
1. Identifying Trade Opportunities
2. Confirming Trend Strength
3. Enhancing Trade Entries & Exits
4. Improving Risk Management
5. Works with Other Indicators
Limitations
Final Thoughts
This script is a powerful visual tool for traders who rely on candlestick patterns. It helps identify potential reversals, continuations, and indecision zones in the market. While it’s highly useful for discretionary trading, it’s best used alongside other technical indicators to confirm trade setups.
This script is designed to identify and highlight various candlestick patterns on a trading chart. It detects bullish, bearish, indecisive, and continuation patterns and visually represents them with color-coded bars. Additionally, it displays a table summarizing the detected patterns.
Key Features
Candlestick Pattern Detection
Identifies multiple candlestick patterns, including:
- Bullish Patterns: Bullish Engulfing, Hammer, Inverse Hammer, Morning Star, Piercing Line.
- Bearish Patterns: Bearish Engulfing, Hanging Man, Shooting Star, Evening Star, Dark Cloud Cover.
- Indecisive Patterns: Doji, Dragonfly Doji, Gravestone Doji.
- Each pattern is assigned a distinct color for easy visualization.
Customizable Visibility & Colors
- Users can enable or disable the detection of specific patterns.
- Custom colors can be assigned to each pattern for better chart clarity.
Trend Identification
- Uses the Simple Moving Average (SMA) to determine whether the market is in an uptrend or downtrend.
- Helps in filtering patterns based on the prevailing trend.
Pattern Highlighting
- Changes the color of the candlesticks whenever a pattern is detected.
- Uses barcolor() to color the candles accordingly.
Pattern Dashboard (Table Display)
- A static table in the top-right corner of the chart summarizes the detected patterns.
- Ensures the table is only created once per chart load to avoid performance issues.
Function Breakdown
1. Input Parameters
- Uses input.bool() to allow traders to toggle specific patterns on or off.
- Uses input.color() to let users customize the colors for different patterns.
2. Candlestick Measurements
- bodySize(index): Measures the absolute size of the candle body.
- upperWick(index): Measures the upper wick size.
- lowerWick(index): Measures the lower wick size.
3. Trend Determination
- isUptrend(length): Checks if the price is above its SMA (indicating an uptrend).
- isDowntrend(length): Checks if the price is below its SMA (indicating a downtrend).
4. Candlestick Pattern Identification
Engulfing Patterns
- Bullish Engulfing: A large green candle fully engulfs the previous red candle, occurring in a downtrend.
- Bearish Engulfing: A large red candle fully engulfs the previous green candle, occurring in an uptrend.
Hammer & Related Patterns
- Hammer: A candle with a small body and a long lower wick, appearing after a downtrend.
- Inverse Hammer: A candle with a small body and a long upper wick, appearing after a downtrend.
- Hanging Man: A Hammer-like pattern that appears in an uptrend.
- Shooting Star: An Inverse Hammer-like pattern that appears in an uptrend.
Doji Patterns
- Doji: A candle with a small body (open and close prices nearly equal).
- Dragonfly Doji: A Doji with a long lower wick.
- Gravestone Doji: A Doji with a long upper wick.
Star Patterns
- Morning Star: A bullish reversal pattern consisting of three candles.
- Evening Star: A bearish reversal pattern consisting of three candles.
Continuation Patterns
- Piercing Line: A two-candle bullish continuation pattern.
- Dark Cloud Cover: A two-candle bearish continuation pattern.
5. Candlestick Coloring
- Uses barcolor() to color the candles based on the detected pattern.
- The color is determined using a conditional statement, ensuring only one pattern applies per candle.
6. Pattern Dashboard
- Uses tables (table.new()) to display a static dashboard with all enabled patterns.
- Calls updateTableCell() to add rows for each active pattern.
How This Script is Useful for Trading
1. Identifying Trade Opportunities
- Helps traders spot potential reversal points (e.g., Bullish Engulfing, Hammer, Morning Star).
- Highlights trend continuation signals (e.g., Piercing Line, Dark Cloud Cover).
2. Confirming Trend Strength
- Engulfing patterns in the direction of the trend confirm trend strength.
- Doji and indecisive patterns warn traders of potential reversals or trend slowdowns.
3. Enhancing Trade Entries & Exits
- Enter long positions after spotting bullish patterns like Morning Star, Hammer.
- Exit long positions when bearish patterns like Evening Star, Shooting Star appear.
- Enter short positions upon seeing bearish engulfing, Hanging Man, or Dark Cloud Cover.
4. Improving Risk Management
- Traders can set stop-loss orders based on the pattern structure.
- Example: Placing stop-loss below the low of a Hammer confirms bullish strength.
5. Works with Other Indicators
- Can be combined with RSI, MACD, Bollinger Bands for more reliable signals.
Limitations
- False Signals: Candlestick patterns alone are not 100% reliable; traders should confirm signals with volume and trend analysis.
- No Automatic Alerts: This script does not send trading alerts; manual observation is required.
- No Multi-Timeframe Analysis: It only considers the timeframe it is applied to.
Final Thoughts
This script is a powerful visual tool for traders who rely on candlestick patterns. It helps identify potential reversals, continuations, and indecision zones in the market. While it’s highly useful for discretionary trading, it’s best used alongside other technical indicators to confirm trade setups.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
𝟔 𝐘𝐄𝐀𝐑𝐒 𝐄𝐗𝐏𝐄𝐑𝐈𝐄𝐍𝐂𝐄𝐃 𝐓𝐑𝐀𝐃𝐄𝐑
💎 Free Signals
t.me/codeandcandle
🎁 Free trading Discord community
bit.ly/TehThomas
✅ Best exchange - 20% cashback
bit.ly/BloFin20
💎 Free Signals
t.me/codeandcandle
🎁 Free trading Discord community
bit.ly/TehThomas
✅ Best exchange - 20% cashback
bit.ly/BloFin20
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
𝟔 𝐘𝐄𝐀𝐑𝐒 𝐄𝐗𝐏𝐄𝐑𝐈𝐄𝐍𝐂𝐄𝐃 𝐓𝐑𝐀𝐃𝐄𝐑
💎 Free Signals
t.me/codeandcandle
🎁 Free trading Discord community
bit.ly/TehThomas
✅ Best exchange - 20% cashback
bit.ly/BloFin20
💎 Free Signals
t.me/codeandcandle
🎁 Free trading Discord community
bit.ly/TehThomas
✅ Best exchange - 20% cashback
bit.ly/BloFin20
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.