StockBeatStockBeat
Basics
  • Number Series
  • Boolean Series
  • Examples
  • Indicators
Alarms
Concepts
Basics
  • Number Series
  • Boolean Series
  • Examples
  • Indicators
Alarms
Concepts
  • Signals

    • Number Series
    • Boolean Series
    • Signal Examples
    • Indicators

      • Indicators
      • MFI (Money Flow Index)
      • ATR (Average True Range)
      • CCI (Commodity Channel Index)
      • CE (Chandelier Exit)
      • ER (Kaufman's Efficiency Ratio)
      • KC (Keltner Channel)
      • SMA (Simple Moving Average)
      • EMA (Exponential Moving Average)
      • MACD (Moving Average Convergence Divergence)
      • PPO (Percentage Price Oscillator)
      • RSI (Relative Strength Index)
      • FSO (Fast Stochastic Oscillator)
      • SSO (Slow Stochastic Oscillator)
      • BB (Bollinger Bands)
      • MAD (Mean Absolute Deviation)

SMA (Simple Moving Average)

The SMA (Simple Moving Average) is a trend-following indicator that calculates the average of a selected range of prices, usually closing prices, by the number of periods in that range. It is a lagging indicator as it is based on past prices. SMAs are used to identify the direction of a trend and to smooth out price data to filter out noise. See also Exponential Moving Average (EMA) and Moving Average concept.

Arguments

NameDescription
periodnumber of candles

Useful Signal Expressions

1. Golden Cross

Signal:

close().sma(50).crosses_above(close().sma(200))

Explanation: The 50-period SMA crosses above the 200-period SMA. This is a classic bullish signal known as a "Golden Cross".

2. Death Cross

Signal:

close().sma(50).crosses_below(close().sma(200))

Explanation: The 50-period SMA crosses below the 200-period SMA. This is a classic bearish signal known as a "Death Cross".

3. Price above SMA

Signal:

close().gt(close().sma(20))

Explanation: The closing price is above the 20-period SMA, indicating a short-term uptrend.

Last Updated:: 2/12/26, 8:03 AM
Contributors: ErenKizilay
Prev
KC (Keltner Channel)
Next
EMA (Exponential Moving Average)