OPEN-SOURCE SCRIPT
CandelaCharts - Composite Pressure Index

📝 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
⚙️ Settings
⚡️ Showcase
Composite Pressure Index

Mean Line

Divergences

📒 Usage
🚨 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.
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
Mean Line
Divergences
📒 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.
- Use it as a “context” oscillator underneath your main price-action and liquidity models.
🚨 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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Get access to our exclusive tools: candelacharts.com
Join our community: discord.gg/etGSTepqbu
All content provided by CandelaCharts is for informational & educational purposes only.
Join our community: discord.gg/etGSTepqbu
All content provided by CandelaCharts is for informational & educational purposes only.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Get access to our exclusive tools: candelacharts.com
Join our community: discord.gg/etGSTepqbu
All content provided by CandelaCharts is for informational & educational purposes only.
Join our community: discord.gg/etGSTepqbu
All content provided by CandelaCharts is for informational & educational purposes only.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.