OPEN-SOURCE SCRIPT

CandelaCharts - Composite Pressure Index

82
๐Ÿ“ Overview
The CandelaCharts โ€“ Composite Pressure Index (CPI) is a multi-factor oscillator that blends RSI, Money Flow Index (MFI), and Chaikin Money Flow (CMF) into a single, stretchable โ€œpressureโ€ line. Instead of looking at three separate indicators, CPI compresses price momentum and volume flow into one normalized curve around 0, then amplifies extremes using a rolling z-score.
The result is a dynamic gauge of buying vs. selling pressure that can travel beyond ยฑ1 during strong regime shifts, helping you spot exhaustion, climaxes, and trend-strength phases more intuitively.

๐Ÿ“ฆ Features
  • Composite pressure engine โ€“ Combines RSI, MFI, and CMF into a single normalized oscillator around 0, giving you a unified view of market pressure.
  • Custom weighting of components โ€“ Independently weight RSI, MFI, and CMF to prioritize pure price momentum or volume-driven signals.
  • Rolling z-score stretch โ€“ Uses a configurable z-score window to โ€œstretchโ€ the composite values, letting the line exceed ยฑ1 during extremes instead of staying capped.
  • Adaptive amplitude control โ€“ An amplitude (gain) factor lets you scale how aggressive or subtle the CPI swings appear.
  • EMA smoothing โ€“ Optional smoothing removes noise while preserving the timing of swings and reversals.
  • Visual pressure band โ€“ Zero, +1, and -1 reference lines with a shaded band make it easy to see when pressure is โ€œnormalโ€ vs. extended.
  • Dynamic color gradients โ€“ Warm/orange tones above 0 for bullish pressure and cool/blue tones below 0 for bearish pressure, with saturation increasing as pressure intensifies.
  • NA-safe statistics โ€“ Custom mean and standard deviation routines ensure stable behavior from the start of the chart and during partial history.


โš™๏ธ Settings
  • RSI Length: Lookback length for RSI. Higher values smooth the RSI component; lower values make it more reactive to short-term price momentum.
  • MFI Length: Lookback length for the manual Money Flow Index. Adjust this to control how sensitive CPI is to priceโ€“volume interaction.
  • CMF Length: Lookback length for Chaikin Money Flow. This defines the window used to assess accumulation/distribution through volume flow.
  • RSI Weight: Relative importance of RSI within the composite. Increasing this emphasizes pure price momentum in the CPI.
  • MFI Weight: Relative importance of MFI. Higher values strengthen the influence of volume-weighted price moves.
  • CMF Weight: Relative importance of CMF. Raising this highlights accumulation/distribution as a driver of the pressure index.
  • Smoothing: EMA length applied to the stretched CPI line. A value of 1 effectively disables smoothing, while higher values reduce noise at the cost of a slight lag.
  • Z-score Window: Rolling window used to compute the mean and standard deviation of the raw composite. This defines the statistical context for what counts as โ€œextremeโ€. Shorter windows adapt faster; longer windows give a more stable regime.
  • Amplitude: Gain factor applied to the z-scored composite. Values above 1.0 exaggerate swings and make extremes more visually pronounced; values below 1.0 compress them.


โšก๏ธ Showcase

Composite Pressure Index
syot kilat
Mean Line
syot kilat
Divergences
syot kilat

๐Ÿ“’ Usage
  • 1. Identify directional pressure regimes
    Use 0 as the key balance line:
    CPI > 0 โ†’ Net bullish pressure (buyers in control).
    CPI < 0 โ†’ Net bearish pressure (sellers in control).

    You can treat prolonged stays above or below 0 as confirmations of trend direction, especially when price structure agrees.

  • 2. Read statistical extremes instead of fixed levels
    Because CPI is stretched via a z-score, values beyond ยฑ1 typically represent statistically meaningful extremes within your chosen window:
    CPI > +1 โ†’ Overextended bullish pressure / potential euphoria.
    CPI < -1 โ†’ Overextended bearish pressure / potential capitulation.

    These zones are not automatic reversal signals, but they highlight areas where monitoring for exhaustion, blow-offs, or risk-reward shifts can be beneficial.

  • 3. Spot divergences with price
    Classic divergence logic applies particularly well when pressure is composite:
    Bearish divergence โ€“ Price makes higher highs, but CPI makes lower highs or fails to confirm.
    Bullish divergence โ€“ Price makes lower lows, but CPI makes higher lows or shows less downside extension.

    These patterns can be integrated with support/resistance, liquidity levels, and other CandelaCharts tools.

  • 4. Tune the weights to your strategy
    Adjust the three weights to match your focus:
    Higher RSI weight โ†’ More sensitivity to pure price momentum (good for breakout or trend-following systems).
    Higher MFI weight โ†’ Greater emphasis on priceโ€“volume interaction (ideal for spotting volume-confirmed moves).
    Higher CMF weight โ†’ Stronger focus on accumulation/distribution (helpful for swing and position traders).
  • 5. Integrate with existing setups
    The CPI is designed to sit comfortably below price:
    • Use it as a โ€œcontextโ€ oscillator underneath your main price-action and liquidity models.
    • Combine CPI extremes and divergences with key levels, range models, or order flow signals for higher-confluence entries.


๐Ÿšจ Alerts

The indicator does not provide any alerts!

โš ๏ธ Disclaimer

Trading involves significant risk, and many participants may incur losses. The content on this site is not intended as financial advice and should not be interpreted as such. Decisions to buy, sell, hold, or trade securities, commodities, or other financial instruments carry inherent risks and are best made with guidance from qualified financial professionals. Past performance is not indicative of future results.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.