OPEN-SOURCE SCRIPT
TRIPLE Moving Averages

This Pine Script indicator plots three customizable moving averages (MAs) along with an optional composite MA (average of all three). It provides visual cues, alerts, and trend confirmation based on MA crossovers and price positioning relative to the MAs.
🔹 Key Features
1. Multiple Moving Average Types
Supports 7 different MA types for each line:
EMA (Exponential Moving Average)
SMA (Simple Moving Average)
SMMA / RMA (Smoothed / Regular Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume Weighted Moving Average)
HMA (Hull Moving Average)
2. Three Independent MAs
MA1, MA2, MA3 can each be enabled/disabled
Custom lengths (default: 12, 21, 50)
Different price sources (close, open, high, low, etc.)
3. Composite Moving Average (Optional)
Calculates (MA1 + MA2 + MA3) / 3
Acts as a consensus trend filter
4. Visual & Alert Features
✅ Color-Coded Lines (Yellow = Price Above MA, Red = Price Below MA)
✅ Thick Line Width (3) for better visibility
✅ Background Highlights for crossovers/crossunders
✅ Alerts for All Crossover Combinations
🔹 How It Works
📈 MA Crossovers & Trend Signals
Bullish Signal: When a faster MA crosses above a slower MA
Bearish Signal: When a faster MA crosses below a slower MA
Trend Confirmation: All MAs aligned in the same direction (e.g., MA1 > MA2 > MA3 = Strong Uptrend)
🎨 Visual Indicators
Green Background → Bullish crossover detected
Red Background → Bearish crossover detected
Yellow Line → Price is above the MA (bullish)
Red Line → Price is below the MA (bearish)
🔔 Alert Conditions
Alerts are triggered for all possible MA crossover combinations, including:
MA1 crossing MA2
MA1 crossing MA3
MA2 crossing MA3
Any MA crossing the Composite MA
🔹 Key Features
1. Multiple Moving Average Types
Supports 7 different MA types for each line:
EMA (Exponential Moving Average)
SMA (Simple Moving Average)
SMMA / RMA (Smoothed / Regular Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume Weighted Moving Average)
HMA (Hull Moving Average)
2. Three Independent MAs
MA1, MA2, MA3 can each be enabled/disabled
Custom lengths (default: 12, 21, 50)
Different price sources (close, open, high, low, etc.)
3. Composite Moving Average (Optional)
Calculates (MA1 + MA2 + MA3) / 3
Acts as a consensus trend filter
4. Visual & Alert Features
✅ Color-Coded Lines (Yellow = Price Above MA, Red = Price Below MA)
✅ Thick Line Width (3) for better visibility
✅ Background Highlights for crossovers/crossunders
✅ Alerts for All Crossover Combinations
🔹 How It Works
📈 MA Crossovers & Trend Signals
Bullish Signal: When a faster MA crosses above a slower MA
Bearish Signal: When a faster MA crosses below a slower MA
Trend Confirmation: All MAs aligned in the same direction (e.g., MA1 > MA2 > MA3 = Strong Uptrend)
🎨 Visual Indicators
Green Background → Bullish crossover detected
Red Background → Bearish crossover detected
Yellow Line → Price is above the MA (bullish)
Red Line → Price is below the MA (bearish)
🔔 Alert Conditions
Alerts are triggered for all possible MA crossover combinations, including:
MA1 crossing MA2
MA1 crossing MA3
MA2 crossing MA3
Any MA crossing the Composite MA
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.