OPEN-SOURCE SCRIPT
EMA/SMA Distance Percentage Table

This TradingView indicator, "EMA/SMA Distance Percentage Table," is designed to help traders and analysts quickly assess the current price's relationship to key Exponential Moving Averages (EMAs) and Simple Moving Averages (SMAs).
Here's a breakdown of what it does:
Calculates Multiple Moving Averages: It computes EMAs for lengths 10, 30, 50, and 200, and SMAs for lengths 50 and 200. These are commonly used moving averages in technical analysis.
Measures Percentage Distance: For each of these moving averages, it calculates the percentage difference between the current closing price and the moving average's value. This indicates how far, in percentage terms, the price has deviated from that average. A positive percentage means the price is above the MA, while a negative percentage means it's below.
Displays Data in a Table: All the calculated information (MA type and length, its current value, and the percentage distance) is presented in a clear, organized table on the chart. This allows for quick at-a-glance monitoring.
Customizable Visibility: Users have the flexibility to show or hide the plots of the EMAs and SMAs on the chart, as well as the entire data table, through the indicator's settings.
Purpose:
The primary purpose of this indicator is to provide a concise overview of price momentum and potential overbought/oversold conditions relative to various moving averages. Traders often use the distance from MAs to:
Identify Trend Strength: A large distance from a long-term MA might suggest a strong trend.
Spot Potential Reversals: If the price is significantly extended from an MA, it might indicate that a pullback or reversal is due.
Confirm Support/Resistance: Moving averages often act as dynamic support or resistance levels, and their distance can provide context.
In essence, it helps you quickly see if the price is "stretched" or "compressed" relative to its historical averages, which can be valuable for making trading decisions.
Here's a breakdown of what it does:
Calculates Multiple Moving Averages: It computes EMAs for lengths 10, 30, 50, and 200, and SMAs for lengths 50 and 200. These are commonly used moving averages in technical analysis.
Measures Percentage Distance: For each of these moving averages, it calculates the percentage difference between the current closing price and the moving average's value. This indicates how far, in percentage terms, the price has deviated from that average. A positive percentage means the price is above the MA, while a negative percentage means it's below.
Displays Data in a Table: All the calculated information (MA type and length, its current value, and the percentage distance) is presented in a clear, organized table on the chart. This allows for quick at-a-glance monitoring.
Customizable Visibility: Users have the flexibility to show or hide the plots of the EMAs and SMAs on the chart, as well as the entire data table, through the indicator's settings.
Purpose:
The primary purpose of this indicator is to provide a concise overview of price momentum and potential overbought/oversold conditions relative to various moving averages. Traders often use the distance from MAs to:
Identify Trend Strength: A large distance from a long-term MA might suggest a strong trend.
Spot Potential Reversals: If the price is significantly extended from an MA, it might indicate that a pullback or reversal is due.
Confirm Support/Resistance: Moving averages often act as dynamic support or resistance levels, and their distance can provide context.
In essence, it helps you quickly see if the price is "stretched" or "compressed" relative to its historical averages, which can be valuable for making trading decisions.
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.