SMA (Simple Moving Average)
Indicator Description
SMA (Simple Moving Average) is the most basic type of moving average. It smooths price movements by calculating the arithmetic average of prices over a certain period.
Function Information
- Function Name:
SMA - Input Parameters:
#Kline: K-line data
- Parameter Settings:
timeperiod: Time period (default: 30)
- Output: Moving average value
Calculation Principle
SMA is calculated using the following formula:
SMA = (Price1 + Price2 + ... + Pricen) / n
Where:
- Price1 to Pricen are the prices of n periods
- n is the time period
Usage Scenarios
- Trend identification and tracking
- Support and resistance level judgment
- Price breakout confirmation
- Trading signal generation