OPEN-SOURCE SCRIPT

Color Changing MAs

157
📌 Indicator: Color Changing Moving Averages
This script plots up to four customizable moving averages, each with dynamic color changes based on price positioning and optional RSI filtering.

🧩 Key Features:
✅ 4 independent moving averages (SMA or EMA)

✅ Custom inputs for:

Length

Source (e.g. close, OHLC4, etc.)

Offset

Bullish/Bearish color

✅ Toggle visibility for each MA

✅ Global RSI filter to enhance trend signals:

User-defined RSI length

Adjustable Bullish/Bearish thresholds

Universal neutral color for flat/unclear momentum

✅ Global timeframe control — all MAs and RSI are calculated on a single timeframe of your choice (e.g. D, W, M)

🎯 Color Logic:
Bullish color = MA is below both open and close, and RSI is above threshold

Bearish color = MA is above both open and close, and RSI is below threshold

Neutral gray = MA is trending but RSI contradicts the move (filtered out)

🛠️ Use Cases:
Spot trend changes with visual clarity

Identify pullbacks within strong RSI-confirmed trends

Apply higher-timeframe signals while on lower-timeframe charts

⚠️ Notes:
This version uses request.security() to support global timeframe selection — higher timeframes on lower TF charts will display step-like behavior (as per TradingView architecture).

No smoothing/interpolation is applied to preserve raw signal accuracy.

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.