sma2
SMA2
Type:
sma2
• Category:indicators
Description
Calculates the simple moving average SMA based on a list of prices (another instance)
Parameters
Name | Type | Description | Required | Default |
---|---|---|---|---|
dataExp | string | List of prices | no | |
timeperiod | number | no | 30 |
Help
SMA2
Description
The SMA2 worker calculates the simple moving average (SMA) of a list of prices over a specified time period. This indicator is commonly used in financial markets to analyze trends and make informed investment decisions.
What does this worker do?
The SMA2 worker takes a list of prices and a time period as input, and returns the simple moving average of the prices over the specified time period.
How to interpret the results
The result of the SMA2 worker is a value that represents the average price of the input list over the specified time period. A higher SMA value indicates an upward trend, while a lower SMA value indicates a downward trend. This indicator can be used to:
- Identify trends: A rising SMA indicates an upward trend, while a falling SMA indicates a downward trend.
- Provide support and resistance levels: The SMA can act as a support level in an upward trend, and as a resistance level in a downward trend.
Parameters
The following parameters can be passed to the SMA2 worker:
Parameters Schema (JSON)
{
"dataExp": {
"type": "string",
"description": "List of prices"
},
"timeperiod": {
"type": "number",
"default": 30
}
}
Parameters List
- dataExp:
- Type:
string
- Description: List of prices
- Type:
- timeperiod:
- Type:
number
- Description: Time period over which to calculate the SMA
- Default:
30
- Type:
Example Use Case
To calculate the 50-day SMA of a list of stock prices, you would pass the following parameters to the SMA2 worker:
dataExp
:stock_prices
(a list of stock prices)timeperiod
:50
The SMA2 worker would then return the simple moving average of the stock prices over the past 50 days.