OPEN-SOURCE SCRIPT
Commodity Pulse Matrix (CPM) [WavesUnchained]

Commodity Pulse Matrix (CPM) is a professional multi-timeframe analysis suite built for commodity trading. It compresses dozens of signals into one color-coded matrix to show directional bias and quality across three user-set timeframes, plus optional chart TF. Non-repainting design: HTF values use confirmed bars; rendering is optimized.
Categories:
Flow = MFI, OBV, volume trend, smart-money bias. Momentum = RSI (dynamic zones), MACD histo, CCI, WaveCycle Momentum (adaptive, ATR-normalized). Trend = EMA stack (20/50/100/200), ADX+DI, VWAP positioning. Volatility = ATR%, Williams Vix Fix spikes, squeeze (Bollinger inside Keltner). Structure = price vs key EMAs, pivot S/R alignment. Divergence = regular/hidden on RSI via RDZ, optional MACD, cluster strength; zone-gated and bar-confirmed.
Oscillators:
WCM detects momentum swings with dead-zone filtering and dynamic OB/OS. RDZ finds divergences only in RSI 70/30 zones with optional volume/MFI gate. WVF highlights volatility-shock exhaustion (bottom/top mode) and can feed the exhaustion filter.
Exhaustion module:
Strict 5-point check (RSI extreme, ATR range expansion, volume spike, wick ratio, compressed body) with Watch → Confirmed logic and optional reversal-zone boxes from pivots. Squeeze detector flags contraction and first expansion.
Matrix and visuals:
Compact or detailed grid; 4-layer heat gradient; ▲/▼/• symbols; action badges (Setup/Neutral); optional VWAP cross markers (session, anchored high/low, clusters). Overlay options: EMA gradient fill, AVWAP (session/week/month), S/R lines, divergence diamonds (teal/amber), exhaustion triangles, squeeze dots. Performance friendly (updates on last bar).
Scoring:
Each category scores −3…+3, weighted by importance (default: Flow 1.2, Momentum 1.0, Trend 1.0, Volatility 0.6, Structure 1.0, Divergence 1.4). Confluence bands: ≥ +8 strong bull, ≥ +4 moderate bull, ≤ −4 moderate bear, ≤ −8 strong bear; otherwise neutral. Heat score (0–1) blends magnitude, TF alignment, divergence strength, and volume confirmation.
Configuration:
Presets Intraday/Swing/Carry or full Custom. Adjustable weights, thresholds, oscillator params (WCM, RDZ, WVF), HTF-confirmed mode, matrix layout, alert conditions. Works on commodities, FX, indices; 1m to Monthly.
How to use:
Wait for TF alignment and high confluence; use reversal zones and divergence/exhaustion for timing. Trend follow: all TFs green, pullback to EMA20, stop below EMA50. Divergence: diamond appears, matrix flips, enter with confirmation. Squeeze: contraction then expansion in matrix direction.
Notes:
Pine v6. Non-repainting by design. Optimized security calls and UI throttling. Alert-ready. Backtest before live trading; manage risk; news context matters.
Disclaimer:
Educational only. Not financial advice. Past performance is not indicative of future results.
Categories:
Flow = MFI, OBV, volume trend, smart-money bias. Momentum = RSI (dynamic zones), MACD histo, CCI, WaveCycle Momentum (adaptive, ATR-normalized). Trend = EMA stack (20/50/100/200), ADX+DI, VWAP positioning. Volatility = ATR%, Williams Vix Fix spikes, squeeze (Bollinger inside Keltner). Structure = price vs key EMAs, pivot S/R alignment. Divergence = regular/hidden on RSI via RDZ, optional MACD, cluster strength; zone-gated and bar-confirmed.
Oscillators:
WCM detects momentum swings with dead-zone filtering and dynamic OB/OS. RDZ finds divergences only in RSI 70/30 zones with optional volume/MFI gate. WVF highlights volatility-shock exhaustion (bottom/top mode) and can feed the exhaustion filter.
Exhaustion module:
Strict 5-point check (RSI extreme, ATR range expansion, volume spike, wick ratio, compressed body) with Watch → Confirmed logic and optional reversal-zone boxes from pivots. Squeeze detector flags contraction and first expansion.
Matrix and visuals:
Compact or detailed grid; 4-layer heat gradient; ▲/▼/• symbols; action badges (Setup/Neutral); optional VWAP cross markers (session, anchored high/low, clusters). Overlay options: EMA gradient fill, AVWAP (session/week/month), S/R lines, divergence diamonds (teal/amber), exhaustion triangles, squeeze dots. Performance friendly (updates on last bar).
Scoring:
Each category scores −3…+3, weighted by importance (default: Flow 1.2, Momentum 1.0, Trend 1.0, Volatility 0.6, Structure 1.0, Divergence 1.4). Confluence bands: ≥ +8 strong bull, ≥ +4 moderate bull, ≤ −4 moderate bear, ≤ −8 strong bear; otherwise neutral. Heat score (0–1) blends magnitude, TF alignment, divergence strength, and volume confirmation.
Configuration:
Presets Intraday/Swing/Carry or full Custom. Adjustable weights, thresholds, oscillator params (WCM, RDZ, WVF), HTF-confirmed mode, matrix layout, alert conditions. Works on commodities, FX, indices; 1m to Monthly.
How to use:
Wait for TF alignment and high confluence; use reversal zones and divergence/exhaustion for timing. Trend follow: all TFs green, pullback to EMA20, stop below EMA50. Divergence: diamond appears, matrix flips, enter with confirmation. Squeeze: contraction then expansion in matrix direction.
Notes:
Pine v6. Non-repainting by design. Optimized security calls and UI throttling. Alert-ready. Backtest before live trading; manage risk; news context matters.
Disclaimer:
Educational only. Not financial advice. Past performance is not indicative of future results.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.