@ldrick/trade-indicators
Version:
Trade Indicators
11 lines (10 loc) • 402 B
JavaScript
import { amean } from './amean.js';
import { ma } from './ma.js';
/**
* The Simple Moving Average (SMA) calculates the arithmetic mean of prices over an period.
* It can be used to identify support and resistance levels.
* Also prices above the SMA can indicate uptrends, prices below can indicate downtrends.
*
* @public
*/
export const sma = (values, period = 20) => ma(values, period, amean);