PROTECTED SOURCE SCRIPT
Multi-Timeframe C2/C3 Suite

█ OVERVIEW
The Multi-Timeframe C2/C3 Suite is a closure-based pattern detection system that identifies potential reversal formations on 4H and 1H timeframes. This indicator exclusively uses candle closures to detect pattern formations.
The system detects 14 distinct pattern types organized into two families:
• C2 Patterns (8 types): Detected when a candle tests a previous candle's extreme and closes back inside its range
• C3 Patterns (6 types): Detected when price recovers after breaking a previous candle's range
Each pattern type is classified by signal strength (Ideal → Type 1 → Type 2 → Indecision), giving traders granular control over which signals to monitor.
█ PATTERN METHODOLOGY
The indicator uses a consistent 3-candle naming convention:
• C1: Reference candle establishing the range to be tested
• C2: Test candle that probes C1's extreme and closes back inside
• C3: Confirmation candle that recovers after C2 breaks C1's range
▌C2 PATTERNS
C2 patterns form when:
1. C2 trades to (or through) C1's high or low
2. C2 closes back INSIDE C1's range
The pattern type depends on HOW C2 closes:
• C2 Ideal Bullish: Tests C1's low, closes inside, AND closes above C1's open.
• C2 Ideal Bearish: Tests C1's high, closes inside, AND closes below C1's open.
• C2 Type 1 Bullish: Tests C1's low, closes inside, closes bullish (close > open).
• C2 Type 1 Bearish: Tests C1's high, closes inside, closes bearish (close < open).
• C2 Type 2 Bullish: Tests C1's low, closes inside, but closes bearish.
• C2 Type 2 Bearish: Tests C1's high, closes inside, but closes bullish.
• Indecision Bullish: Tests C1's low, closes inside, open ≈ close (doji-like).
• Indecision Bearish: Tests C1's high, closes inside, open ≈ close (doji-like).
▌C3 PATTERNS
C3 patterns form when:
1. C2 closes OUTSIDE C1's range
2. C3 closes back past C2's open AND closes in the confirming direction
The pattern type depends on C3's relationship to C2's range:
• C3 Ideal Bullish: C3 tests C2's low AND closes back past C2's open.
• C3 Ideal Bearish: C3 tests C2's high AND closes back past C2's open.
• C3 Type 1 Bullish: Pure C3 close with no C2 component on C3 candle. C3 doesn't test
C2's extremes.
• C3 Type 1 Bearish: Pure C3 close with no C2 component on C3 candle. C3 doesn't test
C2's extremes.
• C3 Type 2 Bullish: C3 closes back but tests C2's HIGH. C3 has conflicting C2 pattern
(opposite direction tested).
• C3 Type 2 Bearish: C3 closes back but tests C2's LOW (opposite direction). C3 has
conflicting C2 pattern (opposite direction tested)
▌EDGE CASE HANDLING
The indicator handles ambiguous scenarios systematically:
• Dual-Side Test: When C2 tests BOTH C1's high AND low, the pattern direction is determined by C2's closing direction (bullish close = bullish pattern). If C2 closes as indecision (open ≈ close), no pattern is generated.
• C3 Validation: C3 must close in the pattern's direction to be valid. A bullish C3 must close bullish (close > open), and vice versa.
• Boundary Conditions: Range tests use inclusive comparisons (>= and <=), so exact touches of C1's high/low count as tests.
█ MULTI-TIMEFRAME ARCHITECTURE
The indicator independently tracks patterns on two timeframes:
• 4H Patterns: Detected on the 4-hour timeframe, visible on 4H charts and all lower timeframes
• 1H Patterns: Detected on the 1-hour timeframe, visible on 1H charts and all lower timeframes
When viewing on lower timeframes (e.g., 15m or 5m), the indicator fetches higher-timeframe data and places labels at the middle of the HTF candle's bar range, with the Y coordinate set to the pattern's extreme price (lowest low for bullish, highest high for bearish).
▌LABEL OVERLAP PREVENTION & COLLISION HANDLING
The indicator manages label overlaps through two mechanisms:
• Smart Merging: When 4H and 1H patterns occur at the same bar with the same direction, labels are merged into a single combined label displaying both pattern codes.
• Collision Management: When 4H and 1H labels would visually overlap but are on different bars, the 1H label is offset vertically to prevent occlusion. The 4H label maintains its position (higher timeframe priority).
█ FEATURES
▌PATTERN LABELS
• Color-coded labels: Green (bullish), Red (bearish), Gray (indecision)
• Configurable transparency and offset from price
• Individual enable/disable toggles for all 14 pattern types
• Separate visibility controls for 4H and 1H patterns
▌FORMATION SEPARATORS
• Vertical separator lines mark the candle boundaries of detected formations
• C2 patterns show: C1 start → C2 start → C3 start (next candle)
• C3 patterns show: C1 start → C2 start → C3 start → C4 start
• Optional range labels ("C1", "C2") at candle extremes
• Auto-delete after configurable number of candles
• Customizable line style, color, and width
▌STATISTICS ENGINE
• Time-slot analytics: Patterns indexed by hour:minute in your selected timezone
• Tracks historical performance for each pattern type at each time slot
• Displays when the active pattern is pending confirmation
Tracked metrics include:
─ Base count: Total occurrences of the pattern at this time slot
─ Traded: How often the next candle traded to the signal candle's extreme
─ Closed: How often the next candle closed past the signal candle's extreme
─ C1 Scenarios: Breakdown by whether the signal candle tested C1's opposite extreme
─ C2 Scenarios (C3 patterns only): Breakdown by C3's relationship to C2's opposite extreme
IMPORTANT: The historical depth of statistics depends on your chart's current timeframe and your TradingView data plan. Lower timeframes provide less historical data. For maximum statistical depth, view the indicator on 4H or 1H charts.
▌ALERTS
• Fires alerts on new pattern detection
• Alert message includes: pattern name, timeframe, and formatted time
• Respects your individual pattern enable/disable settings
• Single alert condition covers all enabled patterns
█ HOW TO USE
1. Add the indicator to any chart at 4H timeframe or lower
2. Configure which patterns to display:
• In Settings → "C2 Pattern Labels" and "C3 Pattern Labels" groups
• Enable patterns you want to track, disable others
• Use "Label Visibility" to toggle entire timeframes on/off
3. Interpret the signals:
• Labels appear at the signal candle's extreme (low for bullish, high for bearish)
4. Use the formation separators:
• Enable "Show Formation Separators" in Settings
• Vertical lines help visualize the C1-C2-C3 structure
• Useful for understanding pattern context
5. Review statistics:
• Enable "Show Statistics Table" in Settings
• View historical performance for the current pending pattern
• Use "Display Timezone" to match your trading hours
• Navigate to higher timeframes for deeper historical data
6. Set up alerts:
• Enable "Enable Alerts" in Settings
• Create an alert on this indicator with "Any alert() function call"
• Receive notifications when new patterns form
█ CONFIGURATION OPTIONS
▌LABEL SETTINGS
• Show 4H Labels / Show 1H Labels: Master toggles for each timeframe
• Individual pattern toggles: 14 separate enable/disable options
• Label Colors: Bullish, Bearish, Indecision colors with transparency
• Label Offset: Distance from price
▌SEPARATOR SETTINGS
• Show Formation Separators: Master toggle for separator lines
• Show Range Labels: Display "C1", "C2" text at candle extremes
• Auto-Delete After: Number of candles before separators disappear
• Line Style: Solid, Dashed, or Dotted
• Line Color and Width: Visual customization
▌STATISTICS SETTINGS
• Show Statistics Table: Enable/disable the statistics display
• Display Timezone: 13 timezone options for time-slot indexing
• Text Color, Size, Background: Visual customization
▌PATTERN DETECTION
• Indecision Tolerance: Threshold for open ≈ close detection (in ticks)
█ NOTES
• Non-Repainting: All pattern detection occurs on confirmed candle closes only. Labels may update position intra-bar on lower timeframes (tracking the extreme), but pattern detection itself does not repaint.
• Resource Efficient: The indicator fetches HTF data in optimized batches and manages line/label objects within TradingView's limits.
• This indicator is for educational puproses only and is not intended to constitute financial advice to any person.
The Multi-Timeframe C2/C3 Suite is a closure-based pattern detection system that identifies potential reversal formations on 4H and 1H timeframes. This indicator exclusively uses candle closures to detect pattern formations.
The system detects 14 distinct pattern types organized into two families:
• C2 Patterns (8 types): Detected when a candle tests a previous candle's extreme and closes back inside its range
• C3 Patterns (6 types): Detected when price recovers after breaking a previous candle's range
Each pattern type is classified by signal strength (Ideal → Type 1 → Type 2 → Indecision), giving traders granular control over which signals to monitor.
█ PATTERN METHODOLOGY
The indicator uses a consistent 3-candle naming convention:
• C1: Reference candle establishing the range to be tested
• C2: Test candle that probes C1's extreme and closes back inside
• C3: Confirmation candle that recovers after C2 breaks C1's range
▌C2 PATTERNS
C2 patterns form when:
1. C2 trades to (or through) C1's high or low
2. C2 closes back INSIDE C1's range
The pattern type depends on HOW C2 closes:
• C2 Ideal Bullish: Tests C1's low, closes inside, AND closes above C1's open.
• C2 Ideal Bearish: Tests C1's high, closes inside, AND closes below C1's open.
• C2 Type 1 Bullish: Tests C1's low, closes inside, closes bullish (close > open).
• C2 Type 1 Bearish: Tests C1's high, closes inside, closes bearish (close < open).
• C2 Type 2 Bullish: Tests C1's low, closes inside, but closes bearish.
• C2 Type 2 Bearish: Tests C1's high, closes inside, but closes bullish.
• Indecision Bullish: Tests C1's low, closes inside, open ≈ close (doji-like).
• Indecision Bearish: Tests C1's high, closes inside, open ≈ close (doji-like).
▌C3 PATTERNS
C3 patterns form when:
1. C2 closes OUTSIDE C1's range
2. C3 closes back past C2's open AND closes in the confirming direction
The pattern type depends on C3's relationship to C2's range:
• C3 Ideal Bullish: C3 tests C2's low AND closes back past C2's open.
• C3 Ideal Bearish: C3 tests C2's high AND closes back past C2's open.
• C3 Type 1 Bullish: Pure C3 close with no C2 component on C3 candle. C3 doesn't test
C2's extremes.
• C3 Type 1 Bearish: Pure C3 close with no C2 component on C3 candle. C3 doesn't test
C2's extremes.
• C3 Type 2 Bullish: C3 closes back but tests C2's HIGH. C3 has conflicting C2 pattern
(opposite direction tested).
• C3 Type 2 Bearish: C3 closes back but tests C2's LOW (opposite direction). C3 has
conflicting C2 pattern (opposite direction tested)
▌EDGE CASE HANDLING
The indicator handles ambiguous scenarios systematically:
• Dual-Side Test: When C2 tests BOTH C1's high AND low, the pattern direction is determined by C2's closing direction (bullish close = bullish pattern). If C2 closes as indecision (open ≈ close), no pattern is generated.
• C3 Validation: C3 must close in the pattern's direction to be valid. A bullish C3 must close bullish (close > open), and vice versa.
• Boundary Conditions: Range tests use inclusive comparisons (>= and <=), so exact touches of C1's high/low count as tests.
█ MULTI-TIMEFRAME ARCHITECTURE
The indicator independently tracks patterns on two timeframes:
• 4H Patterns: Detected on the 4-hour timeframe, visible on 4H charts and all lower timeframes
• 1H Patterns: Detected on the 1-hour timeframe, visible on 1H charts and all lower timeframes
When viewing on lower timeframes (e.g., 15m or 5m), the indicator fetches higher-timeframe data and places labels at the middle of the HTF candle's bar range, with the Y coordinate set to the pattern's extreme price (lowest low for bullish, highest high for bearish).
▌LABEL OVERLAP PREVENTION & COLLISION HANDLING
The indicator manages label overlaps through two mechanisms:
• Smart Merging: When 4H and 1H patterns occur at the same bar with the same direction, labels are merged into a single combined label displaying both pattern codes.
• Collision Management: When 4H and 1H labels would visually overlap but are on different bars, the 1H label is offset vertically to prevent occlusion. The 4H label maintains its position (higher timeframe priority).
█ FEATURES
▌PATTERN LABELS
• Color-coded labels: Green (bullish), Red (bearish), Gray (indecision)
• Configurable transparency and offset from price
• Individual enable/disable toggles for all 14 pattern types
• Separate visibility controls for 4H and 1H patterns
▌FORMATION SEPARATORS
• Vertical separator lines mark the candle boundaries of detected formations
• C2 patterns show: C1 start → C2 start → C3 start (next candle)
• C3 patterns show: C1 start → C2 start → C3 start → C4 start
• Optional range labels ("C1", "C2") at candle extremes
• Auto-delete after configurable number of candles
• Customizable line style, color, and width
▌STATISTICS ENGINE
• Time-slot analytics: Patterns indexed by hour:minute in your selected timezone
• Tracks historical performance for each pattern type at each time slot
• Displays when the active pattern is pending confirmation
Tracked metrics include:
─ Base count: Total occurrences of the pattern at this time slot
─ Traded: How often the next candle traded to the signal candle's extreme
─ Closed: How often the next candle closed past the signal candle's extreme
─ C1 Scenarios: Breakdown by whether the signal candle tested C1's opposite extreme
─ C2 Scenarios (C3 patterns only): Breakdown by C3's relationship to C2's opposite extreme
IMPORTANT: The historical depth of statistics depends on your chart's current timeframe and your TradingView data plan. Lower timeframes provide less historical data. For maximum statistical depth, view the indicator on 4H or 1H charts.
▌ALERTS
• Fires alerts on new pattern detection
• Alert message includes: pattern name, timeframe, and formatted time
• Respects your individual pattern enable/disable settings
• Single alert condition covers all enabled patterns
█ HOW TO USE
1. Add the indicator to any chart at 4H timeframe or lower
2. Configure which patterns to display:
• In Settings → "C2 Pattern Labels" and "C3 Pattern Labels" groups
• Enable patterns you want to track, disable others
• Use "Label Visibility" to toggle entire timeframes on/off
3. Interpret the signals:
• Labels appear at the signal candle's extreme (low for bullish, high for bearish)
4. Use the formation separators:
• Enable "Show Formation Separators" in Settings
• Vertical lines help visualize the C1-C2-C3 structure
• Useful for understanding pattern context
5. Review statistics:
• Enable "Show Statistics Table" in Settings
• View historical performance for the current pending pattern
• Use "Display Timezone" to match your trading hours
• Navigate to higher timeframes for deeper historical data
6. Set up alerts:
• Enable "Enable Alerts" in Settings
• Create an alert on this indicator with "Any alert() function call"
• Receive notifications when new patterns form
█ CONFIGURATION OPTIONS
▌LABEL SETTINGS
• Show 4H Labels / Show 1H Labels: Master toggles for each timeframe
• Individual pattern toggles: 14 separate enable/disable options
• Label Colors: Bullish, Bearish, Indecision colors with transparency
• Label Offset: Distance from price
▌SEPARATOR SETTINGS
• Show Formation Separators: Master toggle for separator lines
• Show Range Labels: Display "C1", "C2" text at candle extremes
• Auto-Delete After: Number of candles before separators disappear
• Line Style: Solid, Dashed, or Dotted
• Line Color and Width: Visual customization
▌STATISTICS SETTINGS
• Show Statistics Table: Enable/disable the statistics display
• Display Timezone: 13 timezone options for time-slot indexing
• Text Color, Size, Background: Visual customization
▌PATTERN DETECTION
• Indecision Tolerance: Threshold for open ≈ close detection (in ticks)
█ NOTES
• Non-Repainting: All pattern detection occurs on confirmed candle closes only. Labels may update position intra-bar on lower timeframes (tracking the extreme), but pattern detection itself does not repaint.
• Resource Efficient: The indicator fetches HTF data in optimized batches and manages line/label objects within TradingView's limits.
• This indicator is for educational puproses only and is not intended to constitute financial advice to any person.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.