Skip to main content

sma


SMA

Type: sma • Category: indicators

Description

Calculates the Simple Moving Average SMA based on a list of prices

Parameters

NameTypeDescriptionRequiredDefault
dataExpstringList of pricesno
usePricestringno"close"
periodnumberno14

Help

SMA

Simple Moving Average Indicator

Description

The SMA (Simple Moving Average) worker calculates the Simple Moving Average based on a list of prices. This indicator is commonly used in financial markets to analyze trends and make informed investment decisions.

What does this worker do?

This worker takes a list of prices and calculates the Simple Moving Average based on a specified period and price type (open, high, low, or close). The result is a smoothed-out price series that helps to identify trends and reduce noise.

How to interpret the results

The SMA indicator can be used to:

  • Identify trends: When the SMA is rising, it indicates an uptrend, and when it's falling, it indicates a downtrend.
  • Determine support and resistance levels: The SMA can act as a support level in an uptrend and a resistance level in a downtrend.
  • Generate signals: Crossovers between the SMA and the price can be used as buy or sell signals.

Parameters

The following parameters can be passed to the SMA worker:

Parameters Schema (JSON)

{
"dataExp": {
"type": "string",
"description": "List of prices"
},
"usePrice": {
"type": "string",
"enum": [
"open",
"high",
"low",
"close"
],
"default": "close"
},
"period": {
"type": "number",
"default": 14
}
}

Detailed Parameters

  • dataExp:
    • Type: string
    • Description: List of prices
  • usePrice:
    • Type: string
    • Enum: ["open", "high", "low", "close"]
    • Default: "close"
    • Description: The price type to use for calculations (open, high, low, or close)
  • period:
    • Type: number
    • Default: 14
    • Description: The number of periods to use for the moving average calculation

By adjusting these parameters, you can customize the SMA indicator to suit your specific needs and trading strategy.