OPEN-SOURCE SCRIPT
Diupdate Multi SMA Analyzer

Multi SMA Analyzer with Custom SMA Table & Advanced Session Logic
A feature-rich SMA analysis suite for traders, offering up to 7 configurable SMAs, in-depth trend detection, real-time table, and true session-aware calculations.
Ideal for those who want to combine intraday, swing, and higher-timeframe trend analysis with maximum chart flexibility.
Key Features
📊 Multi-SMA Overlay
- 7 SMAs (default: 5, 20, 50, 100, 200, 21, 34)—individually configurable (period, source, color, line style)
- Show/hide each SMA, custom line style (solid, stepline, circles), and color logic
- Dynamic color: full opacity above SMA, reduced when below
⏰ Session-Aware SMAs
- Each SMA can be calculated using only user-defined session hours/days/timezone
- “Ignore extended hours” option for accurate intraday trend
📋 Smart Data Table
- Live SMA values, % distance from price, and directional arrows (↑/↓/→)
- Bull/Bear/Sideways trend classification
- Custom table position, size, colors, transparency
- Table can run on chart or custom (higher) timeframe for multi-TF analysis
🎯 Golden/Death Cross Detection
- Flexible crossover engine: select any two from (5, 10, 20, 50, 100, 200) for fast/slow SMA cross signals
- Plots icons (★ Golden, 💀 Death), optional crossover labels with custom size/colors
🏷️ SMA Labels
- Optional on-chart SMA period labels
- Custom placement (above/below/on line), size, color, offset
🚨 Signal & Trend Engine
- Bull/Bear/Sideways logic: price vs. multiple SMAs (not just one pair)
- Volume spike detection (2x 20-period SMA)
- Bullish engulfing candlestick detection
- All signals can use chart or custom table timeframe
🎨 Visual Customization
- Dynamic background color (Bull: green, Bear: red, Neutral: gray)
- Every visual aspect is customizable: label/table colors, transparency, size, position
🔔 Built-in Alerts
- Crossovers (SMA20/50, Golden/Death)
- Bull trend, volume spikes, engulfing pattern—all alert-ready
How It Works
- Session Filtering:
- SMAs can be set to count only bars from your chosen market session, for true intraday/trading-hour signals
Dynamic Table & Signals:
- Table and all signal logic run on your selected chart or custom timeframe
Flexible Crossover:
- Choose any pair (5, 10, 20, 50, 100, 200) for cross detection—SMA 10 is available for crossover even if not shown as an SMA line
Everything is modular:
- Toggle features, set visuals, and alerts to your workflow
🚨 How to Use Alerts
- All key signals (crossovers, trend shifts, volume spikes, engulfing patterns) are available as alert conditions.
To enable:
- Click the “Alerts” (clock) icon at the top of TradingView.
- Select your desired signal (e.g., “Golden Cross”) from the condition dropdown.
- Set your alert preferences and create the alert.
- Now, you’ll get notified automatically whenever a signal occurs!
Perfect For
- Multi-timeframe and swing traders seeking higher timeframe SMA confirmation
- Intraday traders who want to ignore pre/post-market data
- Anyone wanting a modern, powerful, fully customizable multi-SMA overlay
// P.S: Experiment with Golden Cross where Fast SMA is 5 and Slow SMA is 20.
// Set custom timeframe for 4 hr while monitoring your chart on 15 min time frame.
// Enable Background Color and Use Table Timeframe for Background.
// Uncheck Pine labels in Style tab.
Clean, open-source, and loaded with pro features—enjoy!
Like, share, and let me know if you'd like any new features added.
A feature-rich SMA analysis suite for traders, offering up to 7 configurable SMAs, in-depth trend detection, real-time table, and true session-aware calculations.
Ideal for those who want to combine intraday, swing, and higher-timeframe trend analysis with maximum chart flexibility.
Key Features
📊 Multi-SMA Overlay
- 7 SMAs (default: 5, 20, 50, 100, 200, 21, 34)—individually configurable (period, source, color, line style)
- Show/hide each SMA, custom line style (solid, stepline, circles), and color logic
- Dynamic color: full opacity above SMA, reduced when below
⏰ Session-Aware SMAs
- Each SMA can be calculated using only user-defined session hours/days/timezone
- “Ignore extended hours” option for accurate intraday trend
📋 Smart Data Table
- Live SMA values, % distance from price, and directional arrows (↑/↓/→)
- Bull/Bear/Sideways trend classification
- Custom table position, size, colors, transparency
- Table can run on chart or custom (higher) timeframe for multi-TF analysis
🎯 Golden/Death Cross Detection
- Flexible crossover engine: select any two from (5, 10, 20, 50, 100, 200) for fast/slow SMA cross signals
- Plots icons (★ Golden, 💀 Death), optional crossover labels with custom size/colors
🏷️ SMA Labels
- Optional on-chart SMA period labels
- Custom placement (above/below/on line), size, color, offset
🚨 Signal & Trend Engine
- Bull/Bear/Sideways logic: price vs. multiple SMAs (not just one pair)
- Volume spike detection (2x 20-period SMA)
- Bullish engulfing candlestick detection
- All signals can use chart or custom table timeframe
🎨 Visual Customization
- Dynamic background color (Bull: green, Bear: red, Neutral: gray)
- Every visual aspect is customizable: label/table colors, transparency, size, position
🔔 Built-in Alerts
- Crossovers (SMA20/50, Golden/Death)
- Bull trend, volume spikes, engulfing pattern—all alert-ready
How It Works
- Session Filtering:
- SMAs can be set to count only bars from your chosen market session, for true intraday/trading-hour signals
Dynamic Table & Signals:
- Table and all signal logic run on your selected chart or custom timeframe
Flexible Crossover:
- Choose any pair (5, 10, 20, 50, 100, 200) for cross detection—SMA 10 is available for crossover even if not shown as an SMA line
Everything is modular:
- Toggle features, set visuals, and alerts to your workflow
🚨 How to Use Alerts
- All key signals (crossovers, trend shifts, volume spikes, engulfing patterns) are available as alert conditions.
To enable:
- Click the “Alerts” (clock) icon at the top of TradingView.
- Select your desired signal (e.g., “Golden Cross”) from the condition dropdown.
- Set your alert preferences and create the alert.
- Now, you’ll get notified automatically whenever a signal occurs!
Perfect For
- Multi-timeframe and swing traders seeking higher timeframe SMA confirmation
- Intraday traders who want to ignore pre/post-market data
- Anyone wanting a modern, powerful, fully customizable multi-SMA overlay
// P.S: Experiment with Golden Cross where Fast SMA is 5 and Slow SMA is 20.
// Set custom timeframe for 4 hr while monitoring your chart on 15 min time frame.
// Enable Background Color and Use Table Timeframe for Background.
// Uncheck Pine labels in Style tab.
Clean, open-source, and loaded with pro features—enjoy!
Like, share, and let me know if you'd like any new features added.
Catatan Rilis
Changed some icons, fixed SMA 10 plotting.Enjoy!
Catatan Rilis
Fine tunningCatatan Rilis
Multi MA Analyzer V2 is a professional-grade multi-MA and leadership dashboard. It combines a 7-line MA stack, higher-timeframe table, RS vs benchmark, and leadership metrics into one compact panel. Every option is customizable, with helpful tooltips for newer investors.🎯 Core Idea
Give you, at a glance:
- Where price sits vs a professional MA stack
- How extended or washed-out it is
- Whether volume and accumulation support the move
- How the stock is behaving vs a benchmark (SPY, QQQ, IWM, sector ETF, etc.)
📊 Multi-MA Overlay (Pro MA Stack)
On the chart you get up to 7 configurable MAs:
- Default pro stack: SMA 10, EMA 21, SMA 50, SMA 100, SMA 200
- Plus optional MA F and MA G (for example another 5, 9, 34, etc.)
Each MA has:
- Type: SMA / EMA / WMA / HMA / VWMA
- Own length, source, and colour
- Dynamic colour logic:
- Full colour when price is above the MA
- Faded when price is below (downtrend transparency slider)
Optional on-chart labels show the exact MA type and length (for example EMA 21, SMA 200).
📐 Higher Timeframe MA Table
Everything in the table runs on one timeframe you choose (for example 1D while you trade 15m):
- For each enabled MA:
- Col 1: coloured dot (green / red / orange)
- Col 2: label + trend arrow (↑ / ↓ / →)
- Col 3: MA value
- Col 4: % distance from price
Extra goodies:
- Extra TF MA row (optional)
- Separate TF selector: m / H / D / W / M
- Lets you add, for example, a Weekly SMA 20 row without cluttering the chart
Table styling:
- Position: top/bottom left/right
- Font size, colours, background transparency all configurable
🧭 Leadership & RS Dashboard
All the leadership metrics + RS are calculated on the table timeframe for consistent reads.
Trend row
- Bull / Bear / Sideways based on price vs 10, 21, 50 MA stack
RS vs benchmark (IBD-style)
- RS line = symbol close ÷ benchmark close (default SPY)
- RS base = MA of the RS line (configurable length)
- RS % in table = how far RS is above or below its own MA
- Example: RS vs SPY +3.4 %
% off 52-week high
- How far price is from the 52-week high on the table TF
- Colour logic:
- Near highs (for example 0 to −10 %) → green
- Deep discounts (for example ≤ −30 %) → red
Volume vs 50-day
- Today’s volume as a % of the 50-day average (table TF)
- Quickly shows whether moves are happening on real volume or not
Extension vs EMA (in ATR)
- Distance from a chosen EMA (default EMA 21) measured in ATRs
- Typical read:
- 2–3 ATR above = extended leader
- −2–3 ATR below = washed-out pullback
Acc/Dist score (10 days)
- Simple 10-day accumulation / distribution score
- Uses both price change and volume change
- Table labels: Accum / Distrib / Neutral
⚡ Golden / Death Cross Engine
Flexible crossover engine, independent of which lines you plot:
- Choose any two from 5, 10, 20, 50, 100, 200 as fast / slow MAs
- Compact crossover markers:
- Golden Cross → ⇧
- Death Cross → ⇩
- Separate alert conditions for Golden / Death crosses
🔍 Signal & Pattern Detection
All signals use the table timeframe:
- Trend: Bull / Bear / Sideways (price vs 10, 21, 50)
- Volume Spike: volume > 2 × 20-period average
- Bullish Engulfing: current candle up, previous down, real body fully engulfed
Each signal has its own table row and alert condition.
🎨 Background Trend Colour
Optional background shading that tracks overall MA trend:
- Uses either chart TF or table TF (toggle)
- Colours: Bullish, Bearish, Neutral (with user-set transparency)
🧩 Visual Controls
- Label size: tiny / small / normal / large / huge
- Label placement: above / on / below each MA
- Label offset in bars (left or right)
- Table: position, font size, colours, background transparency
(For a minimal look, users can uncheck Labels on price scale and Inputs in status line in the Style tab.)
🔔 Alerts
Ready-to-use alert conditions:
- MA 20 cross above MA 50
- MA 20 cross below MA 50
- Golden Cross
- Death Cross
- Bull trend
- Volume spike
- Bullish engulfing pattern
🆕 What Is New In V2 vs original Multi SMA Analyzer
- Upgraded from a pure SMA tool to a full multi-MA engine (SMA / EMA / WMA / HMA / VWMA per line)
- Default professional MA stack: SMA 10, EMA 21, SMA 50, SMA 100, SMA 200
- Added an Extra TF MA row (independent m / H / D / W / M selector)
- Introduced the Leadership block:
- % off 52-week high
- Volume vs 50-day
- Extension vs EMA (ATR)
- 10-day Acc/Dist with Accum / Distrib / Neutral
- Added RS vs benchmark (IBD-style RS vs its own MA) directly into the table
- Standardised everything on one table timeframe for clean, reproducible signals
- Simplified internals by removing old session-filter logic from V1
- Replaced large crossover icons with compact ⇧ / ⇩ markers for a cleaner chart
- Refined MA label system (shared size selector, offset logic, and on/above/below options)
If you like V2, consider adding it to your layout as your primary trend + leadership dashboard and star the script so you can find it quickly later.
Tips
- For a clean status line, most users will prefer to disable “Inputs in status line” and keep only values visible.
- If you do not use price-scale labels from this script, uncheck “Labels on price scale” in the Style tab.
- A common setup is: chart on 15m or 1h, table timeframe set to 1D, RS benchmark set to SPY or QQQ depending on the ticker.
Clean, open-source, and focused on leadership and trend quality.
If you find it useful, like, share, and feel free to suggest future tweaks for a V3.
Catatan Rilis
Multi MA Analyzer V2 is a professional-grade multi-MA and leadership dashboard. It combines a 7-line MA stack, higher-timeframe table, RS vs benchmark, and leadership metrics into one compact panel. Every option is customizable, with helpful tooltips for newer investors.🎯 Core Idea
Give you, at a glance:
- Where price sits vs a professional MA stack
- How extended or washed-out it is
- Whether volume and accumulation support the move
- How the stock is behaving vs a benchmark (SPY, QQQ, IWM, sector ETF, etc.)
📊 Multi-MA Overlay (Pro MA Stack)
On the chart you get up to 7 configurable MAs:
- Default pro stack: SMA 10, EMA 21, SMA 50, SMA 100, SMA 200
- Plus optional MA F and MA G (for example another 5, 9, 34, etc.)
Each MA has:
- Type: SMA / EMA / WMA / HMA / VWMA
- Own length, source, and colour
- Dynamic colour logic:
- Full colour when price is above the MA
- Faded when price is below (downtrend transparency slider)
Optional on-chart labels show the exact MA type and length (for example EMA 21, SMA 200).
📐 Higher Timeframe MA Table
Everything in the table runs on one timeframe you choose (for example 1D while you trade 15m):
- For each enabled MA:
- Col 1: coloured dot (green / red / orange)
- Col 2: label + trend arrow (↑ / ↓ / →)
- Col 3: MA value
- Col 4: % distance from price
Extra goodies:
- Extra TF MA row (optional)
- Separate TF selector: m / H / D / W / M
- Lets you add, for example, a Weekly SMA 20 row without cluttering the chart
Table styling:
- Position: top/bottom left/right
- Font size, colours, background transparency all configurable
🧭 Leadership & RS Dashboard
All the leadership metrics + RS are calculated on the table timeframe for consistent reads.
Trend row
- Bull / Bear / Sideways based on price vs 10, 21, 50 MA stack
RS vs benchmark (IBD-style)
- RS line = symbol close ÷ benchmark close (default SPY)
- RS base = MA of the RS line (configurable length)
- RS % in table = how far RS is above or below its own MA
- Example: RS vs SPY +3.4 %
% off 52-week high
- How far price is from the 52-week high on the table TF
- Colour logic:
- Near highs (for example 0 to −10 %) → green
- Deep discounts (for example ≤ −30 %) → red
Volume vs 50-day
- Today’s volume as a % of the 50-day average (table TF)
- Quickly shows whether moves are happening on real volume or not
Extension vs EMA (in ATR)
- Distance from a chosen EMA (default EMA 21) measured in ATRs
- Typical read:
- 2–3 ATR above = extended leader
- −2–3 ATR below = washed-out pullback
Acc/Dist score (10 days)
- Simple 10-day accumulation / distribution score
- Uses both price change and volume change
- Table labels: Accum / Distrib / Neutral
⚡ Golden / Death Cross Engine
Flexible crossover engine, independent of which lines you plot:
- Choose any two from 5, 10, 20, 50, 100, 200 as fast / slow MAs
- Compact crossover markers:
- Golden Cross → ⇧
- Death Cross → ⇩
- Separate alert conditions for Golden / Death crosses
🔍 Signal & Pattern Detection
All signals use the table timeframe:
- Trend: Bull / Bear / Sideways (price vs 10, 21, 50)
- Volume Spike: volume > 2 × 20-period average
- Bullish Engulfing: current candle up, previous down, real body fully engulfed
Each signal has its own table row and alert condition.
🎨 Background Trend Colour
Optional background shading that tracks overall MA trend:
- Uses either chart TF or table TF (toggle)
- Colours: Bullish, Bearish, Neutral (with user-set transparency)
🧩 Visual Controls
- Label size: tiny / small / normal / large / huge
- Label placement: above / on / below each MA
- Label offset in bars (left or right)
- Table: position, font size, colours, background transparency
(For a minimal look, users can uncheck Labels on price scale and Inputs in status line in the Style tab.)
🔔 Alerts
Ready-to-use alert conditions:
- MA 20 cross above MA 50
- MA 20 cross below MA 50
- Golden Cross
- Death Cross
- Bull trend
- Volume spike
- Bullish engulfing pattern
🆕 What Is New In V2 vs original Multi SMA Analyzer
- Upgraded from a pure SMA tool to a full multi-MA engine (SMA / EMA / WMA / HMA / VWMA per line)
- Default professional MA stack: SMA 10, EMA 21, SMA 50, SMA 100, SMA 200
- Added an Extra TF MA row (independent m / H / D / W / M selector)
- Introduced the Leadership block:
- % off 52-week high
- Volume vs 50-day
- Extension vs EMA (ATR)
- 10-day Acc/Dist with Accum / Distrib / Neutral
- Added RS vs benchmark (IBD-style RS vs its own MA) directly into the table
- Standardised everything on one table timeframe for clean, reproducible signals
- Simplified internals by removing old session-filter logic from V1
- Replaced large crossover icons with compact ⇧ / ⇩ markers for a cleaner chart
- Refined MA label system (shared size selector, offset logic, and on/above/below options)
If you like V2, consider adding it to your layout as your primary trend + leadership dashboard and star the script so you can find it quickly later.
Tips
- For a clean status line, most users will prefer to disable “Inputs in status line” and keep only values visible.
- If you do not use price-scale labels from this script, uncheck “Labels on price scale” in the Style tab.
- A common setup is: chart on 15m or 1h, table timeframe set to 1D, RS benchmark set to SPY or QQQ depending on the ticker.
Clean, open-source, and focused on leadership and trend quality.
If you find it useful, like, share, and feel free to suggest future tweaks for a V3.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.