PROTECTED SOURCE SCRIPT
Telah dikemas kini AIIA Moving Average SMA

The SMA, or Simple Moving Average, is one of the most fundamental and widely used technical analysis tools in financial markets. It is primarily used to identify price trends, determine support and resistance levels, and generate trading signals.
1. Definition and calculation principle of SMA moving average
SMA smoothes price fluctuations by calculating the arithmetic mean of closing prices within a specific period, eliminating short-term noise interference.
n represents the set periodicity (such as 5 days, 20 days, 200 days, etc.)
For example, the 20-day SMA is calculated by dividing the sum of the closing prices of the last 20 trading days by 20. Whenever a new trading day ends, the oldest data is removed and new data is incorporated, forming a dynamic moving average.
II. Core Functions and Application Scenarios of SMA
Trend identification
When the price is above the SMA and the moving average is sloping upwards, it indicates an upward trend;
On the contrary, if the price is below the moving average and the moving average is downward, it indicates a downward trend.
Common long-term moving averages, such as the 200-day Simple Moving Average (SMA), are regarded as the "bull-bear dividing line" and play a significant role in guiding market sentiment.
Support and resistance
In an uptrend, SMA often serves as a support level during pullbacks;
In a downtrend, it may evolve into a resistance level for a rebound;
Especially, long-term SMAs (such as 50-day and 200-day) carry strong psychological and technical significance at key points.
Cross-trading signal
Golden Cross: When the short-term SMA crosses above the long-term SMA (e.g., the 5-day moving average crosses above the 20-day moving average), it is considered a buy signal;
Death Cross: When the short-term SMA falls below the long-term SMA, it is considered a sell signal;
This type of combination is widely used in constructing trend-following strategies, such as the "Double Moving Average System".
III. Analysis of the Advantages and Disadvantages of SMA
table
Advantages Disadvantages
Simple to calculate, easy to understand and implement. However, it has a lag time, responding slowly to sudden price changes
It can effectively filter short-term fluctuations and reveal medium- and long-term trends. All historical data are given equal weight, failing to highlight the importance of recent prices
It is applicable to various markets such as stocks, futures, foreign exchange, and cryptocurrencies. In volatile markets, false signals are easily generated, leading to frequent misjudgments
IV. Suggestions for practical use
Cycle selection:
Short-term trend: SMA(10), SMA(20)
Medium-term trend: SMA(50), SMA(100)
Long-term trend: SMA(200)
Combination strategy:
It is recommended to combine short-term and long-term double moving averages (such as 10-day and 50-day) to enhance signal reliability;
It can be further verified through resonance with indicators such as trading volume and MACD to reduce the risk of misjudgment.
Target audience:
Suitable for investors who prefer trend following and focus on systematic trading, especially for those with medium to long-term positions.
1. Definition and calculation principle of SMA moving average
SMA smoothes price fluctuations by calculating the arithmetic mean of closing prices within a specific period, eliminating short-term noise interference.
n represents the set periodicity (such as 5 days, 20 days, 200 days, etc.)
For example, the 20-day SMA is calculated by dividing the sum of the closing prices of the last 20 trading days by 20. Whenever a new trading day ends, the oldest data is removed and new data is incorporated, forming a dynamic moving average.
II. Core Functions and Application Scenarios of SMA
Trend identification
When the price is above the SMA and the moving average is sloping upwards, it indicates an upward trend;
On the contrary, if the price is below the moving average and the moving average is downward, it indicates a downward trend.
Common long-term moving averages, such as the 200-day Simple Moving Average (SMA), are regarded as the "bull-bear dividing line" and play a significant role in guiding market sentiment.
Support and resistance
In an uptrend, SMA often serves as a support level during pullbacks;
In a downtrend, it may evolve into a resistance level for a rebound;
Especially, long-term SMAs (such as 50-day and 200-day) carry strong psychological and technical significance at key points.
Cross-trading signal
Golden Cross: When the short-term SMA crosses above the long-term SMA (e.g., the 5-day moving average crosses above the 20-day moving average), it is considered a buy signal;
Death Cross: When the short-term SMA falls below the long-term SMA, it is considered a sell signal;
This type of combination is widely used in constructing trend-following strategies, such as the "Double Moving Average System".
III. Analysis of the Advantages and Disadvantages of SMA
table
Advantages Disadvantages
Simple to calculate, easy to understand and implement. However, it has a lag time, responding slowly to sudden price changes
It can effectively filter short-term fluctuations and reveal medium- and long-term trends. All historical data are given equal weight, failing to highlight the importance of recent prices
It is applicable to various markets such as stocks, futures, foreign exchange, and cryptocurrencies. In volatile markets, false signals are easily generated, leading to frequent misjudgments
IV. Suggestions for practical use
Cycle selection:
Short-term trend: SMA(10), SMA(20)
Medium-term trend: SMA(50), SMA(100)
Long-term trend: SMA(200)
Combination strategy:
It is recommended to combine short-term and long-term double moving averages (such as 10-day and 50-day) to enhance signal reliability;
It can be further verified through resonance with indicators such as trading volume and MACD to reduce the risk of misjudgment.
Target audience:
Suitable for investors who prefer trend following and focus on systematic trading, especially for those with medium to long-term positions.
Nota Keluaran
The SMA, or Simple Moving Average, is one of the most fundamental and widely used technical analysis tools in financial markets. It is primarily used to identify price trends, determine support and resistance levels, and generate trading signals.1. Definition and calculation principle of SMA moving average
SMA smoothes price fluctuations by calculating the arithmetic mean of closing prices within a specific period, eliminating short-term noise interference.
n represents the set periodicity (such as 5 days, 20 days, 200 days, etc.)
For example, the 20-day SMA is calculated by dividing the sum of the closing prices of the last 20 trading days by 20. Whenever a new trading day ends, the oldest data is removed and new data is incorporated, forming a dynamic moving average.
II. Core Functions and Application Scenarios of SMA
Trend identification
When the price is above the SMA and the moving average is sloping upwards, it indicates an upward trend;
On the contrary, if the price is below the moving average and the moving average is downward, it indicates a downward trend.
Common long-term moving averages, such as the 200-day Simple Moving Average (SMA), are regarded as the "bull-bear dividing line" and play a significant role in guiding market sentiment.
Support and resistance
In an uptrend, SMA often serves as a support level during pullbacks;
In a downtrend, it may evolve into a resistance level for a rebound;
Especially, long-term SMAs (such as 50-day and 200-day) carry strong psychological and technical significance at key points.
Cross-trading signal
Golden Cross: When the short-term SMA crosses above the long-term SMA (e.g., the 5-day moving average crosses above the 20-day moving average), it is considered a buy signal;
Death Cross: When the short-term SMA falls below the long-term SMA, it is considered a sell signal;
This type of combination is widely used in constructing trend-following strategies, such as the "Double Moving Average System".
III. Analysis of the Advantages and Disadvantages of SMA
table
Advantages Disadvantages
Simple to calculate, easy to understand and implement. However, it has a lag time, responding slowly to sudden price changes
It can effectively filter short-term fluctuations and reveal medium- and long-term trends. All historical data are given equal weight, failing to highlight the importance of recent prices
It is applicable to various markets such as stocks, futures, foreign exchange, and cryptocurrencies. In volatile markets, false signals are easily generated, leading to frequent misjudgments
IV. Suggestions for practical use
Cycle selection:
Short-term trend: SMA(10), SMA(20)
Medium-term trend: SMA(50), SMA(100)
Long-term trend: SMA(200)
Combination strategy:
It is recommended to combine short-term and long-term double moving averages (such as 10-day and 50-day) to enhance signal reliability;
It can be further verified through resonance with indicators such as trading volume and MACD to reduce the risk of misjudgment.
Target audience:
Suitable for investors who prefer trend following and focus on systematic trading, especially for those with medium to long-term positions.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.