UNPKG

@ldrick/trade-indicators

Version:
10 lines (9 loc) 399 B
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);