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

  1. Trend identification and tracking
  2. Support and resistance level judgment
  3. Price breakout confirmation
  4. Trading signal generation
Last Updated: