Indicators.MAOnArray()

Calculates the Moving Average indicator on data, stored in array, and returns its value.
Indicators.MAOnArray(prices:array, total:int, maPeriod:int, maShift:int, maMethod:int)

Parameters

Name Type Действие Значение по умолчанию
prices array Array with data.
total int The number of items to be counted. 0 means the whole array.
maPeriod int Averaging period for calculation.
maShift int MA shift. Indicators line offset relate to the chart by timeframe.
maMethod int Moving Average method. It can be any of Averaging enumeration values.

Return value

Numerical values of the Moving Average indicator, calculated on data, stored in array[].

Example

let maCurrent = Indicator.MAOnArray(ExtBuffer, 0, 5, 0, Averaging.LinearWeighted);