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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.