Skip to main content

Class: SimpleMovingAverage

A utitlity class for calculating a numerical average of a selected number of samples.

Constructors

constructor

new SimpleMovingAverage(samples): SimpleMovingAverage

Class to return a numerical average from a specified number of inputs.

Parameters

NameTypeDescription
samplesnumberis the number of samples.

Returns

SimpleMovingAverage

Defined in

src/sdk/math/SimpleMovingAverage.ts:11

Methods

getAverage

getAverage(input): number

Returns a numerical average of the inputs.

Parameters

NameTypeDescription
inputnumberis the input number.

Returns

number

The numerical average.

Defined in

src/sdk/math/SimpleMovingAverage.ts:18


reset

reset(): void

Resets the average.

Returns

void

Defined in

src/sdk/math/SimpleMovingAverage.ts:33