OPEN-SOURCE SCRIPT
Diupdate MTF SMA & EMA

This indicator is an all-in-one trend analysis tool designed to give traders a comprehensive macro and micro view of moving averages (SMAs & EMAs) across multiple timeframes simultaneously. It perfectly combines a dynamic, color-coded dashboard with customizable on-chart plots, allowing you to read the market trend without constantly switching timeframes.
🔥 Key Features:
Multi-Timeframe (MTF) Dashboard: Instantly view SMA (5, 8, 13) and EMA (21, 34, 55, 89, 100, 144, 200, 233, 377) values for 4 distinct timeframes (20-Min, 1-Hour, 4-Hour, and 1-Day) all in one clean, right-aligned table.
Dynamic Distance Percentage: Each cell goes beyond just showing the MA value; it calculates and displays the exact percentage distance between the current live price and that specific moving average (e.g., +0.50% or -1.20%).
Visual Trend Indication (Heatmap): The dashboard acts as a trend heatmap. If the current price is above a moving average, the cell turns Teal (Bullish). If the price is below, it turns Maroon (Bearish). This allows for split-second trend identification across multiple dimensions.
Centered Live Price: The current market price is elegantly merged and centered at the top of the dashboard for quick visual reference.
On-Chart Plots: While the table shows the macro picture, the indicator automatically draws the selected moving averages for your current chart timeframe.
Highly Optimized (No Lag): Built entirely in Pine Script™ v5, the code utilizes custom type objects and grouped request.security() calls. This advanced architecture ensures maximum performance and completely bypasses the typical security call limits.
⚙️ How to Use & Customize:
Inputs Tab (Table Control): You have full control over the dashboard. Want to hide the 1-Day column? Or maybe hide EMA 377? Simply uncheck them in the inputs. The table will automatically resize and re-center the remaining data flawlessly.
Style Tab (Chart Control): You can easily toggle the visibility, color, and line thickness of the moving averages plotted directly on your chart via the indicator's Style settings.
Whether you are a scalper looking for quick pullbacks to the 20-min MAs, or a swing trader checking the 4H/1D macro trend alignment, this dashboard provides all the necessary data at a single glance.
🔥 Key Features:
Multi-Timeframe (MTF) Dashboard: Instantly view SMA (5, 8, 13) and EMA (21, 34, 55, 89, 100, 144, 200, 233, 377) values for 4 distinct timeframes (20-Min, 1-Hour, 4-Hour, and 1-Day) all in one clean, right-aligned table.
Dynamic Distance Percentage: Each cell goes beyond just showing the MA value; it calculates and displays the exact percentage distance between the current live price and that specific moving average (e.g., +0.50% or -1.20%).
Visual Trend Indication (Heatmap): The dashboard acts as a trend heatmap. If the current price is above a moving average, the cell turns Teal (Bullish). If the price is below, it turns Maroon (Bearish). This allows for split-second trend identification across multiple dimensions.
Centered Live Price: The current market price is elegantly merged and centered at the top of the dashboard for quick visual reference.
On-Chart Plots: While the table shows the macro picture, the indicator automatically draws the selected moving averages for your current chart timeframe.
Highly Optimized (No Lag): Built entirely in Pine Script™ v5, the code utilizes custom type objects and grouped request.security() calls. This advanced architecture ensures maximum performance and completely bypasses the typical security call limits.
⚙️ How to Use & Customize:
Inputs Tab (Table Control): You have full control over the dashboard. Want to hide the 1-Day column? Or maybe hide EMA 377? Simply uncheck them in the inputs. The table will automatically resize and re-center the remaining data flawlessly.
Style Tab (Chart Control): You can easily toggle the visibility, color, and line thickness of the moving averages plotted directly on your chart via the indicator's Style settings.
Whether you are a scalper looking for quick pullbacks to the 20-min MAs, or a swing trader checking the 4H/1D macro trend alignment, this dashboard provides all the necessary data at a single glance.
Catatan Rilis
In this update, the core architecture has been completely overhauled to prevent false signals (repainting) and to maximize your flexibility in trend analysis.Pine Script v6 Integration: The code infrastructure has been upgraded to TradingView's latest and most efficient engine, v6. All data request functions (request.security) have been updated to meet the new strict standards (e.g., utilizing the "1D" timeframe format).
Independent Dual Engine (Calculation Modes): The most critical innovation! A new "Calculation Modes" section has been added to the settings. You can now run the multi-timeframe dashboard in "Bar Close" mode to filter out intra-candle noise, while simultaneously keeping your on-chart moving average plots in "Live" mode to catch real-time market reactions.
Smart Distance Percentage: Even when the dashboard is set to "Bar Close" (confirmed data) mode, the Current Price and the Percentage Distance (%) calculations are hard-coded to always remain live. This allows you to instantly see how far the live price is deviating from the confirmed, underlying trend.
Universal UI: All internal menus, table headers, and user tooltips have been fully localized to English for a seamless global trading experience.
Catatan Rilis
Shortened İndicator nameCatatan Rilis
Added Proximity RadarThe Proximity Radar logic is based on "Spatial Price Action" and "Dynamic S/R (Support/Resistance) Analysis."
Here is the concise logic:
Distance Mapping: It dynamically measures the exact price gap between the current market price and every active Moving Average (MA/EMA) plotted on your chart.
Boundary Identification: It scans all active MAs to categorize:
Closest Support: The nearest MA located below the current price.
Closest Resistance: The nearest MA located above the current price.
The Magnetism Principle: The logic assumes price acts like a magnet, gravitating toward the nearest structural barrier.
BUY (Bounce): If the price is closer to a support MA, the radar predicts a "Bounce," suggesting the support will hold.
SELL (Reject): If the price is closer to a resistance MA, it predicts a "Reject," suggesting the resistance will act as a ceiling.
Automatic Trade Plan: It maps the two closest boundaries as your exit/safety zones:
Target (TP): The "other" boundary (e.g., if buying at support, your target is the nearest resistance).
Stop (SL): The "current" boundary (the level you are bouncing off of or rejecting from).
In short: It turns static lines into an actionable map, telling you exactly where the price is "trapped" and identifying the most mathematically logical entry, target, and stop levels based on immediate proximity.
Catatan Rilis
1. Price Reference AlignmentThe Proximity Radar was originally hardcoded to use the live close price for its support and resistance calculations. This caused it to bypass your "Table Calculation Basis" setting. I replaced the hardcoded close with the src_tbl variable (defined as radar_price). Now, the radar accurately calculates distances based strictly on your choice of "Live" or "Bar Close" data.
2. Layout Adjustment
Both the main dashboard and the radar panel were occupying the right side of the screen, causing them to overlap on smaller screens. I changed the radar table's location parameter from position.bottom_right to position.bottom_left. This prevents UI collision and keeps your chart readable.
Catatan Rilis
1. Price Reference AlignmentThe Proximity Radar was originally hardcoded to use the live close price for its support and resistance calculations. This caused it to bypass your "Table Calculation Basis" setting. I replaced the hardcoded close with the src_tbl variable (defined as radar_price). Now, the radar accurately calculates distances based strictly on your choice of "Live" or "Bar Close" data.
2. Layout Adjustment
Both the main dashboard and the radar panel were occupying the right side of the screen, causing them to overlap on smaller screens. I changed the radar table's location parameter from position.bottom_right to position.bottom_left. This prevents UI collision and keeps your chart readable.
Catatan Rilis
Adjusted misalignementCatatan Rilis
Current Price CorrectionCatatan Rilis
Key Changes & Updates1. Floating-Point Precision Fix (The math.round_to_mintick implementation)
The Issue: Previously, the radar would sometimes issue a "SELL" signal even when the price and the Moving Average (MA) appeared identical on the screen (e.g., both displaying 34.94). This occurred because the internal calculation retained hidden decimal extensions (e.g., Price: 34.9399 vs. MA: 34.9412).
The Solution: Implemented the math.round_to_mintick() function. Both the radar_price and the calculated ma_val are now rounded to the visible tick value before comparison. This ensures the algorithm evaluates exactly what the user sees, correctly identifying exact matches as a "BUY" (since the rule is >=).
2. Restored Original Matrix Layout
The Issue: A previous simplification removed the multi-row layout of the Proximity Radar, condensing it into a single line which obscured critical support and resistance levels.
The Solution: Rebuilt the physical structure of the radar table to restore the original 3-column, 5-row design. The table now distinctly shows the Closest Resistance (Top), the Action/Decision (Middle), the Closest Support (Bottom), and the Target/Stop Loss (TP/SL) parameters, all while maintaining the strict binary logic for the decision itself.
3. Dynamic Radar Title based on Calculation Mode
The Issue: When the user selected the "Bar Close (Confirmed)" mode, the radar correctly used the previous candle's close for its calculation. However, the title did not reflect this, leading to confusion as the "Current Price" in the dashboard constantly fluctuated while the radar's decision remained static.
The Solution: Added conditional logic to the radar's title string. If "Bar Close" is active, the exact price used for the decision is dynamically appended to the title (e.g., Binary Radar (20) [Price: 34.94]). If "Live" mode is active, the standard title remains.
4. Visibility Toggles (UI Enhancement)
The Issue: Users had no way to declutter their workspace without manually disabling the indicator entirely or unticking individual MAs from the settings.
The Solution: Introduced three master toggle checkboxes in the settings menu:
Show MA Lines on Chart: Instantly hides or shows all plotted moving averages on the main chart, while respecting the individual MA selections.
Show MTF Dashboard (Right): Toggles the visibility of the large Multi-Timeframe table.
Show Binary Radar (Left): Toggles the visibility of the smaller decision matrix table.
Technical Detail: Fixed the table.clear() error by providing explicit coordinate parameters (start column, start row, end column, end row) ensuring the tables are cleanly wiped from the screen when toggled off.
5. Global Calculation Scope (NaN Prevention)
The Issue: MA calculations were previously nested inside the if barstate.islast block. Because Pine Script evaluates history sequentially, restricting MA functions to the last bar caused them to return NaN (Not a Number), breaking the radar's logic.
The Solution: Moved all ta.sma and ta.ema calculations for the radar into the global scope. This guarantees continuous calculation across all historical bars, preventing data loss and ensuring the radar always finds the closest valid MA. Additional if not na() checks were added as a fail-safe.
Catatan Rilis
This major update focuses on resolving backend calculation conflicts, optimizing the user interface for smaller screens, and introducing a macro-trend health metric. Below are the 5 core architectural improvements integrated into this version:1. Floating-Point Precision & Equality Fix (Mintick Rounding)
Old Code: The script compared raw, unrounded data. Due to Pine Script's deep decimal processing, a price of 34.938 and an MA of 34.941 would both display as 34.94 on the screen, but the micro-difference would falsely trigger a "Sell/Resistance" signal on the Radar.
New Code: Both the table cells and the Radar's distance algorithms now utilize math.round_to_mintick(). The script mathematically rounds the background data to match the exact visible tick on your chart. Exact matches (Price == MA) are now accurately categorized as "Support (Testing)" rather than throwing false resistance signals.
2. Decoupled Cache Architecture for Real-Time vs. Bar Close
Old Code: Switching the calculation mode between "Live" and "Bar Close" within a single conditional statement caused the Pine Script engine to cache the data, permanently freezing the dashboard and radar outputs until the script was reloaded.
New Code: The script now calculates both the Live (close) and Bar Close (close[1]) arrays entirely independently via parallel request.security calls. The UI seamlessly switches between these pre-calculated arrays based on your input, completely eliminating engine cache lock-ups.
3. Independent "Current Price" Streaming
Old Code: If the user selected the "Bar Close" calculation basis, the "Current Price" displayed in the main dashboard also froze at the previous candle's close, preventing the user from tracking the live market.
New Code: The curr_price variable assigned to the dashboard's display is now strictly hardcoded to close (Live). The script successfully decouples the visual price ticker from the underlying Moving Average calculation matrix, ensuring the price always streams live while MAs respect the chosen "Close/Live" rule.
4. Advanced UI/UX Scaling and Relocation
Old Code: The table utilized default sizing, consuming a massive portion of the chart. Furthermore, both the MTF Dashboard and the Proximity Radar were anchored to the right side of the screen, causing them to overlap and become unreadable on smaller monitors.
New Code: All table text and cell formatting have been universally scaled down to size.small for a highly compact, professional look. To eliminate UI collisions, the Proximity Radar has been permanently relocated to position.bottom_left. Additionally, the exact calculation price used by the Radar is now explicitly displayed within its panel for instant visual verification.
5. "Trend Health" Macro Metric Integration
Old Code: Users had to manually scan 48 different moving average cells (green vs. red) across 4 timeframes to gauge the overall market trend.
New Code: A dynamic array counter has been integrated into the loop. It calculates the exact ratio of Bullish alignments (Price > MA) against the total active moving averages. This ratio is displayed as a bold "TREND HEALTH %" metric at the very top of the dashboard, providing an instant macro-level summary of the asset's momentum.
Catatan Rilis
Minor Screen Adj.Catatan Rilis
Screen Adj.Catatan Rilis
Added Tp1 Tp2 Tp3Catatan Rilis
Overhauled code for memory exceeded errorSkrip 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.