Commodity Channel Index Pullback (CCI/P) v1Commodity Channel Index Pullback (CCI/P) v1
CCI/P v1 is a pullback-style oscillator built around two Commodity Channel Index calculations:
CCI #1 (Primary): identifies momentum extremes using an adjustable Absolute Level (± level).
CCI #2 (Secondary) or MA of CCI #2: acts as a simple regime filter based on whether it’s above or below 0.
What you’ll see
CCI #1 plotted as the primary line.
Fixed reference levels at ±100 and ±200, with subtle gray background zones.
Dynamic “plot zones” when CCI #1 exceeds ±Absolute Level:
Overbought plot (red)
Oversold plot (green)
Optional CCI #2 / MA2 area (plotted behind everything), colored:
Above 0: #089981
Below 0: #b2b5be
Optional candle coloring based on CCI #2 / MA2 regime (toggle in settings).
Triangle logic
Triangles flag “pullback + regime alignment” conditions:
Green triangle: CCI #1 < -Absolute Level AND CCI #2/MA2 > 0
Red triangle: CCI #1 > +Absolute Level AND CCI #2/MA2 < 0
Alerts
Alert conditions are included for:
Green / Red triangle setups (fires on the first bar the condition becomes true)
CCI #1 crossing above/below ±Absolute Level (and returning inside)
CCI #2/MA2 crossing above/below 0 (based on Plot Mode)
How I use it
This is a pullback framework, so I treat CCI #2/MA2 as the “environment” and CCI #1 as the “stretch”:
Pick your regime filter
Use MA of CCI #2 if you want a steadier filter (fewer flips).
Use CCI #2 if you want it more responsive.
Let CCI #1 reach an extreme
I’m generally looking for CCI #1 to push beyond the Absolute Level threshold, then watch for the pullback condition to align with the regime.
Use the triangle as a “checklist complete” marker
The triangle is not a guarantee—just a structured moment where stretch + regime align.
I still validate with structure/levels/volatility context (e.g., key highs/lows, prior range boundaries, session context).
Risk is external
Stops/targets aren’t built in—position sizing and exits depend on your instrument and volatility.
If you automate alerts, consider triggering alerts on bar close for more stable signals.
Notes
This script does not use higher-timeframe security() calls. Values may update during the currently-forming bar until it closes (standard TradingView behavior).
Disclaimer
This indicator is for educational/informational purposes only and is not financial advice. Always test on your market and timeframe and manage risk appropriately.
Changelog / v1 Notes
v1 (initial public release): Dual-CCI pullback framework with optional CCI #2 or MA(CCI #2) regime area, dynamic OB/OS plot zones, triangle conditions, candle-color toggle, and a full alert set (triangles + CCI #1 threshold crosses + CCI #2/MA2 zero crosses).
مؤشر Pine Script®






















