OPEN-SOURCE SCRIPT
Telah dikemas kini Combined EMA/Smiley & DEM System

## 🔷 General Overview
This script creates an advanced technical analysis system for TradingView, combining multiple Exponential Moving Averages (EMAs), Simple Moving Averages (SMAs), dynamic Fibonacci levels, and ATR (Average True Range) analysis. It presents the results clearly through interactive, real-time tables directly on the chart.
---
## 🔹 Indicator Structure
The script consists of two main parts:
### **1. EMA & SMA Combined System with Fibonacci**
- **Purpose:**
Provides visual insights by comparing multiple EMA/SMA periods and identifying significant dynamic price levels using Fibonacci ratios around a calculated "Golden" line.
- **Components:**
- **Moving Averages (MAs)**:
- 20 EMAs (periods from 20 to 400)
- 20 SMAs (also from 20 to 400)
- **Golden Line:**
Calculated as the average of all EMAs and SMAs.
- **Dynamic Fibonacci Levels:**
Key ratios around the Golden line (0.5, 0.618, 0.786, 1.0, 1.272, 1.414, 1.618, 2.0) dynamically adjust based on market conditions.
- **Fibonacci Labels:**
Labels are shown next to Fibonacci lines, indicating their numeric value clearly on the chart.
- **Table (Top Right Corner):**
- Displays:
- **Input:** EMA/SMA periods sorted by their current average price levels.
- **AVG:** The average of corresponding EMA & SMA pairs.
- **EMA & SMA Values:** Individual EMA/SMA values clearly marked.
- **Dynamic Highlighting:** Highlights the row whose average (EMA+SMA)/2 is closest to the current price, helping identify immediate price action significance.
- **Sorting Logic:**
Each EMA/SMA pair is dynamically sorted based on their average values. Color coding (red/green) is used:
- **Green:** EMA/SMA pairs with shorter periods when their average is lower.
- **Red:** EMA/SMA pairs with longer periods when their average is lower.
- **Star (⭐):** Represents the "Golden" average clearly.
---
### **2. DEM System (Dynamic EMA/ATR Metrics)**
- **Purpose:**
Provides detailed ATR statistics to assess market volatility clearly and quickly.
- **Components:**
- **Moving Averages:**
- SMA lines: 25, 50, 100, 200.
- **Bollinger Bands:**
- Based on 20-period SMA of highs and standard deviation of lows.
- **ATR Analysis:**
- ATR calculations for multiple periods (1-day, 10, 20, 30, 40, 50).
- **ATR Premium:** Average ATR of all calculated periods, providing an overarching volatility indicator.
- **ATR Table (Bottom Right Corner):**
- Displays clearly structured ATR values and percentages relative to the current close price:
- Columns: **ATR Period**, **Value**, and **% of Close**.
- Rows: Each specific ATR (1D, 10, 20, 30, 40, 50), plus ATR premium.
- The ATR premium is highlighted in yellow to signify its importance clearly.
---
## 🔹 Key Features and Logic Explained
- **Dynamic EMA/SMA Sorting:**
The script computes the average of each EMA/SMA pair and sorts them dynamically on each bar, highlighting their relative importance visually. This allows traders to easily interpret the strength of current support/resistance levels based on moving averages.
- **Closest EMA/SMA Pair to Current Price:**
Calculates the absolute difference between the current price and all EMA/SMA averages, highlighting the closest one for quick reference.
- **Fibonacci Ratios:**
- Dynamically calculated Fibonacci levels based on the "Golden" EMA/SMA average give clear visual guidance for potential targets, supports, and resistances.
- Labels are continuously updated and placed next to levels for clarity.
- **ATR Volatility Analysis:**
- Provides immediate insight into market volatility with absolute and relative (percentage-based) ATR values.
- ATR premium summarizes volatility across multiple timeframes clearly.
---
## 🔹 Practical Use Case:
- Traders can quickly identify support/resistance and critical price zones through EMA/SMA and Fibonacci combinations.
- Useful in assessing immediate volatility, guiding stop-loss and take-profit levels through detailed ATR metrics.
- The dynamic highlighting in tables provides intuitive, real-time decision support for active traders.
---
## 🔹 How to Use this Script:
1. **Adjust EMA & SMA Lengths** from indicator settings if different periods are preferred.
2. **Monitor dynamic Fibonacci levels** around the "Golden" average to identify possible reversal or continuation points.
3. **Check EMA/SMA table:** Rows highlighted indicate immediate significance concerning current market price.
4. **ATR table:** Use volatility metrics for better risk management.
---
## 🔷 Conclusion
This advanced Pine Script indicator efficiently combines multiple EMAs, SMAs, dynamic Fibonacci retracement levels, and volatility analysis using ATR into a comprehensive real-time analytical tool, enhancing traders' decision-making capabilities by providing clear and actionable insights directly on the TradingView chart.
This script creates an advanced technical analysis system for TradingView, combining multiple Exponential Moving Averages (EMAs), Simple Moving Averages (SMAs), dynamic Fibonacci levels, and ATR (Average True Range) analysis. It presents the results clearly through interactive, real-time tables directly on the chart.
---
## 🔹 Indicator Structure
The script consists of two main parts:
### **1. EMA & SMA Combined System with Fibonacci**
- **Purpose:**
Provides visual insights by comparing multiple EMA/SMA periods and identifying significant dynamic price levels using Fibonacci ratios around a calculated "Golden" line.
- **Components:**
- **Moving Averages (MAs)**:
- 20 EMAs (periods from 20 to 400)
- 20 SMAs (also from 20 to 400)
- **Golden Line:**
Calculated as the average of all EMAs and SMAs.
- **Dynamic Fibonacci Levels:**
Key ratios around the Golden line (0.5, 0.618, 0.786, 1.0, 1.272, 1.414, 1.618, 2.0) dynamically adjust based on market conditions.
- **Fibonacci Labels:**
Labels are shown next to Fibonacci lines, indicating their numeric value clearly on the chart.
- **Table (Top Right Corner):**
- Displays:
- **Input:** EMA/SMA periods sorted by their current average price levels.
- **AVG:** The average of corresponding EMA & SMA pairs.
- **EMA & SMA Values:** Individual EMA/SMA values clearly marked.
- **Dynamic Highlighting:** Highlights the row whose average (EMA+SMA)/2 is closest to the current price, helping identify immediate price action significance.
- **Sorting Logic:**
Each EMA/SMA pair is dynamically sorted based on their average values. Color coding (red/green) is used:
- **Green:** EMA/SMA pairs with shorter periods when their average is lower.
- **Red:** EMA/SMA pairs with longer periods when their average is lower.
- **Star (⭐):** Represents the "Golden" average clearly.
---
### **2. DEM System (Dynamic EMA/ATR Metrics)**
- **Purpose:**
Provides detailed ATR statistics to assess market volatility clearly and quickly.
- **Components:**
- **Moving Averages:**
- SMA lines: 25, 50, 100, 200.
- **Bollinger Bands:**
- Based on 20-period SMA of highs and standard deviation of lows.
- **ATR Analysis:**
- ATR calculations for multiple periods (1-day, 10, 20, 30, 40, 50).
- **ATR Premium:** Average ATR of all calculated periods, providing an overarching volatility indicator.
- **ATR Table (Bottom Right Corner):**
- Displays clearly structured ATR values and percentages relative to the current close price:
- Columns: **ATR Period**, **Value**, and **% of Close**.
- Rows: Each specific ATR (1D, 10, 20, 30, 40, 50), plus ATR premium.
- The ATR premium is highlighted in yellow to signify its importance clearly.
---
## 🔹 Key Features and Logic Explained
- **Dynamic EMA/SMA Sorting:**
The script computes the average of each EMA/SMA pair and sorts them dynamically on each bar, highlighting their relative importance visually. This allows traders to easily interpret the strength of current support/resistance levels based on moving averages.
- **Closest EMA/SMA Pair to Current Price:**
Calculates the absolute difference between the current price and all EMA/SMA averages, highlighting the closest one for quick reference.
- **Fibonacci Ratios:**
- Dynamically calculated Fibonacci levels based on the "Golden" EMA/SMA average give clear visual guidance for potential targets, supports, and resistances.
- Labels are continuously updated and placed next to levels for clarity.
- **ATR Volatility Analysis:**
- Provides immediate insight into market volatility with absolute and relative (percentage-based) ATR values.
- ATR premium summarizes volatility across multiple timeframes clearly.
---
## 🔹 Practical Use Case:
- Traders can quickly identify support/resistance and critical price zones through EMA/SMA and Fibonacci combinations.
- Useful in assessing immediate volatility, guiding stop-loss and take-profit levels through detailed ATR metrics.
- The dynamic highlighting in tables provides intuitive, real-time decision support for active traders.
---
## 🔹 How to Use this Script:
1. **Adjust EMA & SMA Lengths** from indicator settings if different periods are preferred.
2. **Monitor dynamic Fibonacci levels** around the "Golden" average to identify possible reversal or continuation points.
3. **Check EMA/SMA table:** Rows highlighted indicate immediate significance concerning current market price.
4. **ATR table:** Use volatility metrics for better risk management.
---
## 🔷 Conclusion
This advanced Pine Script indicator efficiently combines multiple EMAs, SMAs, dynamic Fibonacci retracement levels, and volatility analysis using ATR into a comprehensive real-time analytical tool, enhancing traders' decision-making capabilities by providing clear and actionable insights directly on the TradingView chart.
Nota Keluaran
# Greedy – Combined EMA/Smiley & DEM System
## Overview
This indicator integrates a sophisticated EMA/SMA analysis framework alongside a specialized DEM (Dynamic Environment Monitor) volatility system. It is designed to assist traders in recognizing key market structures, identifying volatility zones, and quickly gauging the overall market condition based on structured table displays.
---
## Indicator Components
### 1. EMA & SMA Analysis Table
This comprehensive table features **20 customizable pairs of Exponential Moving Averages (EMA) and Simple Moving Averages (SMA)**, sorted dynamically by their combined averages, as well as a special benchmark called **"Golden"**, representing the overall average of all EMA/SMA lines.
Each EMA/SMA pair is listed in a structured table format, highlighting their averages, individual EMA and SMA values, and providing visual color cues to enhance interpretation:
* **"Input" column**: Displays the period length of each EMA/SMA pair. The special "Golden" row is marked distinctly as a star ("⭐").
* **"AVG" column**: Reflects the average value of each EMA/SMA pair, sorted dynamically in descending order. The closest pair to the current market price is highlighted to immediately identify key support/resistance areas.
* **"EMA" and "SMA" columns**: Individually list EMA and SMA values, with specific color highlights:
* **Green**: Indicates a bullish crossover or shorter-term momentum strength.
* **Red**: Indicates a bearish crossover or longer-term momentum weakness.
* **White**: Neutral state, no significant cross or momentum signal.
### How to Analyze:
* **Market Stability vs. Volatility**:
A structured table (values neatly ordered from highest to lowest) suggests stable market conditions with less expected volatility. Conversely, a scattered or disordered table often precedes increased volatility or a market transition phase.
* **Identifying Trading Ranges**:
By pinpointing the pairs closest to the current market price, traders can quickly define effective support and resistance zones. Price moving between two clearly defined pairs can suggest consolidations or range-bound markets, suitable for mean-reversion strategies.
* **"Golden" Level Usage**:
The "Golden" level (average of all EMA/SMA values) acts as a powerful midpoint or equilibrium line. When prices cluster around this level, it signals indecision or balanced market pressure. Price movements away from this central line indicate developing trends or momentum.
---
### 2. Fibonacci Levels & Labels:
The indicator calculates multiple Fibonacci-based levels derived directly from the "Golden" average, clearly plotted on the chart. Each Fibonacci level (e.g., 0.5, 0.618, 0.786, 1.0, 1.272, 1.414, 1.618, 2.0) is visually marked and labeled, allowing traders to:
* Identify potential reversal or continuation zones based on well-established Fibonacci ratios.
* Quickly gauge how the current price interacts with these strategic Fibonacci levels, enhancing trading decisions such as entries, stops, or targets.
**Closest Fibonacci Label Highlight**:
The indicator automatically highlights the Fibonacci level closest to the current market price, helping traders quickly identify immediate market influence points and reinforcing high-probability trading setups.
---
### 3. DEM System ATR Table:
The DEM System utilizes Average True Range (ATR) across multiple periods (1, 10, 20, 30, 40, and 50) and calculates a special "ATR Premium" average, reflecting overall market volatility and dynamics.
* **ATR Values and Percentages**:
Each ATR value is provided along with its corresponding percentage relative to the current market price, enabling quick comparisons of short-term and long-term volatility.
### How to Interpret the ATR Table:
* **High ATR %**: Signals increased volatility, suggesting caution, wider stops, and careful position sizing.
* **Low ATR %**: Indicates a stable, low-volatility environment, generally safer for trend-following or low-risk strategies.
* **ATR Premium**: Serves as a broad volatility benchmark, quickly informing traders if the current session’s volatility exceeds or falls below recent market averages.
---
## Practical Trading Insights & Strategies:
* **Trend Confirmation & Crossovers**:
Monitor EMA/SMA color transitions (green/red) within the table to confirm trend strength and direction. Significant shifts (multiple rows changing color simultaneously) often precede stronger market movements.
* **Breakout & Range Strategies**:
Price consistently trading around or between two close EMA/SMA pairs suggests range-bound conditions. Breakouts from these zones could signal potential trading opportunities.
* **Early Volatility Alerts**:
Chaotic sorting within the EMA/SMA table, coupled with rising ATR Premium, can provide an early indication of volatility expansion, prompting proactive adjustments in trading strategy or risk management.
* **Dynamic Support & Resistance**:
The highlighted EMA/SMA pair closest to the price acts as dynamic intraday support or resistance, aiding precise entry/exit placements.
---
## User Customizations:
Traders can fully customize EMA and SMA periods to suit their specific trading style, timeframe preference, or market type (stocks, forex, crypto). Adjustments to label colors, table offset positioning, and Fibonacci visualization provide additional personalization to enhance clarity and usability.
---
## Conclusion:
The Greedy – Combined EMA/Smiley & DEM System indicator offers traders a robust analytical framework combining dynamic EMA/SMA market structure with insightful volatility tracking via ATR analysis. Its clear visual presentation simplifies complex market information, enabling more informed, strategic, and timely 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.