OPEN-SOURCE SCRIPT

[blackcat] L1 Divergence of CCI for BS Signal

1 187
OVERVIEW

This indicator identifies potential market reversal points by detecting CCI (Commodity Channel Index) divergence patterns combined with extreme oversold/overbought conditions. It generates clear Buy and Sell signals with visual labels, helping traders spot high-probability entry and exit opportunities.

CONCEPTS

This indicator utilizes CCI divergence analysis to identify potential trend reversals.

Key principles:
Bullish Divergence: Price makes a new low while CCI fails to make a corresponding new low, suggesting weakening downward momentum and potential reversal upward
Bearish Divergence: Price makes a new high while CCI fails to make a corresponding new high, indicating weakening upward momentum and potential reversal downward
Extreme Level Confirmation: Signals are filtered by requiring CCI to reach extreme levels (-150/-200 for buys, +150/+200 for sells) to ensure high-quality setups

HOW TO USE

1 — Add the indicator to your chart from the indicators menu
2 — Configure the CCI period and divergence detection parameters based on your trading style
3 — Wait for "B" (Buy) or "S" (Sell) labels to appear on the indicator panel
4 — Use divergence lines and auxiliary signals for additional confirmation

Input Parameters
CCI Period: The lookback period for CCI calculation (default: 14)
Oversold Level: The threshold below which indicates oversold conditions (default: -100)
Overbought Level: The threshold above which indicates overbought conditions (default: +100)
Extreme Oversold: The extreme oversold threshold for signal confirmation (default: -200)
Extreme Overbought: The extreme overbought threshold for signal confirmation (default: +200)
Divergence Detection Period: Lookback period for identifying CCI highs/lows (default: 20)
Price New Low Detection Period: Lookback period for identifying price extremes (default: 50)

SIGNALS

Visual Elements
"B" Label (Blue): Buy signal - Bullish divergence detected with CCI in oversold territory and prior extreme oversold confirmation
"S" Label (Orange): Sell signal - Bearish divergence detected with CCI in overbought territory and prior extreme overbought confirmation
↑ Arrow (Green): Bullish divergence marker appearing in oversold zone
↓ Arrow (Red): Bearish divergence marker appearing in overbought zone
★ Star (Aqua/Orange): CCI crossing above oversold line or below overbought line
● Dot (Lime/Red): CCI crossing above or below zero axis
Divergence Lines: Green lines connect bullish divergence points; Red lines connect bearish divergence points

CCI Visualization
Red Line: CCI value when rising
Green Line: CCI value when falling
Green Histogram: CCI above +100 (overbought zone)
Red Histogram: CCI below -100 (oversold zone)
Blue Histogram at +220: Buy signal strength indicator
Orange Histogram at -220: Sell signal strength indicator

Zone Fills
Blue Fill: Overbought zone (CCI > +100)
Red Fill: Oversold zone (CCI < -100)
Dark Red Fill: Extreme overbought danger zone (CCI > +200)
Dark Green Fill: Extreme oversold opportunity zone (CCI < -200)

ALERT CONDITIONS

The indicator includes built-in alert conditions for:
Buy Signal: Triggered when bullish divergence buy signal appears
Sell Signal: Triggered when bearish divergence sell signal appears
Cross Above Oversold: CCI crosses above the oversold level
Cross Below Overbought: CCI crosses below the overbought level
Bullish Divergence: Any bullish divergence pattern detected
Bearish Divergence: Any bearish divergence pattern detected

LIMITATIONS

• Divergence signals may produce false positives during strong trending markets
• Signals should be used in conjunction with other technical analysis tools
• Past performance does not guarantee future results
• Best suited for ranging or reversing markets rather than strong trends
• The profit percentage display is for reference only and tracks from the most recent buy signal

NOTES

• This indicator works best on timeframes from 15 minutes to daily charts
• Consider using support/resistance levels for additional confirmation
• The "B" and "S" signals represent the highest probability setups with multiple confirmations
• Auxiliary signals (stars and dots) provide earlier warnings but may be less reliable

═════════════════════════════════════════════════════════════════════════
For questions or feedback, use comments section below.

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。